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

	<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>2006-06-23T19:46:58-04:00</updated>

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

		<entry>
		<author><name><![CDATA[aliby]]></name></author>
		<updated>2006-06-23T19:46:58-04:00</updated>

		<published>2006-06-23T19:46:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64293#p64293</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64293#p64293"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64293#p64293"><![CDATA[
Garp,<br><br>When talking about the checking in cleanup, is this what you mean?<br><div class="codebox"><p>Code: </p><pre><code>bind time - "00 *" clean:requestcacheproc clean:requestcache {{args ""}} {set limit [expr [lindex [split $requestcache($nick)] 0] - (3600 * 24)]   foreach {x y} [array get requestcache] {      if {$y &lt;= $limit } {        unset talkusers($x)              }   }}</code></pre></div>Or am I way off?<br><br>Thanks,<br><br>-Noah<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7903">aliby</a> — Fri Jun 23, 2006 7:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Garp]]></name></author>
		<updated>2006-06-23T19:32:47-04:00</updated>

		<published>2006-06-23T19:32:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64292#p64292</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64292#p64292"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64292#p64292"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {![info exists requestcache($nick)]} {        set response "Please use #findscrim to find scrims"        set requestcache($nick) "[unixtime] 0"} else {set requests [lindex [split $requestcache($nick)] 1]if { ($requests &gt;= 3) } {#kick ban ... whatever}incr requestsset requestcache($nick) "[unixtime] $requests"}</code></pre></div>On cleanup you need to check for [lindex [split $requestcache($nick)] 0] where you have the timestamp.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3849">Garp</a> — Fri Jun 23, 2006 7:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aliby]]></name></author>
		<updated>2006-06-23T19:16:18-04:00</updated>

		<published>2006-06-23T19:16:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64291#p64291</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64291#p64291"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64291#p64291"><![CDATA[
Garp<br><br>How would you make it so that if you repeated 3 or 4 or 5 times in 24 hours, it would kick the person?<br><br>What about 3 or 4 or 5 in 1 hour?<br><br>Basically I'd just like to have an explanation of how the code works so that I can understand it and use it again sometime.<br><br>Thanks,<br><br>-Noah<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7903">aliby</a> — Fri Jun 23, 2006 7:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Garp]]></name></author>
		<updated>2006-06-23T10:21:46-04:00</updated>

		<published>2006-06-23T10:21:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64283#p64283</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64283#p64283"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64283#p64283"><![CDATA[
You would need to timestamp the handled nicks.<br><div class="codebox"><p>Code: </p><pre><code>array set requestcache {}proc helptext {nick uhost hand chan text} {global botnick requestcache ...if [regexp {(\dv\d|\d v \d).*(\your|\yyour)} $helptext] {    if {![info exists requestcache($nick)]} {        set response "Please use #findscrim to find scrims"        set requestcache($nick) [unixtime]         } else {        putserv "KICK $chan $nick :We already had that"                     set requestcache($nick) [unixtime]        return     } }</code></pre></div>      <br>And you need a function that cleans the timestamped nicks all hours<br><div class="codebox"><p>Code: </p><pre><code>bind time - "00 *" clean:requestcacheproc clean:requestcache {{args ""}} {global requestcacheset limit [expr [unixtime] - (3600 * 24)] foreach {x y} [array get requestcache] {  if { $y &lt;= $limit } {   unset talkusers($x)  } }}</code></pre></div>Oh damn, you want to kick on the 3th request? This here kicks within the 2nd <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">) sorry for being uncondensated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3849">Garp</a> — Fri Jun 23, 2006 10:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aliby]]></name></author>
		<updated>2006-06-23T09:49:27-04:00</updated>

		<published>2006-06-23T09:49:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64282#p64282</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64282#p64282"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64282#p64282"><![CDATA[
Garp,<br><br>Thanks! That worked beautifully.<br><br>Now I have another question. If the bot has to tell the same person ($nick) to use #findscrim more than 3 times, I would like the bot to kick the person. <br><br>And by 3 times I mean 3 times in one day.<br><br>How would I go about doing that?<br><br>-Noah<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7903">aliby</a> — Fri Jun 23, 2006 9:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Garp]]></name></author>
		<updated>2006-06-23T08:32:33-04:00</updated>

		<published>2006-06-23T08:32:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64279#p64279</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64279#p64279"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64279#p64279"><![CDATA[
