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

	<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>2020-09-27T16:31:35-04:00</updated>

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

		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-26T15:29:30-04:00</updated>

		<published>2020-09-26T15:29:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109045#p109045</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109045#p109045"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109045#p109045"><![CDATA[
could this be modified to have it check for host instead of nick so we dont have to worry about changed nicks or adding another proc for nick ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 26, 2020 3:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-27T16:31:35-04:00</updated>

		<published>2020-09-26T12:04:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109044#p109044</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109044#p109044"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109044#p109044"><![CDATA[
We allow 1 nick per IP on this network caesar<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 26, 2020 12:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-09-26T05:46:50-04:00</updated>

		<published>2020-09-26T05:46:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109043#p109043</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109043#p109043"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109043#p109043"><![CDATA[
What if there are two distinct people with same host? <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=187">caesar</a> — Sat Sep 26, 2020 5:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-26T03:53:58-04:00</updated>

		<published>2020-09-26T03:53:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109042#p109042</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109042#p109042"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109042#p109042"><![CDATA[
I think having to avoiding checking wether nick has changed perhaps its better to use *! *@host:channel to store and use that way it wont matter if they change nick<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Sat Sep 26, 2020 3:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-09-25T02:58:22-04:00</updated>

		<published>2020-09-25T02:58:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109039#p109039</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109039#p109039"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109039#p109039"><![CDATA[
@CrazyCat Ah, I see, in that case just replace it instead of removing and adding it again:<div class="codebox"><p>Code: </p><pre><code>proc add:spam {nick chan} {global spamlistset match 0set now [clock seconds]if {[info exists spamlist($chan)]} {putserv "PRIVMSG $chan :spamlist exists for $chan"set pos [lsearch -nocase [dict keys [join $spamlist($chan)]] $nick]if {$pos &gt; -1} {scan [lindex $spamlist($chan) $pos] {%s%s} user timeputserv "PRIVMSG $chan :$nick was found in the list, updating the seconds from $time to $now .."set spamlist($chan) [lreplace $spamlist($chan) $pos $pos [list $user $now]]incr match}}if {!$match} {putserv "PRIVMSG $chan :$nick wasn't in, adding.."lappend spamlist($chan) [list $nick $now]}}</code></pre></div>You can use the same <em class="text-italics">lreplace</em> line on the nick change function where you will have <em class="text-italics">$newnick</em> (or what variable you want to use) instead of <em class="text-italics">$user</em> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Sep 25, 2020 2:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-24T14:23:39-04:00</updated>

		<published>2020-09-24T14:23:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109033#p109033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109033#p109033"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109033#p109033"><![CDATA[
seems to work proper now thanx CrazyCat and caesar much apreciated<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Sep 24, 2020 2:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-09-24T13:44:58-04:00</updated>

		<published>2020-09-24T13:44:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109032#p109032</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109032#p109032"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109032#p109032"><![CDATA[
looks like add:spam is never called.<br><br>Modify the two first proc:<div class="codebox"><p>Code: </p><pre><code>proc pub:spam {nick uhost hand chan txt} {   putserv "PRIVMSG $chan :get pub from $nick"   add:spam $nick [string tolower $chan]   putserv "PRIVMSG $chan :stored pub from $nick"}proc ctcp:spam {nick uhost hand chan key txt} {   putserv "PRIVMSG $chan :get act from $nick"   add:spam $nick [string tolower $chan]   putserv "PRIVMSG $chan :stored act from $nick"}</code></pre></div>I think you have now enough debug examples to make yours own tests &amp; debug.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Sep 24, 2020 1:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-24T11:27:51-04:00</updated>

		<published>2020-09-24T11:27:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109031#p109031</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109031#p109031"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109031#p109031"><![CDATA[
