Welcome to Synthiam!

Program robots using technologies created by industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation, and artificial intelligence easy.

Get Started
United Kingdom
Asked — Edited
Resolved Resolved by DJ Sures!

Correct Format For Control Command

I've stumbled across a strange formatting issue and I'm hoping someone can point me in the right direction. I say strange, as most of the time it works fine, but a few times, it doesn't

The scenario is, I have the Popup Display plugin and a Pandorabot control. I am using the following Popup Display ControlCommand() in the Pandorabots "Response Script" script editor...

Code:

ControlCommand("Display Popup", Display, "" +$pandoraResponse)


which for the main part seems to be working okay. But there are certain Pandorabot responses that throws out a "Error on line 1: Input string was not in a correct format." which relates to the Popup ControlCommand() as the display does not pop up as it should. As far as I can tell, there's nothing wrong with the AIML category, but the display does pop up on most of the other responses. Nothing else is involved, just what's outlined above.

Has anyone got any ideas what is causing the error?

AI Support Bot
Related Content
Synthiam
PRO
Synthiam
#1  
Use the variable watcher and give us examples of the data in the $pandoraResponse that's causing the error
United Kingdom
#2  
Wow DJ, You're up late (or really early).:)

Sure. Here's a screen grab with the variable watcher added...

User-inserted image


and another of the AIML code I'm using that kicks out the error (can't put it in code tags as it won't format properly)...

User-inserted image


Like I said, it's weird that most of the other AIML codes work without the error, just the "what is your name" one and a couple of others which I can't remember which. This one works fine with no errors and brings up the popup display...

User-inserted image


It's formatted exactly the same as the "ask name" one. Here's the script I'm using in the Pandora response script (also in post #1)

Code:

ControlCommand("Display Popup", Display, "" +$pandoraResponse)


User-inserted image


Have I formatted that ControlCommand() correctly? If you need anything else, give us a shout.

Thanks.

EDIT: Here's a quick vid of it in action...

United Kingdom
#3  
@DJ.

Well, I figured it out. Anything with E4 B4 (upper case) in the AIML files was causing the error. I reformatted it to e4 b4 (lower case) and low and behold... it worked.:) There's a few other default AIML files that have the same issues that uses tags within tags that the popup display doesn't like, but it's something I can live with so no real problem.
#4  
I believe you may be running into the exponent bug I ran into a while back when working with data from a web page. With a text string, any time a capital E is directly followed by a number, the script language interprets it as an exponent and not text.

I would be interested if the error is still thrown if you lowered just the E and left the B as uppercase just to see if the problem is really the exponent bug.
United Kingdom
#5  
@WBS.

You saying that just reminded me of your thread. Pandora is having a little bit of "me" time right now. When it's back up, I'll give it a try and see what happens.
United Kingdom
#6  
@WBS.

Strange things afoot. I tried using lowercase "e" and uppercase "B", published the changes, and it still worked with the popup showing, no error. Now the strange thing. When I use the Pandorabot "train" interface, the "B" shows as lowercase. I then tried both uppercase "E"4 and "B"4, they both show as lowercase in the train interface and, ready for this... in the popup display as well, no error this time. *confused*
#7  
So it looks like the train interface changes everything to lowercase, thereby returning the text in lowercase. Which, in turn, supplies lowercase e to the popup display.

At least the fact that making the E lowercase while leaving the B uppercase confirms that it is the exponent bug at work here. Assuming I understand you correctly.

I would have sworn I tried lowercase e when I was looking for a workaround to the bug, but I guess not. I ended up changing it from E to E' instead. So E297 would be E'297. In your case E'4. The single quote mark was not spoken when the Say command was used, nor was there any lag between the E and the number when spoken, so it worked out Ok for what I was doing. Anyway, I tried substituting a lowercase e and that worked fine. So that seems to be the best overall workaround for now.

Just a reminder while we are on the topic, the other bugs were the combination \" (backslash followed directly by a double quote) and a left paren anywhere in the string. Both cause crashes in the script. Fortunately, those are not likely to end up an a response from Pandorabot, but ya never know.
United Kingdom
#8  
@WBS.

Quote:

t looks like the train interface changes everything to lowercase, thereby returning the text in lowercase. Which, in turn, supplies lowercase e to the popup display.


Not so much, at least not everything. If you check out the first screen grab in post #3 (top right corner), at the start of the senstance the "I" is still uppercase as well as "December". Interesting about the backslash and quote marks.

The "E4 B4" format is still working (at least it was a couple of hours ago) both in the training interface and popup display. Ther is a good chance you did try lowercase "e", as there is some weird stuff happening. Anyway, at least it's not the popup displays fault, just the AIML.
United Kingdom
#9  
Just wanted to mark this as resolved. As I ended up resolving it myself, I'll credit DJ so he can put the credit back in to the kitty.

Thanks guys.