[pandorabots-general] conditions based on > or < values

GT40 gt40 at tiscali.fr
Tue Apr 24 18:03:12 PDT 2007


Hi SuperPotent!

If you accept to add some JavaScript to AIML, it's possible. Maybe you could
try something like this:

<category>
<pattern>I LIKE TO DRINK</pattern>
<template>Your age, please?</template> 
</category>

<category>
<pattern> * </pattern>
<that>Your age, please?</that>
<template>
<think><set name="age"><star /></set></think>
<script language="JavaScript">
a=parseInt("<star />");
if (a>=20) {document.write("We should get a drink together sometime");}
else {document.write("You're not even old enough!");}
</script>
</template> 
</category>

All this needs many improvements (and other patterns).

And you know what? The next step for me is to find the method to make my
(talking) bot shut up when she reads the script...




SuperPotent wrote:
> 
> Hi, Im new to AIML and have been using gaitobot editor.
> I am trying to set up conditions in a template where the response will
> depend on a person's age.
> so for instance if i have this:
> 
> 000001: <category>
> 000002:     <pattern>
> 000003:         I LIKE TO DRINK
> 000004:     </pattern>
> 000005:     <template>
> 000006:         <condition name="age" value=">20">
> 000007:             we should get a drink together sometime
> 000008:         </condition>
> 000009:         <condition name="age" value="<21">
> 000010:             you're not even old enough!
> 000011:         </condition>
> 000012:     </template>
> 000013: </category>
> 
> now this doesn't work, presumably because i have the > or <  sign within
> the quotation marks, but in gaitobot, they don't seem let you change
> "value="20" to value>"20".  Does anyone know if there is a way to do
> something like this?
> 

-- 
View this message in context: http://www.nabble.com/conditions-based-on-%3E-or-%3C-values-tf3625507.html#a10172522
Sent from the Pandorabots-general mailing list archive at Nabble.com.



More information about the pandorabots-general mailing list