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

	<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>2005-12-26T19:31:01-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-12-26T19:31:01-04:00</updated>

		<published>2005-12-26T19:31:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58690#p58690</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58690#p58690"/>
		<title type="html"><![CDATA[Flood proc, Consecutive trigger]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58690#p58690"><![CDATA[
Alchera might beat me up for this, but nevertheless:<br><br>the best example I know of for proc re-use and generally clean, elegant, simple yet functional script design is <a href="http://demond.net/xchannel.tcl" class="postlink">xchannel</a><br><br>it does <strong class="text-strong">exactly</strong> what you need: handles more different flood types with less procs<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Dec 26, 2005 7:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nANDu]]></name></author>
		<updated>2005-12-26T16:33:48-04:00</updated>

		<published>2005-12-26T16:33:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=58686#p58686</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=58686#p58686"/>
		<title type="html"><![CDATA[Flood proc, Consecutive trigger]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=58686#p58686"><![CDATA[
hi demond, u asked me to post it here.<br><br>Here is a sample flood proc which triggers for only consecutive joins of unresolved idents. I'm interested to make this an universal consecutive detection type proc. So that the same proc is used for different types of consecutive join patterns. Guide me to make it more advanced, faster,  dynamic and also with out using timers.<br><div class="codebox"><p>Code: </p><pre><code># Consecutive Unresolved Host Flood x(joins):y(secs) # ~blah@example.net, ~swooozy@ex.net.com , ~whoreee@me.tk.inset uh 2:2proc unresolved:flood {n u h c} {  global fldmr uh urhf curhf  # uh = x:y ; urhf = unresolved host flood ; curh = consecutive urhf  if {(![botisop $c]) || ([matchattr $h of|of])} {return}  if {![info exists fldmr($c)]} {set fldmr($c) 0}  # This is to check if the channel is already locked (+MR)  scan $u %\[^@\]@%s ident host  set urh [string match "~*" "$ident"]  if {($urh == 0)||([string match "Guest?????" "$n"])} {  # if the idents are resolved or if the nick is guest, set curhf var to 0  # curhf is used to incr the main flood join times, if {curfh &gt;= y(secs)}     set curhf($c) 0    } else {    if {![info exists urhf($c)]} {set urhf($c) ""}    if {$urh == $urhf($c)} {    # if urh == temp urhf, this the actual consecutive check procedure    # if urh != temp urhf, then it will "set urhf($c) $urh"      incr curhf($c)      utimer [lindex [split $uh :] 1] [list curhf:dec $c]      if {$curhf($c) &gt;= [lindex [split $uh :] 0]} {        if {$fldmr($c) == "0"} {          putquick "MODE $c +MR-k unresolved.host.flood" -next          utimer 60 [list flood:unlock $c]          set fldmr($c) 1          return 0        }      }      } else {      set urhf($c) $urh      set curhf($c) 1      utimer [lindex [split $uh :] 1] [list curhf:dec $c]    }  }}proc curhf:dec {c} {  global curhf  incr curhf($c) -1  if {$curhf($c) &lt; 0} {set curhf($c) 0}  return 0}proc flood:unlock {chan} {  global fldmr  set cmode [getchanmode $chan]  set fldmr($chan) 0  if {[string match "*R*M*" "$cmode"]} {putserv "MODE $chan -MR" ; return 0}  if {[string match "*M*" "$cmode"]} {putserv "MODE $chan -M" ; return 0}  if {[string match "*R*" "$cmode"]} {putserv "MODE $chan -R" ; return 0}  return 0}foreach t [utimers] {  if {[lindex $t 1] == "flood:unlock"} {killutimer [lindex $t end]}  if {[lindex $t 1] == "curhf:dec"} {killutimer [lindex $t end]}}set chans [channels]set chans [split [string tolower $chans]]foreach c $chans {  set fldmr($c) 0  set urhf($c) ""  set curhf($c) 0} </code></pre></div><blockquote class="uncited"><div>Wanna make it universal proc (consecutive match pattern) (i.e)<br>proc flood:proc {<em class="text-italics">description</em> $chan <em class="text-italics">x_times in_y_secs</em>} {...}</div></blockquote><br>These are some sample logs: <em class="text-italics">(description)</em><br>   % alphanumeric host flood<br>   % unresolved ident/host flood<br>   % alphanumeric nick flood<br><br>[25/12 02:53:58] • (JOINS) Nova29 (~<a href="mailto:pHRDhIBn@36.Red-80-39-227.dynamicIP.rima-tde.net">pHRDhIBn@36.Red-80-39-227.dynamicIP.rima-tde.net</a>)<br>[25/12 02:53:59] • (JOINS) Nora29 ( ~<a href="mailto:XqUIhtgs@tvn95-1-82-229-101-13.fbx.proxad.net">XqUIhtgs@tvn95-1-82-229-101-13.fbx.proxad.net</a>)<br>[25/12 02:53:59] • Skipper sets mode: +MR-k alphanumeric.host.flood<br>---<br>[25/12 03:27:31] • (JOINS) tary921 (~j4n867074@12.144.115.136)<br>[25/12 03:27:31] • (JOINS) fjil0r (~r62s6332@209.161.218.85 )<br>[25/12 03:27:31] • (JOINS) uuvn378- (~h23c04614@208.164.114.85)<br>[25/12 03:27:31] • Skipper sets mode: +MR-k unresolved.host.flood<br>[25/12 03:27:31] • (JOINS) eoys318 ( ~c1u88uu1n@12.144.115.136)<br>[25/12 03:27:32] • (JOINS) mmoj505 (~m4186388p@61.244.116.229)<br>[25/12 03:27:31] • (JOINS) xdanyie ( ~eg7988gt4@12.144.115.136)<br>---<br>[25/12 03:35:21] • (JOINS) Pa|nT (~<a href="mailto:Nazim@as13-143.qualitynet.net">Nazim@as13-143.qualitynet.net</a>)<br>[25/12 03:35:22] • (JOINS) pinky4 (<a href="mailto:pinky4@ip70-190-9-16.ph.ph.cox.net">pinky4@ip70-190-9-16.ph.ph.cox.net</a> )<br>[25/12 03:35:23] • Skipper sets mode: +MR-k alphanumeric.host.flood<br>---<br>[25/12 07:15:19] • (JOINS) Pando-987 (~<a href="mailto:xgron-@af14-173.qualitynet.net">xgron-@af14-173.qualitynet.net</a>)<br>[25/12 07:15:19] • (JOINS) pi-nky42 (pinky4@12.144.116.200 )<br>[25/12 07:15:20] • Skipper sets mode: +MR-k alphanumeric.nick.flood<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6257">nANDu</a> — Mon Dec 26, 2005 4:33 pm</p><hr />
]]></content>
	</entry>
	</feed>
