'Undefined' in replies...

Help
tanoshimi
2005-09-25
2013-04-25
  • tanoshimi
    tanoshimi
    2005-09-25

    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:
    define("DEFAULTPREDICATEVALUE", "undefined");
    If you try to use <get name="name"> for any variable which hasn't been set, this is what will return.

     
  • Alex Linthicum
    Alex Linthicum
    2008-08-21

    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):

    <category>
    <pattern>JUMP *</pattern>
    <template>
    <srai>JUMP</srai>
    <think><set name="mode">jump</set></think>
    </template>
    </category>

    This correctly sets the predicate 'mode':

    <category>
    <pattern>JUMP *</pattern>
    <template>
    <think><set name="mode">jump</set></think>
    <srai>JUMP</srai>
    </template>
    </category>

    Hope this helps someone.