thank you tried your last post got the same result:<br><blockquote class="uncited"><div>17:29:54 (Greene)  : testing one two three<br>17:29:54    Quits :    Greene    <a href="mailto:uid45646@uid-45646.highgate.irccloud.com">uid45646@uid-45646.highgate.irccloud.com</a>   (Quits: Left IRC) <br>17:29:54 (@TCL-Tester)  : Can't find spamlist for #opers<br><br>17:30:27 (Burk)  : testing one two three<br>17:30:27    Parts :    Burk    <a href="mailto:Jordon@BHYX1EUA.WGERDG6U.HVE14TFS.IP">Jordon@BHYX1EUA.WGERDG6U.HVE14TFS.IP</a>  (Parts:)<br>17:30:27 (@TCL-Tester)  : Can't find spamlist for #opers</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Sep 24, 2020 11:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-09-24T10:16:29-04:00</updated>

		<published>2020-09-24T10:16:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109030#p109030</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109030#p109030"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109030#p109030"><![CDATA[
I complicated the procedure to force the update of the last speaking action time for $nick on $chan and not skipping it.<br><br>Little example :<div class="codebox"><p>Code: </p><pre><code>[16:00:00] --&gt; spammer as joined #test[16:00:01] * spammer says hello to all[16:00:05] &lt;spammer&gt; go on http://omg.spamming.net[16:00:07] &lt;-- spammer has quit (http://omg.spamming.net)</code></pre></div>If you skip already existing user in spamlist, you'll have the 16:00:01 record, it won't ban when spammer quits at 16:00:07.<br><br>Your simplified version works only for spammers which don't speak until they "speak &amp; quit". Mine will ban anyone which exit less than 6 seconds after he had spoke (this is how I understand the mirc script).<br><br>BTW, I think this script is a bad idea, polite pple as me will be banned:<div class="codebox"><p>Code: </p><pre><code>[16:59:57] &lt;CrazyCat&gt; Time to go, cya pple ![16:59:59] &lt;-- CrazyCat has quit (Cya)</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Sep 24, 2020 10:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2020-09-24T09:55:36-04:00</updated>

		<published>2020-09-24T09:55:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109029#p109029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109029#p109029"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109029#p109029"><![CDATA[
Good catch on that <em class="text-italics">string tolower $chan</em> as this could have caused some issues.<br><br>Like I previously mentioned, should consider adding a nick change function and something for a bit of house keeping just in case something doesn't work as should and you end up with a big array stored in memory with a bunch of gunk.<br><br>One thing I don't understand why did you complicated the <em class="text-italics">add:spam</em>, meaning if the pos is above -1 (meaning it exists in the list) then unless you need to update the data there's no need to remove and then add it at the end. Here's something simplified:<div class="codebox"><p>Code: </p><pre><code>proc add:spam {nick chan} {set match 0if {[info exists ::spamlist($chan)]} {putserv "PRIVMSG $chan :spamlist exists for $chan"set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]if {$pos &gt; -1} {putserv "PRIVMSG $chan :$nick was found in the list, skipping.."incr match}}if {!$match} {putserv "PRIVMSG $chan :$nick wasn't in, adding.."lappend ::spamlist($chan) [list $nick [clock seconds]]}}</code></pre></div>So, swe first check if the <em class="text-italics">spamlist</em> array has records for #channel, then check if nick is found in them. If found we increment <em class="text-italics">match</em>, else will remain at default 0 value. At the end if <em class="text-italics">match</em> is 0 (meaning we don't have any records for nick) we add him in the list.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Thu Sep 24, 2020 9:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-09-24T05:27:12-04:00</updated>

		<published>2020-09-24T05:27:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109028#p109028</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109028#p109028"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109028#p109028"><![CDATA[