just move the flock setting to the portion of the code you want to protect.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3849">Garp</a> — Fri Jun 23, 2006 8:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aliby]]></name></author>
		<updated>2006-06-23T01:13:14-04:00</updated>

		<published>2006-06-23T01:13:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64273#p64273</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64273#p64273"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64273#p64273"><![CDATA[
Grim,<br><br>I only want that to work for the one output statement though... Not the other one. I have also updated the code:<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * helptext proc helptext {nick uhost hand chan text} {global botnickset response defaultset admin 0set helptext [string tolower $text]if {[isop $nick $chan] == 0} {   if [regexp {((admin|op).*(\ypm|\yaround|\yneed|\yhere))|((\ypm|\yaround|\yneed|\yhere).*(admin|op))} $helptext] {           set response "Please ask your question in the channel."        }   if [regexp {(\dv\d|\d v \d).*(\your|\yyour)} $helptext] {         set response "Please use #findscrim to find scrims"      }#there is more that goes here, but i'll skip that   if {![regexp {default} $response]} {putmsg $chan "$response"}}</code></pre></div><br>Any thoughts?<br><br>-Noah[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7903">aliby</a> — Fri Jun 23, 2006 1:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Garp]]></name></author>
		<updated>2006-06-22T19:32:31-04:00</updated>

		<published>2006-06-22T19:32:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64268#p64268</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64268#p64268"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64268#p64268"><![CDATA[
set a lock. For example like this here:<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * helptextset helpflock 0proc helptext {nick uhost hand chan text} {global helpflockset response defaultif [string match $helpflock 1] { return }set helpflock 1set notagain 4;# change this to a value in secounds that fits your needset helptext [string tolower $text]    if [regexp {(admin|op|pm).*(admin|op|pm)} $helptext] {    set response "Please ask your question in the channel before asking an admin/op to PM you."    }    if {[regexp {(\dv\d|\d v \d).*(our|your)} $helptext]  {    set response "Please use #findscrim to find scrims"       }    if ![regexp -nocase {default} $response] {    putmsg $chan "\002\037$nick:\037\002 $response"    }utimer $notagain "set helpflock 0"} </code></pre></div>Untested <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=3849">Garp</a> — Thu Jun 22, 2006 7:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[aliby]]></name></author>
		<updated>2006-06-22T13:06:07-04:00</updated>

		<published>2006-06-22T13:06:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=64267#p64267</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=64267#p64267"/>
		<title type="html"><![CDATA[Send message to a channel with a delay (it's complex)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=64267#p64267"><![CDATA[
Hello,<br><br>I want to have my tcl script post a message to the channel if a user's text matches my regexp. <br><br>Here is the script i have so far:<br><div class="codebox"><p>Code: </p><pre><code>bind pubm - * helptext proc helptext {nick uhost hand chan text} {set response defaultset helptext [string tolower $text]   if [regexp {(admin|op|pm).*(admin|op|pm)} $helptext] {           set response "Please ask your question in the channel before asking an admin/op to PM you."        }   if [regexp {(\dv\d|\d v \d).*(our|your)} $helptext] {         set response "Please use #findscrim to find scrims"      }if ![regexp -nocase {default} $response] {putmsg $chan "\002\037$nick:\037\002 $response"}}</code></pre></div>How can I make it so that the second response, "Please use #findscrim to find scrims" is only displayed once every five seconds.<br><br>For example - Say a user posts this:<br> 5v5 | east | yours | cal o | dust 2<br><br>I want it to say "Please use #findscrim to find scrims"<br><br>But if they say this:<br>5v5 | east | yours | cal o | dust 2<br>5v5 | east | yours | cal o | dust 2<br>5v5 | east | yours | cal o | dust 2<br>5v5 | east | yours | cal o | dust 2<br>5v5 | east | yours | cal o | dust 2<br>5v5 | east | yours | cal o | dust 2<br><br>I want it to say "Please use #findscrim to find scrims" once then wait five seconds then if they repeat the line 5v5 | east | yours | cal o | dust 2 again (after 5 seconds), I want the eggdrop bot to say it again (and possibly kick them out of the channel giving them the reason again: "Didn't I tell you to use #findscrim?")<br><br>Sorry if this is confusing, I hope someone can give me a hand with this.<br><br>Thanks,<br><br>-Noah<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7903">aliby</a> — Thu Jun 22, 2006 1:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
