<?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/7261" />

	<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>2004-04-13T13:01:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2004-04-13T13:01:03-04:00</updated>

		<published>2004-04-13T13:01:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35495#p35495</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35495#p35495"/>
		<title type="html"><![CDATA[Help with response to CTCP ACTION]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35495#p35495"><![CDATA[
Instead of lots of if's use <a href="http://tmml.sourceforge.net/doc/tcl/switch.html" class="postlink">switch</a> to "evaluate one of several scripts, depending on a given value"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Apr 13, 2004 1:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darkmare]]></name></author>
		<updated>2004-04-13T11:50:08-04:00</updated>

		<published>2004-04-13T11:50:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35493#p35493</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35493#p35493"/>
		<title type="html"><![CDATA[Help with response to CTCP ACTION]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35493#p35493"><![CDATA[
Late last night, this is what I got working.  One of the biggest errors was that the CTCP ACTION requires 6, not 5, variables to be passed.<br><br>bind CTCP - action act:scritches<br><br>proc act:scritches {nick mask hand chan keyword arg} {<br>global scritches<br>if {[lindex $arg 0] == "scritches"} {<br>if {[lindex $arg 1] == "Max" || [lindex $arg 1] == "MaxCat" || [lindex $arg 1] == "max" || [lindex $arg 1] == "maxcat"} {<br>putserv "PRIVMSG $chan :\001ACTION [lindex $scritches [rand [llength $scritches]]] $nick.\001"<br>}<br>}<br>global pets<br>if {[lindex $arg 0] == "pets"} {<br>if {[lindex $arg 1] == "Max" || [lindex $arg 1] == "MaxCat" || [lindex $arg 1] == "max" || [lindex $arg 1] == "maxcat"} {<br>putserv "PRIVMSG $chan :\001ACTION [lindex $pets [rand [llength $pets]]] $nick.\001"<br>}<br>}<br>global rubs<br>if {[lindex $arg 0] == "rubs"} {<br>if {[lindex $arg 1] == "Max" || [lindex $arg 1] == "MaxCat" || [lindex $arg 1] == "max" || [lindex $arg 1] == "maxcat"} {<br>putserv "PRIVMSG $chan :\001ACTION [lindex $rubs [rand [llength $rubs]]] $nick.\001"<br>}<br>}<br>}<br><br>Someone also gave me a hint about using string -nocase to take care of the case issues.  Now one thing this will not do, is accept wildcards [lindex $arg 1] == "Max*" and not sure why, it "breaks" it to do so (runs, loads, just won't respond), but it does.  I'll take a look at that script you suggested.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4813">darkmare</a> — Tue Apr 13, 2004 11:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[YooHoo]]></name></author>
		<updated>2004-04-13T06:47:19-04:00</updated>

		<published>2004-04-13T06:47:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35485#p35485</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35485#p35485"/>
		<title type="html"><![CDATA[Help with response to CTCP ACTION]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35485#p35485"><![CDATA[
You might wish to take a look at a script Nerfbendr wrote called ActionResponder.tcl.  It does almost the same thing.<br><br><a href="http://nerfbendr.cjb.net/" class="postlink">Nerfbendr's Site</a><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2706">YooHoo</a> — Tue Apr 13, 2004 6:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[darkmare]]></name></author>
		<updated>2004-04-12T19:33:26-04:00</updated>

		<published>2004-04-12T19:33:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35474#p35474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35474#p35474"/>
		<title type="html"><![CDATA[Help with response to CTCP ACTION]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35474#p35474"><![CDATA[
OK, after searching the last few hours through at least 15 pages of search returns, I'm still having trouble.  First off,here's the part of the scipt:<br><br>bind CTCP - action act:scritches<br><br>proc act:scritches {nick mask hand chan arg} {<br>global scritches<br>if {[lindex $arg 1] == "scritches"} {<br>if {[lindex $arg 2] == "Max"} {<br>putserv "PRIVMSG $chan :\001ACTION [lindex $scritches [rand [llength $scritches]]] at $nick."<br>}<br>}<br>}<br><br> set scritches {<br> "purrs loudly"<br> "fires up the rumble machine"<br> "looks up"<br> "mrrrps"<br> }<br><br>I'm trying to get a cat to respond to actions (and have random responses).  The basic one above is responding to "ACTION Brendan scritches Max" (or MaxCat).  I'm fairly new to tcl, and this is my second bot.  Eventually he'll respond to other things and queue them up for eating, and well, this'll be a complicated bot by the time I get done with it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">  You'll probably see me here often.  I'm obviously missing something here, because it's not working, and I'm still not attuned to the nuances of tcl syntax.<br><br>I'd appreciate any help with this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4813">darkmare</a> — Mon Apr 12, 2004 7:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
