logic|Art|stoney535@gmail.com|1360524975|Art|xx|0|69.255.165.151|Is there any way to implement some logic into Rivescript such as IF...THEN or Markov?<br /><br />User: I have a Toy.<br />Bot: OK<br /><br />User: My toy is a Train.<br />Bot: Got it.<br /><br />User: The color of my Toy Train is gray.<br />Bot: Makes sense.<br /><br />######<br />Later...<br />User: What kind of Train did I have?<br />Bot: It was a Toy Train.<br /><br />User: What color was my Toy Train?<br />Bot: The color of your Toy Train was gray.<br /><br />and so forth....<br />#######<br /><br />I'd like for the bot to have the ability to set aside an area for &quot;holding&quot; or retaining &quot;Long Term&quot; memory items for recall at a later time / date.<br /><br />Could a DB or file be constructed in this regard?<br /><br />Sorry but I am enjoying the RiveScript experience!! ;) ;)||||
Re: logic|Kirsle|casey@cuvou.net|1360525260|Kirsle|xx|0|76.168.88.125|Not very easily!<br /><br />You can do some simpler things like this though:<br /><br />[code]+ my favorite * is *<br />- &lt;set favorite_&lt;star1&gt;=&lt;star2&gt;&gt;I'll remember that.<br /><br />+ what is my favorite *<br />* &lt;get favorite_&lt;star&gt;&gt; != undefined =&gt; Your favorite &lt;star&gt; is &lt;get favorite_&lt;star&gt;&gt;!<br />- You didn't tell me what your favorite &lt;star&gt; is![/code]<br /><br />For output like:<br /><br />[code]User: my favorite color is blue<br />Bot: I'll remember that.<br />User: my favorite food is pizza<br />Bot: I'll remember that.<br />User: what is my favorite color?<br />Bot: Your favorite color is blue!<br />User: what is my favorite food?<br />Bot: Your favorite food is pizza!<br />User: what is my favorite song?<br />Bot: You didn't tell me what your favorite song is![/code]||1360525300|Kirsle|
Re: logic|Art|stoney535@gmail.com|1360528809|Art|xx|0|69.255.165.151|Thanks! I was thinking that maybe it could be used in conjunction with say, Ajax to construct some Tables to store the data and recall as needed later.<br /><br />Thoughts? :-?||||
Re: logic|Art|stoney535@gmail.com|1360531331|Art|xx|0|69.255.165.151|I saved your example as favorites.rs and tested it.<br /><br />I tried several examples and with each one, it's response was,&quot;<br />You favorite food was undefined. or You favorite &lt;anything&gt; was undefined.<br /><br />I am using the bot locally along with the modified ALICE set in case something in there might be causing the error.<br /><br />??||||
Re: logic|Kirsle|casey@cuvou.net|1360567348|Kirsle|xx|0|76.168.88.125|It's probable that one of Alice's responses is overriding yours. Try adding something like &#123;weight=100&#125; to your trigger to make it higher priority than any of Alice's.||||
Re: logic|Art|stoney535@gmail.com|1360717093|Art|xx|0|69.255.165.151|Kirsle,<br /><br />This error suddenly appeared and no matter what I do, will NOT go away. I have tried removing the file, renaming and substituting the file yet the same error persists. Notice that the IS NO ERROR apparent to substantiate the &quot;e&quot; Warning upon startup.<br /><br />I did a screen capture showing the open file with line 351 clearly shown but I do not see any way to upload a .jpg file here.<br /><br />The Error says:<br />RiveScript::Warning: Unrecognized command &quot;e&quot; at C:/Perl64/site/lib/RiveScript/demo/aimlF.rs line 351.<br />Hint: use 'rivescript --help' ...blah.....<br /><br />Appreciate a little help...Thanks!!||||
Re: logic|Kirsle|casey@cuvou.net|1360717358|Kirsle|xx|0|38.122.20.226|Copy and paste the text from aimlF.rs around line 351.<br /><br />That error would come up when one of the lines of text in the file begins with an &quot;e&quot; instead of a RiveScript command (like + or -). If you jump to line 351 in a text editor, the first non-space character shouldn't be an &quot;e&quot; ;)||||
Re: logic|Art|stoney535@gmail.com|1360718157|Art|xx|0|69.255.165.151|Wow! You are quick with the replies! Thank you!<br /><br />I went through the file again and down at the very last line...bottom of the file, was line 517 according to the Crimson Editor that shows line numbers and which I have used for several years!! Go figure!<br /><br />Sure enough, there was a line then must have had the first letter or so accidentally deleted leaving just a starting &quot;e&quot;. The program was trying to tell me. I just kept relying on the line numbers that were being shown to me with the text editor.<br /><br />Would you have a good editor in mind? (Free is a good price 'cause I'm old and tired!! Heh!!<br /><br />Thanks again! I do appreciate your efforts!! ;)||||
Re: logic|Kirsle|casey@cuvou.net|1360720708|Kirsle|xx|0|38.122.20.226|Hah, well it might've been RiveScript that was wrong about the line number, as it counts them up as it goes. It should be accurate most of the time but there's some tricky loops that the code runs through in the parsing process so there may be a bug in how it counts the lines. Of course it could also be the case that your text editor does line wrapping, and counts a wrapped line as a second line. Not sure.<br /><br />I just use the gedit text editor on Linux. http://projects.gnome.org/gedit/||||
Re: logic|Art|stoney535@gmail.com|1360723484|Art|xx|0|69.255.165.151|Thanks!!<br /><br />I'm still reading over the manual to see just what's possible with the code. Looks promising and like a lot of things, there's usually more than one way to accomplish the same end result.<br /><br />Cheers!!||||