You can try with the following code:<div class="codebox"><p>Code: </p><pre><code>bind PUB - * pub:spambind CTCP - ACTION ctcp:spambind PART - * part:spambind SIGN - * sign:spamarray set spamlist {}proc pub:spam {nick uhost hand chan txt} {   add:spam $nick [string tolower $chan]}proc ctcp:spam {nick uhost hand chan key txt} {   add:spam $nick [string tolower $chan]}proc add:spam {nick chan} {if {[info exists ::spamlist($chan)]} {putserv "PRIVMSG $chan :spamlist exists for $chan"set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]if {$pos &gt;= 0} {putserv "PRIVMSG $chan :$nick was in, removing"set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]}}lappend ::spamlist($chan) [list $nick [clock seconds]]putserv "PRIVMSG $chan :adding/updating $nick in $chan"}proc part:spam {nick uhost hand chan {txt ""}} {   ban:spam $nick $uhost [string tolower $chan]}proc sign:spam {nick uhost hand chan txt} {   ban:spam $nick $uhost [string tolower $chan]}proc ban:spam {nick uhost chan} {   if {![info exists ::spamlist($chan)]} {      putserv "PRIVMSG $chan :Can't find spamlist for $chan"      return   }   set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]   if {$pos &gt; -1} {      scan [lindex $::spamlist($chan) $pos] {%s%s} user time      set now [clock seconds]      if {[expr $now - $time] &lt; 6} {         set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]         set mask [maskhost "$nick!$uhost" 3]         pushmode $chan +b $mask      } else {         putserv "PRIVMSG $chan :More than 5s, doing nothing"     }   } else {      putserv "PRIVMSG $chan :Can't find $nick in spamlist of $chan"   }}</code></pre></div>I added a add:spam proc which is used to avoid multiple entries for a same nick in the spamlist<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Sep 24, 2020 5:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-24T01:06:52-04:00</updated>

		<published>2020-09-24T01:06:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109027#p109027</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109027#p109027"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109027#p109027"><![CDATA[
tnx crazycat gettin this output:<br><blockquote class="uncited"><div>(@TCL-Tester)  : Can't find spamlist for #opers</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Thu Sep 24, 2020 1:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2020-09-23T17:55:05-04:00</updated>

		<published>2020-09-23T17:55:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109026#p109026</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109026#p109026"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109026#p109026"><![CDATA[
No, you don't see any reaction because you didn't output any debug information.<div class="codebox"><p>Code: </p><pre><code>proc ban:spam {nick uhost chan} {   if {![info exists ::spamlist($chan)]} {      putserv "PRIVMSG $chan :Can't find spamlist for $chan"      return   }   set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]   if {$pos &gt; -1} {      scan [lindex $::spamlist($chan) $pos] {%s%s} user time      set now [clock seconds]      if {[expr $now - $time] &lt; 6} {         set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]         set mask [maskhost "$nick!$uhost" 3]         pushmode $chan +b $mask      } else {         putserv "PRIVMSG $chan :More than 5s, doing nothing"     }   } else {      putserv "PRIVMSG $chan :Can't find $nick in spamlist of $chan"   }}</code></pre></div>All the putserv I added are just for debug, they didn't change the way the proc is working.<br>You can now make tests and copy us the results you get in your chan.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Sep 23, 2020 5:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-23T14:32:18-04:00</updated>

		<published>2020-09-23T14:32:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109025#p109025</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109025#p109025"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109025#p109025"><![CDATA[
this is what i have so far tested it but it doesnt react:<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - * pub:spambind CTCP - ACTION ctcp:spambind PART - * part:spambind SIGN - * sign:spamarray set spamlist {} proc pub:spam {nick uhost hand chan txt} {   global spamlist   lappend spamlist($chan) [list $nick [clock seconds]]}proc ctcp:spam {nick uhost hand chan key txt} {   global spamlist   lappend spamlist($chan) [list $nick [clock seconds]]}proc part:spam {nick uhost hand chan {txt ""}} {   ban:spam $nick $uhost $chan}proc sign:spam {nick uhost hand chan txt} {   ban:spam $nick $uhost $chan}proc ban:spam {nick uhost chan} {   if {![info exists ::spamlist($chan)]} return   set pos [lsearch -nocase [dict keys [join $::spamlist($chan)]] $nick]   if {$pos &gt; -1} {      scan [lindex $::spamlist($chan) $pos] {%s%s} user time      set now [clock seconds]      if {[expr $now - $time] &lt; 6} {         set ::spamlist($chan) [lreplace $::spamlist($chan) $pos $pos]         set mask [maskhost "$nick!$uhost" 3]            pushmode $chan +b $mask      }   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Sep 23, 2020 2:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simo]]></name></author>
		<updated>2020-09-23T12:23:43-04:00</updated>

		<published>2020-09-23T12:23:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109024#p109024</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109024#p109024"/>
		<title type="html"><![CDATA[setting ban on msg followed by quit]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109024#p109024"><![CDATA[
what binds do i need to use with that crazycat im a bit confused<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12505">simo</a> — Wed Sep 23, 2020 12:23 pm</p><hr />
]]></content>
	</entry>
	</feed>
