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

	<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>2007-05-29T09:53:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-29T09:53:28-04:00</updated>

		<published>2007-05-29T09:53:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73133#p73133</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73133#p73133"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73133#p73133"><![CDATA[
Also worth noting, is that bloating a script with all kind of control-characters, ascii-graphics, extensive "cool texts", and so forth, only takes the focus away from the actual code constructs, and really makes poor learning-examples..<br><br>When a single line of code wraps around three lines, it gets really hard to read that code, and makes me wonder if all that really is needed to illustrate the concept.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Tue May 29, 2007 9:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-05-29T09:10:13-04:00</updated>

		<published>2007-05-29T09:10:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73131#p73131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73131#p73131"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73131#p73131"><![CDATA[
<blockquote class="uncited"><div>Am I missing something, or doesn't all these functions already exist in sentinel.tcl?</div></blockquote>Indeed they exist in sentinel.tcl, but I have some other scripts that handle the banning of excessive CTCP actions, or notices or other types ....and I wanted to add a help-script to help the other script handle the bans without having floods on channel <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_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> <br><br>so, I`ll take some advice from <strong class="text-strong">iamdeath</strong>, <strong class="text-strong">nml375</strong> and <strong class="text-strong">awyeah</strong> and see if I can make the script to work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><br><br>Thanks for the suggestion guys, I`ll place a later post with the result.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Tue May 29, 2007 9:10 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2007-05-27T22:37:40-04:00</updated>

		<published>2007-05-27T22:37:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73089#p73089</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73089#p73089"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73089#p73089"><![CDATA[
<blockquote class="uncited"><div>Well yeah, the normal mirc color formating codes work exactly the same with TCL, hence I don't bother using \002 for bold, when I can use a smaller character .  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"></div></blockquote>The point is cross platform compatibility and conforming to the pre-existing set standards.<br><br>Proper coding doesn't include anything like (non-standard) mIRC inclusions. These forums also exist to teach users the correct method(s) of Tcl scripting which, to my mind, the aforementioned code does not.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Sun May 27, 2007 10:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-05-27T21:49:05-04:00</updated>

		<published>2007-05-27T21:49:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73086#p73086</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73086#p73086"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73086#p73086"><![CDATA[
Well yeah, the normal mirc color formating codes work exactly the same with TCL, hence I don't bother using \002 for bold, when I can use a smaller character .  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun May 27, 2007 9:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2007-05-27T21:39:10-04:00</updated>

		<published>2007-05-27T21:39:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73085#p73085</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73085#p73085"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73085#p73085"><![CDATA[
<blockquote class="uncited"><div>Am I missing something, or doesn't all these functions already exist in sentinel.tcl?</div></blockquote>They do indeed and all minus the ridiculous mIRC colours (by the looks of that post).<br><br>It appears people still do not know how to write code correctly.<br><br><a href="http://forum.egghelp.org/viewtopic.php?t=3867" class="postlink">Colour and formatting codes</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Sun May 27, 2007 9:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[YooHoo]]></name></author>
		<updated>2007-05-27T21:14:12-04:00</updated>

		<published>2007-05-27T21:14:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73083#p73083</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73083#p73083"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73083#p73083"><![CDATA[
Am I missing something, or doesn't all these functions already exist in sentinel.tcl?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2706">YooHoo</a> — Sun May 27, 2007 9:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-05-27T20:36:47-04:00</updated>

		<published>2007-05-27T20:36:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73074#p73074</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73074#p73074"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73074#p73074"><![CDATA[
