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

	<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>2021-03-13T01:43:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-13T01:43:25-04:00</updated>

		<published>2021-03-13T01:43:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109548#p109548</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109548#p109548"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109548#p109548"><![CDATA[
Just thought i'd make the script "fancier"<div class="codebox"><p>Code: </p><pre><code>############################################################################ xAction.tcl ################################################ Author    ComputerTech, caesar, Spike^^# Version   0.1 (BETA)# Released  12/03/2021# GitHub    https://github.com/computertech312################################################ Description:##               Action punishment script.##               Use .chanset #channel +xaction   to enable per channel## History:##               - 0.1: First release. ############################################################################# Start of configuration ############################################ Flags for usage and protection.####set warn(flag) "ofmn"################# Punishment's##### w  = warning# k  = kick# b  = ban# kb = kickban####set warn(max) "w:w:k:kb"################# X time before timer warning total is reduced by one (in seconds).####set warn(time) "120"################# Warning Message.####set warn(wreason) "Warning! Avoid using /me please"################# Kick Reason.####set warn(kreason) "Usage of /me"################# Ban Time.##### m  = minutes# h  = hours# d  = days####set warn(btime) "60m"################# Ban hostmask Type.##### 0 *!user@host# 1 *!*user@host# 2 *!*@host# 3 *!*user@*.host# 4 *!*@*.host# 5 nick!user@host# 6 nick!*user@host# 7 nick!*@host# 8 nick!*user@*.host# 9 nick!*@*.host####set warn(btype) "2"###########################  End of configuration  ############################################################################bind CTCP - ACTION action:avoidsetudef flag xactionproc action:avoid {nick host hand chan key text} {   global warnif {![channel get $chan xaction]} {return 0}  if {[isbotnick $nick] || ![botisop $chan]} {return 0}    if {[matchattr $hand $warn(flag) $chan]} {return 0}       if {[isop $nick $chan]} {return 0}     incr warn($host) +1     set warn(host) [maskhost $nick![getchanhost $nick $chan] $warn(btype)]            if {![info exists output1]} {        switch -- [string tolower $warn(btime)] {            d {set output1 [expr {$warn(btime) * 1440}]}            h {set output1 [expr {$warn(btime) * 60}]}            m {set output1 $warn(btime)}         }      }      if {![info exists end5]} {      set end5 [lindex [split $warn(max) :] end]      }   switch -- [lindex $warn(max) [incr warn($host) 1]] {    "w" {putkick $chan $nick $warn(wreason)             set blah($host) "w"}    "k" {putkick $chan $nick $warn(kreason)             set blah($host) "k"}    "b" {newchanban "$chan" "$warn(host)" "$::botnick" "$warn(kreason)" $output1              set blah($host) "b"}    "kb" {newchanban "$chan" "$warn(host)" "$::botnick" "$warn(kreason)" $output1           putkick $chan $nick $warn(kreason)              set blah($host) "kb"}   }    if {[string match $blah($host) $end5]} {    unset warn($host) ; unset blah($host)    }      utimer $warn(time) [list action:reset $host]}proc action:reset {host} {   global warn    if {[array names warn] != {}} {      if {[lsearch -nocase [array names warn] $host] &gt; -1} {         if {$warn($host) &gt; 1} {            incr warn($host) -1         } else {            unset warn($host)         }      }   }}###########################################################################</code></pre></div>As version suggests, its in (BETA) and i haven't had time yet to test it personally <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"> <br><br>Anyway, any tests is appreciated or even suggestions gor that matter, although my above post's code also works, but this will hopefully be more easier to set punishments  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Sat Mar 13, 2021 1:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrBeta]]></name></author>
		<updated>2021-03-12T16:04:47-04:00</updated>

		<published>2021-03-12T16:04:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109547#p109547</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109547#p109547"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109547#p109547"><![CDATA[
