<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/17936" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2010-08-23T07:52:07-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/17936</id>

		<entry>
		<author><name><![CDATA[gasak]]></name></author>
		<updated>2010-08-22T22:15:53-04:00</updated>

		<published>2010-08-22T22:15:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94065#p94065</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94065#p94065"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94065#p94065"><![CDATA[
Resolved!! Awesome.. It Works <strong class="text-strong">nml375</strong>.. thanks a lot.. The key point is just put the string map on the puthelp..<br><br>Thanks again <strong class="text-strong">nml375</strong>. You're the man!! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>And also to <strong class="text-strong">Luminous</strong> and <strong class="text-strong">game_over</strong> thanks for all the input.. you are all awesome.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11310">gasak</a> — Sun Aug 22, 2010 10:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-08-23T07:52:07-04:00</updated>

		<published>2010-08-22T12:23:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94055#p94055</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94055#p94055"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94055#p94055"><![CDATA[
Gasak, since I don't have the code you are currently using, here's a proper example on how you would implement the "string map" approach. Implement accordingly in your script..<br><div class="codebox"><p>Code: </p><pre><code>set PokeText [list \  "\001ACTION pokes %nick% back\001" \  "\001ACTION punches %nick%\001" \  "Don't try to poke %botnick%"]bind ctcp - ACTION pokemeproc pokeme {nick host hand dest key text} {  if {[string match -nocase "*poke? ${::botnick}*" $text]} {    set response [lindex $::PokeText [rand [llength $::PokeText]]]    puthelp "PRIVMSG $chan :[string map [list "%nick%" $nick "%botnick%" $::botnick] $response]"  }}</code></pre></div>Edit: Forgot the rand-command to pick a random entity from the list..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Aug 22, 2010 12:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gasak]]></name></author>
		<updated>2010-08-22T10:59:19-04:00</updated>

		<published>2010-08-22T10:59:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94053#p94053</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94053#p94053"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94053#p94053"><![CDATA[
<blockquote class="uncited"><div>try<div class="codebox"><p>Code: </p><pre><code>set PokeText [string map "\$nick {$nick} \$dest {$dest} \$botnick {$::botnick}" $PokeText]</code></pre></div></div></blockquote>hi game_over, i try using it but still not work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11310">gasak</a> — Sun Aug 22, 2010 10:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-08-22T09:12:04-04:00</updated>

		<published>2010-08-22T09:12:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94051#p94051</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94051#p94051"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94051#p94051"><![CDATA[
A few remarks,<br>string map actually expects the first argument (the string mapping definition) to be a valid tcl-list, and the secod argument to be a string. Thus there is nothing wrong with using the list-command as posted.<br><br>I do notice that you save the result of the string map operation back to the very same variable, which rather obviously explains why only the first trigger 'sets' the nickname to be used for all further invocations..<br><br>Also, this is a no-brainer:<div class="codebox"><p>Code: </p><pre><code>join [lrange [split $text] 0 end]</code></pre></div>It will simply return the same as just using $text.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Aug 22, 2010 9:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[game_over]]></name></author>
		<updated>2010-08-22T02:27:38-04:00</updated>

		<published>2010-08-22T02:27:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94045#p94045</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94045#p94045"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94045#p94045"><![CDATA[
try<div class="codebox"><p>Code: </p><pre><code>set PokeText [string map "\$nick {$nick} \$dest {$dest} \$botnick {$::botnick}" $PokeText]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8946">game_over</a> — Sun Aug 22, 2010 2:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gasak]]></name></author>
		<updated>2010-08-21T22:58:35-04:00</updated>

		<published>2010-08-21T22:58:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94044#p94044</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94044#p94044"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94044#p94044"><![CDATA[
Hi,<br><br>I did remove the list but it doesn't work. Can you give me any example of this substitution?<br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11310">gasak</a> — Sat Aug 21, 2010 10:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-08-20T10:28:40-04:00</updated>

		<published>2010-08-20T10:28:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94029#p94029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94029#p94029"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94029#p94029"><![CDATA[
