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

	<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-19T13:18:22-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-08-19T13:18:22-04:00</updated>

		<published>2010-08-19T13:18:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93999#p93999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93999#p93999"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93999#p93999"><![CDATA[
@dj-zath,<br>You do know that "incr L 0" is a NoOp (No Operation)?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Aug 19, 2010 1:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dj-zath]]></name></author>
		<updated>2010-08-19T10:53:54-04:00</updated>

		<published>2010-08-19T10:53:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93993#p93993</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93993#p93993"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93993#p93993"><![CDATA[
I'm planning a simular thing.. however I'm going to use a "stepped timer counter" idea..<br><div class="codebox"><p>Code: </p><pre><code>set L "0"proc    counter {} {    if {$L &lt; "2"}        do something        incr L        return 1     } else {        do something else        incr L "0"        return 0    }}</code></pre></div>just something I threw together for this post hehe<br><br>-DjZ-<br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> <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=10318">dj-zath</a> — Thu Aug 19, 2010 10:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-08-10T17:28:07-04:00</updated>

		<published>2010-08-10T17:28:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93859#p93859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93859#p93859"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93859#p93859"><![CDATA[
it wouldn't work for you as is. I use a custom proc in it that... I'm not exactly wanting to share, as it required tremendous work to get right... and I use a modified version of an alltools proc for the timer work, etc...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Tue Aug 10, 2010 5:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ashoq]]></name></author>
		<updated>2010-08-10T16:10:05-04:00</updated>

		<published>2010-08-10T16:10:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93853#p93853</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93853#p93853"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93853#p93853"><![CDATA[
cool <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> can u paste it for me please ?<br> 10x <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=11287">Ashoq</a> — Tue Aug 10, 2010 4:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-08-10T14:40:59-04:00</updated>

		<published>2010-08-10T14:40:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93851#p93851</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93851#p93851"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93851#p93851"><![CDATA[
Thanks, but I should have mentioned that I have long since solved this. I have it set now so that it kicks on second offense and on the third time it bans for 15 minutes, but it allows those 3 kicks only within an hour before resetting. I am using the comment field to store number of offenses though, rather than a counter like this one. I haven't had any luck running counters like that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Tue Aug 10, 2010 2:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ashoq]]></name></author>
		<updated>2010-08-10T14:36:25-04:00</updated>

		<published>2010-08-10T14:36:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=93850#p93850</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=93850#p93850"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=93850#p93850"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set slapreplies { "around a bit with a large trout. *SMACK SMACK*" "with a two by four upside the head. *KONK*" "with the mighty banhammer eventually :P" "with a slimy wet eel, or something similar :P" "then stares back. Don't expect an apology :P" "with the holy bible autographed by jesus himself. Repent now!" "with Chuck Norris' fist. *BOOM*" "right back twice as hard. 2x mode activated! Final battle, Fight!"}set maxactions "3"bind ctcp * ACTION slap:backproc slap:back {nick uhost hand chan kw arg} {   global slapped_us botnick slapreplies owner maxslaps   if {![validchan $chan]} {return 0}   if {[string match -nocase "*slap* $botnick*" $arg] || [string match -nocase "*slap* $owner*" $arg]} {      if {[info exists slapped_us($uhost)]} {         if {[incr slapped_us($uhost)] == $maxslaps} {            putserv "KICK $chan $nick :Please don't slap me!"            unset slapped_us($uhost)            return 0         }      } else {         set slapped_us($uhost) 1      }      putserv "PRIVMSG $chan :\001ACTION slaps $nick [lindex $slapreplies [rand [llength $slapreplies]]]\001"   }}</code></pre></div><strong class="text-strong">try this ( tested by me ) </strong><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11287">Ashoq</a> — Tue Aug 10, 2010 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-15T22:25:24-04:00</updated>

		<published>2010-03-15T22:25:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92492#p92492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92492#p92492"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92492#p92492"><![CDATA[
Ah, okay... I had tried adding another incr line cause I figured that's what needed to happen...<br><br>I am not getting any errors with that script, but the bot is not slapping or kicking at all now. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br>I may just have to stick with slapping the person back.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Mon Mar 15, 2010 10:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-03-15T21:39:43-04:00</updated>

		<published>2010-03-15T21:39:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92491#p92491</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92491#p92491"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92491#p92491"><![CDATA[
<blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code> if {[incr slapped_us($uhost)] == $maxslaps]} { </code></pre></div></div></blockquote>My bad. See above, fixed it within that code block.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Mar 15, 2010 9:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-15T20:47:28-04:00</updated>

		<published>2010-03-15T20:47:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92490#p92490</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92490#p92490"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92490#p92490"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code> if {[incr slapped_us($uhost)] == $maxslaps]} { </code></pre></div> causes error about an invalid ] . I assume its supposed to be <div class="codebox"><p>Code: </p><pre><code> if {[incr slapped_us($uhost) == $maxslaps]} { </code></pre></div> But then that gives the error: Tcl error [slap:back]: wrong # args: should be "incr varName <br>?increment?"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Mon Mar 15, 2010 8:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-03-15T22:35:53-04:00</updated>

		<published>2010-03-15T19:34:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92488#p92488</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92488#p92488"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92488#p92488"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set slapreplies { "around a bit with a large trout. *SMACK SMACK*" "with a two by four upside the head. *KONK*" "with the mighty banhammer eventually :P" "with a slimy wet eel, or something similar :P" "then stares back. Don't expect an apology :P" "with the holy bible autographed by jesus himself. Repent now!" "with Chuck Norris' fist. *BOOM*" "right back twice as hard. 2x mode activated! Final battle, Fight!"} set maxslaps "3"bind ctcp * ACTION slap:back proc slap:back {nick uhost hand chan kw arg} {   global slapped_us botnick slapreplies owner maxslaps   if {![validchan $chan]} {return 0}   if {[string match -nocase "*slap* $botnick*" $arg] || [string match -nocase "*slap* $owner*" $arg]} {      if {[info exists slapped_us($uhost)]} {         if {[incr slapped_us($uhost)] == $maxslaps} {            putserv "KICK $chan $nick :Its not polite to slap people D\:"            unset slapped_us($uhost)            return 0         }      } else {         set slapped_us($uhost) 1      }      putserv "PRIVMSG $chan :\001ACTION slaps $nick [lindex $actReplies [rand [llength $actReplies]]]\001"   }}</code></pre></div>Edit: fixed problem mentioned below. Solved.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Mon Mar 15, 2010 7:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-15T19:28:28-04:00</updated>

		<published>2010-03-15T19:28:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92487#p92487</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92487#p92487"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92487#p92487"><![CDATA[
I've been tinkering with this... it has a few bugs that I can't seem to work out.<br><br>I think it needs to be the other way around: as in, it will just slap unless maxactions == 3, then it will kick. Reason is that with it as is, it counts three actions in general as a kick, and so will kick after 3 actions. Not good. I've tried variations of this, but I can't get it to kick:<br><div class="codebox"><p>Code: </p><pre><code>set actReplies { "with a board" "with his banhammer :P" "with a car" "with a leather book" "with Godzilla" "with Chuck Norris" "right back"}set maxactions "3"bind ctcp * ACTION slap:backproc slap:back {nick uhost hand chan kw arg} {  global acount botnick actReplies owner maxactions    if {![validchan $chan]} {return 0}    if {[string match -nocase "*slap* $botnick*" $arg] || [string match -nocase "*slap* $owner*" $arg]} {        putserv "PRIVMSG $chan :\001ACTION slaps $nick [lindex $actReplies [rand [llength $actReplies]]]\001"        set ::acount($uhost) [expr {$::acount($uhost) +1}]    } elseif {[info exists $::acount($uhost)] &amp;&amp; [$::acount($uhost) == $::maxactions]} {         putserv "KICK $chan $nick :Its not polite to slap people D\:"         unset ::acount($uhost)    }}</code></pre></div>Here's the error it gives:  Tcl error [slap:back]: can't read <br>"::acount(<a href="mailto:webchat@1b533a89.189efabc.X">webchat@1b533a89.189efabc.X</a>)": no such variable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Mon Mar 15, 2010 7:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-12T22:56:11-04:00</updated>

		<published>2010-03-12T22:56:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92474#p92474</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92474#p92474"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92474#p92474"><![CDATA[
Nevermind... I had to make "maxactions" global. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> Thanks for showing me that, that should help me out later on.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Fri Mar 12, 2010 10:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-03-12T11:41:46-04:00</updated>

		<published>2010-03-12T11:41:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92470#p92470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92470#p92470"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92470#p92470"><![CDATA[
Thanks for the reply! <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"> I get an error though... if I leave it with 3 closing braces, it complains that its missing one, but if I add one, the bot dies. He did slap a test nick back once, but nothing more after that.<br><br>All together: <br><div class="codebox"><p>Code: </p><pre><code>set actReplies { "with a board" "with his banhammer :P" "with a car" "with a leather book" "with Godzilla" "with Chuck Norris" "right back"}set maxactions "3"bind ctcp * ACTION slap:backproc slap:back {nick uhost hand chan kw arg} {  global botnick actReplies owner    if {![validchan $chan]} {return 0}    if {[info exists ::acount($uhost)]} {    if {$::acount($uhost) &gt;= $::maxactions} {        putserv "KICK $chan $nick :Please don't slap me!"  unset ::acount($uhost)    } else {  set ::acount($uhost) [expr {$::acount($uhost) +1}}    } else {  set ::acount($uhost) "1"}    if {[string match -nocase "*slap* $botnick*" $arg]} {        putserv "PRIVMSG $chan :\001ACTION slaps $nick [lindex $actReplies [rand [llength $actReplies]]]\001"    if {[string match -nocase "*slap* $owner*" $arg]} {        putserv "PRIVMSG $chan :\001ACTION slaps $nick in $owner's defense\001"    }  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Fri Mar 12, 2010 11:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[TCL_no_TK]]></name></author>
		<updated>2010-03-11T23:15:17-04:00</updated>

		<published>2010-03-11T23:15:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92468#p92468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92468#p92468"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92468#p92468"><![CDATA[
You can try using something like this, <div class="codebox"><p>Code: </p><pre><code>if {[info exists ::acount($uhost)]} { if {$::acount($uhost) &gt;= $::maxactions} {  # do somthing...  unset ::acount($uhost) } else {  set ::acount($uhost) [expr {$::acount($uhost) +1}] }} else { set ::acount($uhost) "1"}</code></pre></div> Add it after <div class="codebox"><p>Code: </p><pre><code>     if {![validchan $chan]} {return 0} </code></pre></div> And add <div class="codebox"><p>Code: </p><pre><code>set maxactions "3"</code></pre></div> above <div class="codebox"><p>Code: </p><pre><code>bind ctcp * ACTION slap:back </code></pre></div><blockquote class="uncited"><div>  # do somthing...</div></blockquote> Change to <div class="codebox"><p>Code: </p><pre><code>putserv "KICK $chan $nick :Please don't slap me!"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8130">TCL_no_TK</a> — Thu Mar 11, 2010 11:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-08-13T13:34:44-04:00</updated>

		<published>2010-03-11T00:10:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92459#p92459</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92459#p92459"/>
		<title type="html"><![CDATA[How would I do this? [solved]]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92459#p92459"><![CDATA[
I am wanting my bot to kick users if they do something an x number of times. Like an action, slapping the bot, etc. I already have a script that will make the bot slap the user back if they slap it or me, but I want it to kick if they slap the bot(or me) three times. How would a counter like this be added?<br><div class="codebox"><p>Code: </p><pre><code>set actReplies { "with a board" "with his banhammer :P" "with a car" "with a leather book" "with Godzilla" "with Chuck Norris" "right back"}bind ctcp * ACTION slap:back proc slap:back {nick host hand chan kw arg} {  global botnick actReplies owner     if {![validchan $chan]} {return 0}     if {[string match -nocase "*slap* $botnick*" $arg]} {        putserv "PRIVMSG $chan :\001ACTION slaps $nick [lindex $actReplies [rand [llength $actReplies]]]\001"     if {[string match -nocase "*slap* $owner*" $arg]} {        putserv "PRIVMSG $chan :\001ACTION slaps $nick in $owner's defense\001"     }  }}</code></pre></div>I am guessing I would need to write that action slap data to a file... then make an if statement to check it for the count number?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11101">Luminous</a> — Thu Mar 11, 2010 12:10 am</p><hr />
]]></content>
	</entry>
	</feed>