This works great on my eggdrop. <br><div class="codebox"><p>Code: </p><pre><code># Set max warnings before Punishmentset warn(max) "4"# Set X time before timer undo's warning amount (in seconds)set warn(time) "120"# Set Kick Reasonset warn(reason) "Hey No Action Please!"bind CTCP - ACTION action:avoidproc action:avoid {nick host hand chan key text} {   global warn  if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }  if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }  if {[isop $nick $chan]} { return 0 }   incr warn($host) +1   if {$warn($host) &gt; $warn(max)} {    putquick "MODE $chan +b *!$host"    putquick "KICK $chan $nick $warn(reason)"      unset warn($host)   } else {      putserv "PRIVMSG $chan :Warning $warn($host)"      utimer $warn(time) [list action:reset $host]   }}proc action:reset {host} {   global warn   if {[array names warn] != {}} {      if {[lsearch -nocase [array names warn] $host] &gt; -1} {         if {$warn($host) &gt; 1} {            incr warn($host) -1         } else {            unset warn($host)         }      }   }}</code></pre></div>I just made a change for the warning message, because it only reported Warning 1, 2, 3, etc<br><div class="codebox"><p>Code: </p><pre><code># Set max warnings before Punishmentset warn(max) "3"# Set X time before timer undo's warning amount (in seconds)set warn(time) "22"# Set Warn Messageset warn(reason2) "Please No Action "# Set Kick Reasonset warn(reason) "NO Action /me! Do you understand?"bind CTCP - ACTION action:avoidproc action:avoid {nick host hand chan key text} {   global warn  if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }  if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }  if {[isop $nick $chan]} { return 0 }   incr warn($host) +1   if {$warn($host) &gt; $warn(max)} {    putquick "MODE $chan +b *!$host"    putquick "KICK $chan $nick $warn(reason)"      unset warn($host)   } else {      putserv "PRIVMSG $chan :$warn(reason2) $warn($host)  Warning"      utimer $warn(time) [list action:reset $host]   }}proc action:reset {host} {   global warn   if {[array names warn] != {}} {      if {[lsearch -nocase [array names warn] $host] &gt; -1} {         if {$warn($host) &gt; 1} {            incr warn($host) -1         } else {            unset warn($host)         }      }   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12321">MrBeta</a> — Fri Mar 12, 2021 4:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-03-12T10:29:23-04:00</updated>

		<published>2021-03-12T10:29:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109543#p109543</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109543#p109543"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109543#p109543"><![CDATA[