Well.. whenever I do things like that, I like to use a file to hold the content and then use the "subst -nocommands" command to substitute that stuff automagically. However, this should still work, I've seen people do this before with string map. I think your line is failing because you are trying to apply a list value to string command:<br><div class="codebox"><p>Code: </p><pre><code>set PokeText [string map [list "\$nick" "$nick" "\$dest" "$dest" "\$botnick" "$::botnick"] $PokeText]</code></pre></div>Bascially, you are passing a list to something that effects a string with this method. Removing that "list" should get better results.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Fri Aug 20, 2010 10:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gasak]]></name></author>
		<updated>2010-08-19T22:28:21-04:00</updated>

		<published>2010-08-19T22:28:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94015#p94015</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94015#p94015"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94015#p94015"><![CDATA[
Thanks Luminous. I made a random text of reply such,<br><div class="codebox"><p>Code: </p><pre><code>set PokeText {  "\001ACTION poke $nick back"  "\001ACTION punch $nick *bletaakkss*"  "Dont try to poke $botnick"  "i'll ask $dest user to poke you back"}</code></pre></div>And to make that work i put set on the proc such,<br><div class="codebox"><p>Code: </p><pre><code>set PokeText [string map [list "\$nick" "$nick" "\$dest" "$dest" "\$botnick" "$::botnick"] $PokeText]</code></pre></div>It works for a while. I try to poke on the channel and it replace the $nick with my nick. But here comes the eror, when someone else poke the bot again the bot replies with still using my nick instead of the other one nick's that pokes it.<br><br>Am i using the wrong set of map list? Please help.<br><br>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11310">gasak</a> — Thu Aug 19, 2010 10:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-08-18T20:43:07-04:00</updated>

		<published>2010-08-18T20:43:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93983#p93983</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93983#p93983"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93983#p93983"><![CDATA[
I was bored, see if this works for ya. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>bind ctcp * ACTION responsesproc responses {nick host hand chan kw arg} {    if {[string match -nocase "*pokes ${::botnick}*" $arg]} {      putserv "PRIVMSG $chan :Don't ever try to poke me! D:"    } return}bind pubm * * bot_is_doingproc bot_is_doing {nick host hand chan text} {    if {[regexp -nocase -- ".*doing.*${::botnick}.*" [join [lrange [split $text] 0 end]]] || [regexp -nocase -- ".*${::botnick}.*doing.*" [join [lrange [split $text] 0 end]]]} {      putserv "PRIVMSG $chan :It's am, I am sleeping, please don't disturb me."    } elseif {[regexp -nocase -- ".*owner.*${::botnick}.*" [join [lrange [split $text] 0 end]]] || [regexp -nocase -- ".*:${::botnick}.*owner.*" [join [lrange [split $text] 0 end]]]} { set nicks [chanlist $chan]        putserv "PRIVMSG $chan :\001Action points to [lindex $nicks [rand [llength $nicks]]]\001"    }}</code></pre></div>Note that those regexes are supposed to be on one line :\<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Wed Aug 18, 2010 8:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gasak]]></name></author>
		<updated>2010-08-17T04:02:43-04:00</updated>

		<published>2010-08-17T04:02:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93964#p93964</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93964#p93964"/>
		<title type="html"><![CDATA[smart bot reply]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93964#p93964"><![CDATA[
can anyone help me creating a script with a smart reply if some one type or action (/me) with specific word and also mention bot name on channel?<br><br>Example 1:<br>&lt;me&gt;/me pokes $botnick<br>&lt;bot&gt; hey $nick dont ever try to poke me!!<br><br>Example 2:<br>&lt;me&gt;what are you doing $botnick?<br>&lt;bot&gt;am sleeping dont disturb me<br><br>So it has a trigger and response.. But not notice where the $botnick places. As long as the $botnick mention (even in the first word, middle, or last) with specific "word" thats already set on the script, it will reply.<br><br>and also if possible i want to include on the response par that the bot will say random nick on channel:<br><br>Example 3:<br>&lt;me&gt;$botnick who is your owner?<br>&lt;bot&gt;\action point to $random_nick_on_chan<br><br>Thanks before for the help <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11310">gasak</a> — Tue Aug 17, 2010 4:02 am</p><hr />
]]></content>
	</entry>
	</feed>
