Setting Topic from perl|a2b|roy@wasystems.net|1222039534|a2b|xx|0|76.102.148.130|I'm not sure if you are currently able to set the topic for a user from perl or if I am just doing it wrong?<br /><br />[code]<br />$DATA&#123;'topic'&#125; = 'intro';<br />$rs-&gt;setUservar('localhost',%DATA);<br />[/code]<br /><br />||||
Re: Setting Topic from perl|a2b|roy@wasystems.net|1222040364|a2b|xx|0|76.102.148.130|Also, are you able to change the global debug value on the fly from perl?||||
Re: Setting Topic from perl|Kirsle|casey@cuvou.net|1222040819|Kirsle|xx|0|69.227.167.128|Here's a mod to rsdemo:<br /><br />[code]my $i = 0;<br />while (1) &#123;<br />  print &quot;You&gt; &quot;;<br />  chomp (my $msg = &lt;STDIN&gt;);<br /><br />  if ($msg =~ /^quit/i) &#123;<br />   exit(0);<br />  &#125;<br /><br />  my $reply = $rs-&gt;reply ('localuser',$msg);<br /><br />  print &quot;[$i] Bot&gt; $reply\n&quot;;<br />  $i++;<br /><br />  # test<br />  if ($i &gt;= 5) &#123;<br />   # Set the user's topic.<br />   $rs-&gt;setUservar ('localuser',topic =&gt; &quot;room1&quot;);<br />  &#125;<br />&#125;[/code]<br /><br />[code]You&gt; Hello.<br />[0] Bot&gt; How do you do. Please state your problem.<br />You&gt; I don't have a problem.<br />[1] Bot&gt; Why 'no'?<br />You&gt; Because I said so.<br />[2] Bot&gt; Don't any other reasons come to mind?<br />You&gt; No... not really.<br />[3] Bot&gt; Why not?<br />You&gt; We're going around in circles here.<br />[4] Bot&gt; Are you positive they are ?<br />You&gt; Yes.<br />[5] Bot&gt; I don't understand what you're trying to do.<br />You&gt; help?<br />[6] Bot&gt; Game help (todo)<br />You&gt; look<br />[7] Bot&gt; You're in a room with a big number 1 on the floor. You can exit via the north and west doors.[/code]<br /><br />And to set debug mode, just do setGlobal().<br /><br />[code]my $i = 0;<br />while (1) &#123;<br />  print &quot;You&gt; &quot;;<br />  chomp (my $msg = &lt;STDIN&gt;);<br /><br />  if ($msg =~ /^quit/i) &#123;<br />   exit(0);<br />  &#125;<br /><br />  my $reply = $rs-&gt;reply ('localuser',$msg);<br /><br />  print &quot;[$i] Bot&gt; $reply\n&quot;;<br />  $i++;<br /><br />  # test<br />  if ($i &gt;= 2) &#123;<br />   # Set debug mode.<br />   $rs-&gt;setGlobal (debug =&gt; 1);<br />  &#125;<br />&#125;[/code]<br /><br />[code]You&gt; hello bot<br />[0] Bot&gt; How do you do. Please state your problem.<br />You&gt; why?    <br />[1] Bot&gt; That is interesting. Please continue.<br />You&gt; no it's not.<br />RiveScript: Get reply to [localuser] no it's not.<br />RiveScript: Trying to match &quot;request&quot; against request (request)<br />RiveScript: Found a match!<br />RiveScript: Processing responses to this trigger.<br />RiveScript: Reply: &#123;ok&#125;<br />RiveScript: There's a %previous in this topic<br />RiveScript: lastReply: that is interesting please continue<br />RiveScript: Try to match lastReply to whats her name<br />RiveScript: Try to match lastReply to whats his name<br />RiveScript: Trying to match &quot;no it is not&quot; against shutdown&#123;weight=10000&#125; (shutdown)<br />RiveScript: Trying to match &quot;no it is not&quot; against reload&#123;weight=10000&#125; (reload)<br />[...][/code]||||
Re: Setting Topic from perl|a2b|roy@wasystems.net|1222041840|a2b|xx|0|76.102.148.130|Perfect, thanks. &nbsp;I suggest these examples be added to documentation when you get a chance.||||