MrBeta,<br><br>Which version of the script have you tested to be working please?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Mar 12, 2021 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-03-12T10:22:52-04:00</updated>

		<published>2021-03-12T10:22:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109542#p109542</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109542#p109542"/>
		<title type="html"><![CDATA[pros and cons of many utimers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109542#p109542"><![CDATA[
The biggest difference between the 2 scan methods is that the one I prefer sets a single utimer for each host, and the other method sets a utimer for each action, could be 3 or 4 running utimers per host.<br><br>I call the single timer method fuzzy scanning, and the many timer method explicit scanning. In actual usage on actual abusers few will notice any differences ever, with far fewer running timers.<br><br>Every coding method has pros and cons, tradeoffs that can be weighed and decided on. For this warning script, scanning for things that do not threaten the channel in any way, I chose the low resource fuzzy method. I stand by my decision there. Users should make their own choices between the two methods...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Fri Mar 12, 2021 10:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-03-12T05:18:49-04:00</updated>

		<published>2021-03-12T05:18:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109541#p109541</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109541#p109541"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109541#p109541"><![CDATA[
With this code in mind<div class="codebox"><p>Code: </p><pre><code>if {[info exists warn($host)]} {  unset warn($host)  } </code></pre></div>consider the following scenario:<br><br>user dose a /me and triggers the <em class="text-italics">action:avoid</em> function. user is given 1 warning and has his <em class="text-italics">warn(host)</em> set to 1.<br><br>in a short time frame, before the <em class="text-italics">utimer</em> (with whatever value you got set at <em class="text-italics">warn(time)</em>) kicks in, the same user dose a second /me and triggers the <em class="text-italics">action:avoid</em> function gets his warning, his <em class="text-italics">warn(host)</em> goes to 2 and a second delayed <em class="text-italics">utimer</em> will reset his points.<br><br>the first <em class="text-italics">utimer</em> kicks in and instead of lowering the warning from 2 to 1 will remove the host completely, thus making the "warn before ban" not work as intended, meaning will only issue an initial "warning" without the punishment IF the user doesn't do 3x (or whatever you set at <em class="text-italics">warn(max)</em>) /me in a short time frame.<br><br><strong class="text-strong">tldr</strong>: stick with the version ComputerTech posted.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Fri Mar 12, 2021 5:18 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrBeta]]></name></author>
		<updated>2021-03-12T04:52:42-04:00</updated>

		<published>2021-03-12T04:52:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109540#p109540</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109540#p109540"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109540#p109540"><![CDATA[
Thanks guys, you are the top everything works perfectly.  <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=12321">MrBeta</a> — Fri Mar 12, 2021 4:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-11T20:32:58-04:00</updated>

		<published>2021-03-11T20:32:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109535#p109535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109535#p109535"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109535#p109535"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Set max warnings before Punishmentset warn(max) "4"# Set X time before timer undo's warning amount (in seconds)set warn(time) "120"# Set Kick Reasonset warn(reason) "Hey No Action Please!"bind CTCP - ACTION action:avoidproc action:avoid {nick host hand chan key text} {global warn  if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }  if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }  if {[isop $nick $chan]} { return 0 }incr warn($host) +1if {$warn($host) &gt; $warn(max)} {    putquick "MODE $chan +b *!$host"    putquick "KICK $chan $nick $warn(reason)"unset warn($host)} else {putserv "PRIVMSG $chan :Warning $warn($host)"utimer $warn(time) [list action:reset $host]}}proc action:reset {host} {   global warn   if {[array names warn] != {}} {      if {[lsearch -nocase [array names warn] $host] &gt; -1} {         if {$warn($host) &gt; 1} {            incr warn($host) -1         } else {            unset warn($host)         }      }   }}</code></pre></div>Tested and working <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>(Not sure if it's the "best" way to do so, but it works perfectly here)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12849">ComputerTech</a> — Thu Mar 11, 2021 8:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-03-11T18:49:57-04:00</updated>

		<published>2021-03-11T18:49:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109534#p109534</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109534#p109534"/>
		<title type="html"><![CDATA[No Action Dude]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109534#p109534"><![CDATA[
Try this MrBeta<br><div class="codebox"><p>Code: </p><pre><code># Set max warnings before Punishmentset warn(max) "3"# Set X time before timer undo's warning amount (in seconds)set warn(reset) "120"# Set Kick Reasonset warn(reason) "Hey No Action Please!"######################bind CTCP - ACTION action:avoidproc action:avoid {nick host hand chan key text} {  global warn  if {[isbotnick $nick] || [isbotnick $chan]} { return 0 }  if {[matchattr $hand "ofmn|ofmm" $chan]} { return 0 }  if {[isop $nick $chan]} { return 0 }  if {![info exists warn($host)]} {    set warn($host) 1    utimer $warn(reset) [list action:reset $host]  } else {  incr warn($host)  }  if {$warn($host) &gt; $warn(max)} {    putquick "MODE $chan +b *!$host"    putquick "KICK $chan $nick $warn(reason)"  } else {    putserv "PRIVMSG $chan :Warning $warn($host): No Action Please"  }  return 0}proc action:reset {host} {  global warn  if {[info exists warn($host)]} {  unset warn($host)  }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Thu Mar 11, 2021 6:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrBeta]]></name></author>
		<updated>2021-03-11T10:36:43-04:00</updated>

		<published>2021-03-11T10:36:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109530#p109530</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109530#p109530"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109530#p109530"><![CDATA[
The error message was my fault for importing the unmodified tcl.<br>However, the continuous Warning 1 message remains for each action sent in the channel, but no ban after 3/4/5 and more repetitions<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12321">MrBeta</a> — Thu Mar 11, 2021 10:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-03-11T10:21:38-04:00</updated>

		<published>2021-03-11T10:21:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109529#p109529</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109529#p109529"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109529#p109529"><![CDATA[
"doesn't work for me, it still gives me an error" is no help at all.<br><br>Post the new error here...<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Thu Mar 11, 2021 10:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrBeta]]></name></author>
		<updated>2021-03-11T09:52:58-04:00</updated>

		<published>2021-03-11T09:52:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109528#p109528</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109528#p109528"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109528#p109528"><![CDATA[
I removed the extra code but it doesn't work for me, it still gives me an error. I await the code cleaned by you to test again, surely I am doing something wrong  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><br>The bot give only Warning1 messagge, but don't ban and no give another warn message, only "Warning1"<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12321">MrBeta</a> — Thu Mar 11, 2021 9:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ComputerTech]]></name></author>
		<updated>2021-03-10T14:14:56-04:00</updated>

		<published>2021-03-10T14:14:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109523#p109523</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109523#p109523"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109523#p109523"><![CDATA[
Haven't tested it myself yet though, but will after work <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=12849">ComputerTech</a> — Wed Mar 10, 2021 2:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SpiKe^^]]></name></author>
		<updated>2021-03-10T11:58:15-04:00</updated>

		<published>2021-03-10T11:58:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109519#p109519</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109519#p109519"/>
		<title type="html"><![CDATA[Remove the extra }]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109519#p109519"><![CDATA[
Remove the extra }<div class="codebox"><p>Code: </p><pre><code>if {[isop $nick $chan]} return} </code></pre></div>making it look more like this<div class="codebox"><p>Code: </p><pre><code>if {[isop $nick $chan]} return </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7749">SpiKe^^</a> — Wed Mar 10, 2021 11:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MrBeta]]></name></author>
		<updated>2021-03-10T09:47:45-04:00</updated>

		<published>2021-03-10T09:47:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109518#p109518</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109518#p109518"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109518#p109518"><![CDATA[
