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

	<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>2022-12-19T14:36:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-12-19T14:36:53-04:00</updated>

		<published>2022-12-19T14:36:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111568#p111568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111568#p111568"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111568#p111568"><![CDATA[
with the help of SpiKe^^ so far the fixed and working version incase anyone needs it to enable in channel<br><br>Syntax: !byte on/off<br><div class="codebox"><p>Code: </p><pre><code>bind PUB -|- !byte bytes:checker setudef flag bytescheckerproc bytes:checker {nick uhost hand chan arg} {   if {![isop $nick $chan] &amp;&amp; ![ishalfop $nick $chan] &amp;&amp; ![matchattr $hand n|n $chan]} {return}  switch -nocase -- [lindex [split $arg] 0] {    on {      if {[channel get $chan byteschecker]} {        putserv "NOTICE $nick :byteschecker is already enabled on $chan."      } else {         channel set $chan +byteschecker        putserv "NOTICE $nick :byteschecker is now enabled."}    }    off {      if {![channel get $chan byteschecker]} {        putserv "NOTICE $nick :byteschecker is already disabled on $chan."      } else {        channel set $chan -byteschecker        putserv "NOTICE $nick :byteschecker is now disabled."     }    }      }}set bflood(maxlength) 350set bflood(unsettime) 3bind pubm - * pubm:byteflood proc pubm:byteflood {nick host hand chan text} { if {![channel get $chan byteschecker]} { return } if {[validuser $hand] &amp;&amp; [matchattr $hand +bfmo|fmo $chan]} {  return 0  } if {(![botisop $chan]) || ([isop $nick $chan]) ||  ([ishalfop $nick $chan]) || ([validuser $hand] &amp;&amp; [matchattr $hand +bfmo|fmo $chan])} {return} global bflood set text [regsub -all -- {\s{2,}} [string trim [stripcodes * $text]] { }] set lengthXZ [regexp -all -- {[^\s]} $text ""] if {[info exists bflood($chan:$nick)]} {  incr lengthXZ $bflood($chan:$nick)  } if {($lengthXZ &gt; $bflood(maxlength))} {   if {[isvoice $nick $chan]} {  pushmode $chan -v $nick  }   if {[string match -nocase "*@*irccloud*" $host]} {                           regsub -all -- ~ $host "" host                                    set ident  [lindex [split $host @] 0]                                    set xbmaskx [string map {sid id uid id} $ident]                                    set bmask  *!*[string tolower $xbmaskx ]@*                                  if {![ischanban $bmask $chan]} {  pushmode $chan +b $bmask }    } else {                               set bmask "[maskhost $nick!$host 2]"                               if {![ischanban $bmask $chan]} { pushmode $chan +b $bmask }    }           if {[onchan $nick $chan]} { putkick $chan $nick "Excess Characters Flood" }   after [expr {30*1000*60}] [list Qtimed:banQ $chan $bmask]   if {[info exists bflood($chan:$nick)]} { unset bflood($chan:$nick) }   return 0 }  if {![info exists bflood($chan:$nick)]} { set bflood($chan:$nick) $lengthXZ ; utimer $bflood(unsettime) [list unset:byteflood $chan $nick]}    return 0}proc Qtimed:banQ {chan banmask} {  if {[ischanban $banmask $chan]} {    pushmode2 $chan -b  $banmask   } }proc unset:byteflood {chan nick} { global bfloodif {[info exists bflood($chan:$nick)]} { unset bflood($chan:$nick) }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Dec 19, 2022 2:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-12-17T14:09:30-04:00</updated>

		<published>2022-12-17T14:09:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111563#p111563</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111563#p111563"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111563#p111563"><![CDATA[
what i also discovered with nicknames like: <br><blockquote class="uncited"><div>[N]espresso<br></div></blockquote> <br><br>it doesnt seem to store  well as it doesnt seem to unset the var properly it only keeps increasing text length and doesnt unset it:<br><blockquote class="uncited"><div>if {[info exists bflood($chan:$nick)]} {  incr length $bflood($chan:$nick)  }<br><br>utimer $bflood(unsettime) [list array unset bflood $chan:$nick]<br><br>set bflood($chan:$nick) $length<br></div></blockquote>anyway to fix this ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Dec 17, 2022 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-12-16T13:03:37-04:00</updated>

		<published>2022-12-16T13:03:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=111562#p111562</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=111562#p111562"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=111562#p111562"><![CDATA[
im still having issues with this code it doesnt seem accurate as it triggers when user didnt exceed threshold i suspect it not unset with the added timer : bflood(unsettime)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Fri Dec 16, 2022 1:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-01-06T13:40:49-04:00</updated>

		<published>2022-01-06T13:40:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110750#p110750</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110750#p110750"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110750#p110750"><![CDATA[
i also tried using instead of <br><blockquote class="uncited"><div>  if {($length &gt; $bflood(maxlength))} { </div></blockquote> <br><br>this instead<br><blockquote class="uncited"><div>  if {($bflood($chan:$nick) &gt; $bflood(maxlength))} { </div></blockquote> <br><br><br>but it didnt seem to do either<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Jan 06, 2022 1:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2022-12-17T18:36:12-04:00</updated>

		<published>2022-01-06T13:32:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=110749#p110749</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=110749#p110749"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=110749#p110749"><![CDATA[
i used this code on dalnet for few days now and it doesnt seem to count all chars from multiple lines it seems to count 1 line only to match against the threshold of 250<br><br>this is what i work with at the moment<br><div class="codebox"><p>Code: </p><pre><code>set bflood(maxlength) 250set bflood(unsettime) 2bind pubm - * pubm:bytefloodproc pubm:byteflood {nick host hand chan text} { global bflood  if {(![botisop $chan]) || ([isop $nick $chan]) ||  ([ishalfop $nick $chan]) || ([validuser $hand] &amp;&amp; [matchattr $hand +bfmo|fmo $chan])} {return} set nick [string tolower $nick] set chan [string tolower $chan] set text [stripcodes * $text] set length [string length $text] set length [regexp -all -- {[^\s]} $text ""] if {[info exists bflood($chan:$nick)]} {  incr length $bflood($chan:$nick)  } if {($length &gt; $bflood(maxlength))} {   if {[isvoice $nick $chan]} {  pushmode $chan -v $nick  }if {[set chost [getchanhost $nick $chan]] ne ""} {switch -glob -- $chost {{*.irccloud.com} - {*.mibbit.com} - {*.kiwiirc.com} - {*2001*67c*2f08*} - {*192.184.8.*} - {*192.184.9.*} - {*192.184.9.*} - {*192.184.10.*} { }{default} {                                  set banmask [maskhost $nick!$chost 4]                 pushmode $chan +b $banmask}}   }   flushmode $chan   array unset bflood $chan:$nick   return 0 } if {![info exists bflood($chan:$nick)]} {   utimer $bflood(unsettime) [list array unset bflood $chan:$nick] } set bflood($chan:$nick) $length return 0}bind ctcp - action pubmaction:byteflood proc pubmaction:byteflood { nick uhost hand chan key arg } { if {[isbotnick $chan]} return  pubm:byteflood $nick $uhost $hand $chan $arg }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Jan 06, 2022 1:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-06-22T08:49:12-04:00</updated>

		<published>2020-06-22T08:49:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108624#p108624</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108624#p108624"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108624#p108624"><![CDATA[
Tnx caesar<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jun 22, 2020 8:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-06-22T06:49:50-04:00</updated>

		<published>2020-06-22T06:49:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108621#p108621</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108621#p108621"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108621#p108621"><![CDATA[
Yes, as I was testing stuff and kept editing the text i posted forgot to leave that as well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jun 22, 2020 6:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-06-22T04:25:40-04:00</updated>

		<published>2020-06-22T04:25:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108619#p108619</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108619#p108619"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108619#p108619"><![CDATA[
tnx ceasar<br><br>would that be like this? <div class="codebox"><p>Code: </p><pre><code>set length [regexp -all -- {[^\s]} $text ""]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Mon Jun 22, 2020 4:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-06-22T00:45:13-04:00</updated>

		<published>2020-06-22T00:45:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108614#p108614</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108614#p108614"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108614#p108614"><![CDATA[
Your <em class="text-italics">regsub</em> should be:<div class="codebox"><p>Code: </p><pre><code>regsub -all {[\s]} $text ""</code></pre></div>because that will substitute all white spaces not just space with nothing:<div class="codebox"><p>Code: </p><pre><code>% set text "some        tab space"some    tab space% regsub -all {\ } $text ""some    tabspace% regsub -all {[\s]} $text ""sometabspace% string lengt [regsub -all {[\s]} $text ""]12</code></pre></div>You could go with a <em class="text-italics">string map</em> instead:<div class="codebox"><p>Code: </p><pre><code>% set length [string length [string map {" " "" "     " ""} $text]]12</code></pre></div>or another cleaner approach with <em class="text-italics">regexp</em>:<div class="codebox"><p>Code: </p><pre><code>% regexp -all -- {[^\s]} $text ""12</code></pre></div>that returns the length without the white space characters.<br><br>Edit: Speaking of the topic CrazyCat mentioned, here's another regexp I didn't think of last time:<div class="codebox"><p>Code: </p><pre><code>% set text "fa24a22"fa24a22% regexp -all -- {[0-9]} $text4% time { regexp -all -- {[0-9]} $text } 1003.82 microseconds per iteration</code></pre></div>so that line turns from:<div class="codebox"><p>Code: </p><pre><code>if {[string length [regsub -all {[^0-9]} $nick ""]] &gt; 6} {   # do whatever}</code></pre></div>into:<div class="codebox"><p>Code: </p><pre><code>if {[regexp -all -- {[0-9]} $nick] &gt; 6} {   # do whatever}</code></pre></div>as you tried and for some reason i failed to see the proper results. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Mon Jun 22, 2020 12:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-06-21T09:58:11-04:00</updated>

		<published>2020-06-21T09:58:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108608#p108608</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108608#p108608"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108608#p108608"><![CDATA[
excellent thanks CrazyCat<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sun Jun 21, 2020 9:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-06-21T04:08:01-04:00</updated>

		<published>2020-06-21T04:08:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108605#p108605</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108605#p108605"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108605#p108605"><![CDATA[
caesar gives you the solution in another thread (<a href="http://forum.egghelp.org/viewtopic.php?t=20247" class="postlink">detect nicks with excessive digits in it</a>)<div class="codebox"><p>Code: </p><pre><code>set length [string length [regsub -all {\ } $text ""]]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Sun Jun 21, 2020 4:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-06-20T14:11:44-04:00</updated>

		<published>2020-06-20T14:11:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108602#p108602</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108602#p108602"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108602#p108602"><![CDATA[
does spaces get counted as well ? and if so could we take out all spaces  ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Jun 20, 2020 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-06-20T13:35:28-04:00</updated>

		<published>2020-06-20T13:35:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108601#p108601</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108601#p108601"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108601#p108601"><![CDATA[
excellent thanks again SpiKe^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Jun 20, 2020 1:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2020-06-20T13:26:57-04:00</updated>

		<published>2020-06-20T13:26:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108600#p108600</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108600#p108600"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108600#p108600"><![CDATA[
It does. Looks fine. But feel free to chop away at the code as you see fit:)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Sat Jun 20, 2020 1:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-06-20T13:22:58-04:00</updated>

		<published>2020-06-20T13:22:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=108599#p108599</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=108599#p108599"/>
		<title type="html"><![CDATA[multi lines max text length within time frame]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=108599#p108599"><![CDATA[
my idea would be to check if the one setting the length in<br><br>set length [string length $text]<br><br>to check if nick is the same nick as the one in $bflood($chan:$nick)  and only then to increase<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Jun 20, 2020 1:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