Heres something you can do off with. It bans for flood messages:<br>Channel text/actions/notices<br><div class="codebox"><p>Code: </p><pre><code>set chantexttrigger "5:3"bind pubm - "*" text:floodbind ctcp - ACTION action:floodbind notc - "*" notice:floodproc text:flood {nick uhost hand chan text} { text:flood:delay $nick $uhost $hand $chan $text "Text"}proc action:flood {nick uhost hand dest keyword text} { if {[isbotnick $dest]} { return 0 } if {[string equal "#" [string index $dest 0]] &amp;&amp; [string match "#*" $dest]} {  text:flood:delay $nick $uhost $hand $dest $text "Action"  }}proc notice:flood {nick uhost hand text {dest ""}} { if {[isbotnick $dest] || [string equal "ChanServ" $nick] || [string equal "NickServ" $nick] || [string equal "MemoServ" $nick] || ($nick == "")} { return 0 } if {[string equal "@" [string index $dest 0]] &amp;&amp; [string equal "#" [string index $dest 1]]} { return 0 } if {[string equal "#" [string index $dest 0]] &amp;&amp; [string match "#*" $dest]} {  text:flood:delay $nick $uhost $hand $dest $text "Notice"  }}proc text:flood:delay {nick uhost hand chan text type} { global chantexttrigger chantextflood if {[isbotnick $nick] || ![botisop $chan] || [isop $nick $chan] || [isvoice $nick $chan] || [string equal "awyeah" $nick]} { return 0 } if {[string match -nocase "#*" $chan]} { set user [string tolower $nick:$chan] if {![info exists chantextflood($user)]} {  set chantextflood($user) 0 } utimer [lindex [split $chantexttrigger :] 1] [list text:flood:list $user] if {[incr chantextflood($user)] &gt;= [lindex [split $chantexttrigger :] 0]} {   putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]"   putquick "KICK $chan $nick :0,1 Channel $type Flood 12,0 - You 2typed6 [lindex [split $chantexttrigger :] 0] lines 2or more 12within6 [lindex [split $chantexttrigger :] 1] secs. 12Please 2slow down 12your 2typing speed, 12this isn't a 2typing contest."   timer 60 [list putquick "MODE $chan -b *!*@[lindex [split $uhost @] 1]"]    if {[info exists chantextflood($user)]} { unset chantextflood($user) }    }  }}proc text:flood:list u { global chantextflood if {[info exists chantextflood($u)]} { incr chantextflood($u) -1 }}</code></pre></div>You can add the lock by placing a putserv or putquick mode followed by the lockmode in the channel which you desire. And the unlock can be also placed by using a utimer or timer along with a putserv or putquick command embedded within a list argument, as in your script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun May 27, 2007 8:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-05-27T11:35:38-04:00</updated>

		<published>2007-05-27T11:35:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73057#p73057</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73057#p73057"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73057#p73057"><![CDATA[
Worth noting is that your argument-list is not coherent with either binding (althugh the choice of names is pretty much up to the author, it might be a good idea to use names that are not misleading). Also, as has already been pointed out, the different bindings provide different number of arguments (and some of them different contents), which is why you get the error of wrong number of arguments.<br><br>You've got two options to fix this:<br>1. Use two different procs, one for each binding.<br>2. Modify the script to allow it to take multiple number of arguments (could be messy if you're not familiar with the actual script).<br><br>For option two, the first step would be to change the argument-list of s:flood, giving "key" a default value if the parameter is not used. This is done by changing the item with a list containing the variable name and the default value. (something like below:)<div class="codebox"><p>Code: </p><pre><code>proc s:flood {nick host hand text chan {key ""}} {</code></pre></div>You probably then have to modify other parts of the script to handle the cases where key was not present, which will require some understanding of the mechanics of the actual script...<br><br>There is a second version of option two, wich would make use of the special variable-name "args", which will allow your proc to handle an arbitrary number of arguments. In this case, each argument provided to the proc will be added to args as a list-item.<br>Ex:<div class="codebox"><p>Code: </p><pre><code>proc s:flood {nick host hand args} { switch [llength $args] {  2 {   set text [lindex $args 0]   set dest [lindex $args 1]   set type "notc"  }  3 {   set text [lindex $args 2]   set dest [lindex $args 0]   set keyword [lindex $args 1]   set type "ctcp"  } } default {error "Wrong number of arguments!"} ...}</code></pre></div>In this case, dest would either be the channel the event took place, or your bot's own nickname (would require some test using isbotnick). text and key would be text written, and if available, the ctcp keyword. Be aware that in the case of a notice, key will not be set and any attempts to read it will cause an error.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun May 27, 2007 11:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[iamdeath]]></name></author>
		<updated>2007-05-26T22:30:18-04:00</updated>

		<published>2007-05-26T22:30:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73045#p73045</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73045#p73045"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73045#p73045"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>NOTC (stackable)bind notc &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;procname &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;text&gt; &lt;dest&gt;CTCP (stackable)bind ctcp &lt;flags&gt; &lt;keyword&gt; &lt;proc&gt;proc-name &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;dest&gt; &lt;keyword&gt; &lt;text&gt;</code></pre></div>What I think is, notc and ctcp can't be in 1 proc like you used in <strong class="text-strong">s:flood</strong>. I might be wrong, I will research on it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5982">iamdeath</a> — Sat May 26, 2007 10:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Riddler]]></name></author>
		<updated>2007-05-26T23:21:25-04:00</updated>

		<published>2007-05-26T22:23:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=73043#p73043</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=73043#p73043"/>
		<title type="html"><![CDATA[a anti-flood script !]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=73043#p73043"><![CDATA[
Hello all, I need some help with a little script, that puts a chan mode, like +m wen there is a mass use of ctcp and notices.<br><br>Here is the code:<div class="codebox"><p>Code: </p><pre><code># flood.tcl# Channelset flood(chan) "#Finlanda"# Numbers of flood's in X second's set flood(nr) 5:2# Channel Lock Modesset flood(clm) "m"# Channel Lock Timeset flood(clt) 30### END CFG ###bind ctcp - * s:floodbind NOTC - * s:floodproc s:flood {nick host hand text chan key} { global botnick flood flood_host_count   if {![validchan $chan] || [matchattr $hand of|of $chan] || [isop $nick $chan] || [isvoice $nick $chan]}  { return 0 }   if {(([lsearch -exact [string tolower $flood(chan)] [string tolower $chan]] != -1) || ($flood(chan) == "*")) &amp;&amp; (![matchat$     if {[lsearch -exact $flood(chan) $chan] == -1} {        return 0     }     if {![info exists flood_host_count($host:$chan)]} {       set flood_host_count($host:$chan) 1     } else {       incr flood_host_count($host:$chan)     }     utimer [lindex $flood(nr) 1] "s:expire flood_host_count($host:$chan)"     if {$flood_host_count($host:$chan) &gt; [lindex $flood(nr) 0]} {       putquick "MODE $chan +$flood(clm)"       utimer $flood(clt) [list putquick "MODE $chan -$flood(clm)"]     return 0    }  }}proc s:expire var_exp {  upvar $var_exp var_pointer  if {$var_pointer &gt; 1} {    incr var_pointer -1  } else {    unset var_pointer  }}set flood(chan) [string tolower $flood(chan)]set flood(nr) [split $flood(nr) :]# clear variables and timers on rehashif {[array exists flood_host_count]} {unset flood_host_count}  foreach check_utimer [utimers] {  if {[string match flood_host_count [lindex $check_utimer 1]]} {    killutimer [lindex $check_utimer 2]   }}putlog "TCL Loaded: flood.tcl"</code></pre></div>and I get this error: <br><div class="codebox"><p>Code: </p><pre><code> &lt;|R0B0T&gt; [04:15] Tcl error [s:flood]: wrong # args: should be "s:flood nick host hand text chan key"</code></pre></div>And the channel dosen`t get "locked"<br><br>Any suggestion ?!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9010">Riddler</a> — Sat May 26, 2007 10:23 pm</p><hr />
]]></content>
	</entry>
	</feed>