It gives me this error, I use egg 1.8.4<br><br>can't read "host": no such variable<br>    while executing<br>"set warn($host) 1"<br>    (file "scripts/noaction.tcl" line 23)<br><br><div class="codebox"><p>Code: </p><pre><code># Set max warnings before Punishmentset warn(max) "3"# Set X time before timer undo's warning amount (in seconds)set warn(reset) "60"# Set Kick Reasonset warn(reason) "Hey No Action Please!"######################bind CTCP - ACTION action:avoidproc action:avoid {nick host hand chan key text} {global warnif {[isbotnick $nick]} returnif {[matchattr $hand "ofmn|ofmm"]} returnif {[isop $nick $chan]} return}if {[info exists warn]} {   set warn($host) 1} else {if {[info exists warn]} {   set warn($host) 1} else {   incr warn($host) 1}}if {$warn($host) &gt; $warn(max)} {putquick "MODE $chan +b $host"putquick "KICK $chan $nick $warn(reason)"unset warn($host)} else {putserv "PRIVMSG $chan :Warning $warn($host)"utimer $warn(reset) [list action:reset $host]  }}proc action:reset {host} {   global warn   if {[array names warn] != {}} {      if {[lsearch -nocase [array names warn] $host] &gt; -1} {         if {$warn($host) &gt; 1} {            incr warn($host) -1         } else {            unset warn($host)         }      }   }}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12321">MrBeta</a> — Wed Mar 10, 2021 9:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2021-03-10T08:00:56-04:00</updated>

		<published>2021-03-10T08:00:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=109517#p109517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=109517#p109517"/>
		<title type="html"><![CDATA[Warn Action]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=109517#p109517"><![CDATA[
What TCL version do you have?<br><br>Anyway, replacing:<div class="codebox"><p>Code: </p><pre><code>incr warn($host) 1</code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>if {[info exists warn]} {set warn($host) 1} else {incr warn($host) 1}</code></pre></div>should take care of the issue.<br><br>Next I would also replace this:<div class="codebox"><p>Code: </p><pre><code>utimer $warn(reset) {incr warn($host) -1 }</code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>utimer $warn(reset) [list action:reset $host]</code></pre></div>and add this nice helper function at the end of the initial code:<div class="codebox"><p>Code: </p><pre><code>proc action:reset {host} {global warnif {[array names warn] != {}} {if {[lsearch -nocase [array names warn] $host] &gt; -1} {if {$warn($host) &gt; 1} {incr warn($host) -1} else {unset warn($host)}}}}</code></pre></div>Oh, and another thing, should consider <em class="text-italics">unset</em> the warn(host) when said host is banned to save on memory. I mean replace:<div class="codebox"><p>Code: </p><pre><code>set warn($host) "0" </code></pre></div>with:<div class="codebox"><p>Code: </p><pre><code>unset warn($host)</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Mar 10, 2021 8:00 am</p><hr />
]]></content>
	</entry>
	</feed>
