I can't figure out where the default variables are set. Things like the user's name, age, etc come out as
'Undefined' in replies. In addition, even after telling the bot what my name is, the variable still remains Undefined in future replies. How do I fix that???
Not sure whether you mean default variables or default values, so I've got two possible answers...
1.) Default variables relate to properties of the bot, and not to the user. These are all declared in the <bot> section near the top of startup.xml.
You can then use these in pattern-side or template-side matching by using the syntax:
<bot name="name" />, <bot name="gender" /> etc.
2.) The default value for all user properties which haven't been defined is in dbprefs.php in the following line:
If you try to use <get name="name"> for any variable which hasn't been set, this is what will return.
Just learned something interesting about defining predicates (my apologies if this is common knowledge). If you use think/set tags in conjunction with a srai tag, the think/set tags have to come BEFORE the srai tag.
For example this fails to set the predicate 'mode' (UNDEFINED is returned when using get):
This correctly sets the predicate 'mode':
Hope this helps someone.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.