Well I ended up simply overriding the specific error message by running messages through an error checking function.
That leaves the more benevolent “Error executing Python object:” intact as it reacts to object execution, not replies. But removes the uglier ” [ERR: Error when executing Python object]” that I simply replaced with “I’m sorry, something went wrong.”
Ideally Id like the user to be able to reply by saying “What went wrong?” or something to that effect, but I am not there yet.
Which leads me to a feature request that I stumbled upon doing this though.
It would be really nice if the Continuation tag ^ waited one loop to print. As it is it’s only a line extension, which gives me some issues, like with the Previous command %.
Consider the following script:
+ (what|where|who) is [an|a] *
- <call>setvar temp <star2></call>
^ <call>wiki_short <star2></call>
^ Would you like to know more?
+ (@yes) [*]
% would you like to know more
- <call>wiki_long <get temp></call>
^ Source is from Wikipedia.
Ok so this is pretty simple, when a person asks about a thing the bot looks it up in wikipedia, and gives the FIRST line (short version), then asks Would you like to know more, and if yes prints the whole article (long version).
2 problems arose.
First it takes a few seconds to get information from the net, at which point nothing happens, if I try this:
- One second please.
^ <call>wiki_short <star2></call>
The bot WONT say “One second please” as the script is loading, rather it will freeze for a few seconds and then dump the information from wikipedia and THEN say “One second please”. Obviously because it is executing all it’s code within the same loop.
The workaround I did was simple have the script itself print a message to the user.
The second issue is if the info from wiki is returned, then the % Previous command wont pick up the reply. Obviously because it considers the whole thing a reply and wont recognize just the last line. It would be nice, and cleaner if it did.
My workaround was using print instead of return.
So it’s no big deal, I found workarounds, it was just something that caused me some headache and could perhaps be considered for RS 2.1 as it would improve the usability of continuation tags.