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

	<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>2010-08-27T20:53:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demetrius_reis]]></name></author>
		<updated>2010-08-27T20:53:18-04:00</updated>

		<published>2010-08-27T20:53:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94151#p94151</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94151#p94151"/>
		<title type="html"><![CDATA[change time minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94151#p94151"><![CDATA[
Certain… I go to try… agradecio!<br><br>thanks !!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11312">demetrius_reis</a> — Fri Aug 27, 2010 8:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-08-27T12:50:53-04:00</updated>

		<published>2010-08-27T12:50:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94143#p94143</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94143#p94143"/>
		<title type="html"><![CDATA[Re: change time minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94143#p94143"><![CDATA[
<blockquote class="uncited"><div>The time of ban is in hours, would like to modify for minutes.<br>....<br>how I can modify the time of hours for minutes?<br>Thanks !!</div></blockquote>See this line:<div class="codebox"><p>Code: </p><pre><code>5 { set threshold [expr [clock seconds] - $banlist(hours) * 3600]</code></pre></div>specifically:<div class="codebox"><p>Code: </p><pre><code> $banlist(hours) * 3600</code></pre></div>That is taking whatever you have assigned earlier, in the config section:<div class="codebox"><p>Code: </p><pre><code>set banlist(hours) "2" </code></pre></div>and coverting that value to seconds.<br>In this case,   2 hours multiplied by 3600 would equal 7200 seconds.<br>It needs the value, in seconds.<br><br>If, in the config section, you wish to give it minutes intead of hours,<br>then change to:<div class="codebox"><p>Code: </p><pre><code>5 { set threshold [expr [clock seconds] - ($banlist(hours) * 60)]</code></pre></div>save and rehash.  Then test.<br><br>In this example,  it would then be working with   2 times 60 = 120 seconds.<br><br>Again...  do test it carefully.<br><br>I hope this helps.<br><br><br>      <br>Note:<br>I question this line:<div class="codebox"><p>Code: </p><pre><code>if {$threshold &gt; [lindex $ban 2]} { </code></pre></div>Maybe I'm just fuzzing out today, but to me it looks like that line will *always* evaluate to true.<br>If it does, then the script will not perform as you expect.<br><br>Perhaps someone else will come along and comment on this.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Fri Aug 27, 2010 12:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demetrius_reis]]></name></author>
		<updated>2010-08-25T10:46:28-04:00</updated>

		<published>2010-08-25T10:46:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94101#p94101</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94101#p94101"/>
		<title type="html"><![CDATA[change time minutes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94101#p94101"><![CDATA[
The time of ban is in hours, would like to modify for minutes.<blockquote class="uncited"><div><strong class="text-strong">5 { set threshold [expr [clock seconds] - $banlist(hours) * 3600]</strong><br>        set chanbanlist <ul>        <li>foreach ban [chanbans $chan] {<br>         if {$threshold &gt; [lindex $ban 2]} {<br>          lappend chanbanlist $ban<br>          }<br>        }<br>        if {[string is integer $banlist(remove)]} {<br>         set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]<br>        }<br>    }</li></ul></div></blockquote>Soon I modified the 3600 for - &gt; 60 - &gt; but he did not function<br><blockquote class="uncited"><div>#Set the type of channels you would like this script to work on.<br>#USAGE: [1/2] (1=USER DEFINED CHANNELS, 2=ALL CHANNELS)<br>#Setting '1' only checks banlists of channels which are defined for the script (in the next setting)<br>#Setting '2' checks banlists of all the channels the bot is on<br>set banlist(chantype) "1"<br><br>###SET THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '1'###<br>#Set the channels here on which the script would work. Each channel should be separated by a space.<br>#USAGE: set banlist(chanlist) "#channel1 #channel2 #channel3"<br>set banlist(chanlist) "#Age_of_Empires_2"<br><br>#Set this to the 'number' of bans you will allow in the channel banlist. If the number<br>#of bans exceeds this number then bans will be removed based on your settings below.<br>######################################################################################<br>#REMEMBER: This number should NOT be more than your IRC network's banlist capacity.<br>#To find this number, see 'MAXBANS' setting on connection to your irc server.<br>#(If you are not aware contact your local friendly irc operator and find out)<br>#Example: DALnet currently has 200.<br>set banlist(max) ""<br><br><br>#Set the METHOD in which you would like to remove the channel bans. The number<br>#of bans to be removed will be based on the value set above.<br>#USAGE: [1/2/3/4/5/6] (1=RANDOM, 2=RECENT, 3=LAST, 4=BY BOT, 5=OLDER THAN, 6=ALL)<br>#################################################################################<br>#Use '1' If you want to remove bans randomly.<br>#Use '2' If you want to remove recently placed bans.<br>#Use '3' If you want to remove last placed bans.<br>#Use '4' If you want to remove bans only placed by the bot.<br>#Use '5' If you want to remove bans older than a specific number of hour(s).<br>#Use '6' If you want to remove all bans from the channel.<br>set banlist(type) "5"<br><br><br>#Set the 'number' of bans to remove when the bans in the channel banlist reaches more<br>#than 'banlist(max)', which you set above in the first setting of the script.<br>#USAGE: 'Any number' ==&gt; removes a number of bans<br>#USAGE: 'all' ==&gt; removes all channel bans (only valid for banlist method 4 and 5)<br>#####################################################################################<br>###If this setting is set to 'ALL'###<br>#For banlist method 4: All bans placed by the bot will be removed<br>#For banlist method 5: All bans older than specific hour(s) defined will be removed<br>set banlist(remove) "all"<br><br><br>###SET THIS ONLY IF YOU HAVE SET THE PREVIOUS SETTING TO '5'###<br>#Set the time here in 'hour(s)' after which you would like to remove the bans.<br>#Bans placed before this specified number of hour(s) will be removed.<br>set banlist(hours) "2"<br><br><br>#----------------------------------------#<br>#    SET BANLIST NOTIFICATION OPTIONS    #<br>#----------------------------------------#<br><br>#Set this if you want to send an OPNOTICE to the channel ops when removing the bans.<br>#USAGE [0/1] (0=OFF, 1=ON)<br>set banlist(onotice) "0"<br><br><br>#---------------------------------#<br>#    SET BANLIST ON JOIN CHECK    #<br>#---------------------------------#<br><br>#Set the time here in 'minutes' to check the banlist for removing bans. This<br>#will be initiated after the bot joins a channel, typically after a restart.<br>set banlist(delay) "1"<br><br>##############################################################################<br>### Don't edit anything else from this point onwards even if you know tcl! ###<br>##############################################################################<br><br>bind join - "*" banlist<img alt=":on:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f51b.svg">join<br>bind mode - "*" banlist<img alt=":on:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f51b.svg">mode<br><br>set banlist(auth) "\x61\x77\x79\x65\x61\x68"<br>set banlist(ver) "v8.96.b"<br><br>proc banlist<img alt=":on:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f51b.svg">join {nick uhost hand chan} {<br> global banlist<br> if {![isbotnick $nick]} { return 0 }<br> if {($banlist(chantype) == "1") &amp;&amp; ([lsearch -exact [split [string tolower $banlist(chanlist)]] [string tolower $chan]] == -1)} { return 0 }<br>  timer $banlist(delay) [list banlist<img alt=":on:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f51b.svg">mode $nick $uhost $hand $chan +b join]<br>}<br><br>proc banlist<img alt=":on:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f51b.svg">mode {nick uhost hand chan mode target} {<br> global banlist<br> if {[string is integer $banlist(remove)] &amp;&amp; ($banlist(remove) &gt; $banlist(max))} { return 0 }<br> if {($banlist(chantype) == "1") &amp;&amp; ([lsearch -exact [split [string tolower $banlist(chanlist)]] [string tolower $chan]] == -1)} { return 0 }<br> if {[string equal "+b" $mode] &amp;&amp; [botisop $chan]} {<br>  if {[llength [chanbans $chan]] &gt;= $banlist(max)} {<br>  set banlist(notc1) "Channel banlist currently contains $banlist(max) entries"<br>   switch -exact $banlist(type) {<br>   1 { set chanbanlist [chanbans $chan] }<br>   2 { set chanbanlist [lsort -index 2 -integer -increasing [chanbans $chan]] }<br>   3 { set chanbanlist [lsort -index 2 -integer -decreasing [chanbans $chan]] }<br>   4 { set chanbanlist <ul>       <li>foreach ban [chanbans $chan] {<br>        if {[string equal -nocase [lindex [split [lindex $ban 1] !] 0] $botnick]} {<br>         lappend chanbanlist $ban<br>         }<br>       }<br>      if {[string is integer $banlist(remove)]} {<br>       set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]<br>       }<br>    }<br>    5 { set threshold [expr [clock seconds] - $banlist(hours) * 3600]<br>        set chanbanlist <ul>        <li>foreach ban [chanbans $chan] {<br>         if {$threshold &gt; [lindex $ban 2]} {<br>          lappend chanbanlist $ban<br>          }<br>        }<br>        if {[string is integer $banlist(remove)]} {<br>         set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]<br>        }<br>    }<br>    6 { if {$banlist(onotice) == "1"} {<br>         putserv "NOTICE @$chan :$banlist(notc1). Clearing the entire channel banlist."<br>        }<br>      resetbans $chan<br>      return 0<br>    }<br>    default { return 0 }<br>   }<br>   if {$banlist(type) == "5"} {<br>    if {[llength $chanbanlist] &gt; 0} {<br>     if {$banlist(onotice) == "1"} {<br>      if {[string is integer $banlist(remove)]} {<br>       putserv "NOTICE @$chan :$banlist(notc1). Removing $banlist(remove) bans older than $banlist(hours) hours."<br>      } elseif {[string equal -nocase "all" $banlist(remove)]} {<br>       putserv "NOTICE @$chan :$banlist(notc1). Removing all bans older than $banlist(hours) hours."<br>       }<br>     }<br>     if {[llength $chanbanlist] &gt; 0} {<br>      foreach ban $chanbanlist { pushmode $chan -b [lindex $ban 0] }<br>       flushmode $chan; return 0<br>       }<br>     }<br>   } elseif {[string is integer $banlist(remove)] &amp;&amp; [regexp {^[1-4]$} $banlist(type)]} {<br>      set chanbanlist [lrange $chanbanlist 0 [expr $banlist(remove) - 1]]<br>      if {$banlist(onotice) == "1"} {<br>      switch -exact $banlist(type) {<br>       1 { set banlist(notc2) "Removing $banlist(remove) bans randomly from the banlist." }<br>       2 { set banlist(notc2) "Removing the recent $banlist(remove) bans placed." }<br>       3 { set banlist(notc2) "Removing the last $banlist(remove) bans placed." }<br>       4 { set banlist(notc2) "Removing [string tolower $banlist(remove)] bans placed by the bot." }<br>       }<br>      putserv "NOTICE @$chan :$banlist(notc1). $banlist(notc2)"<br>      }<br>      if {[llength $chanbanlist] &gt; 0} {<br>       foreach ban $chanbanlist { pushmode $chan -b [lindex $ban 0] }<br>        flushmode $chan; return 0<br>        }<br>      }<br>    }<br>  }<br>}<br><br>if {![string equal "\x61\x77\x79\x65\x61\x68" $banlist(auth)]} { set banlist(auth) \x61\x77\x79\x65\x61\x68 }<br>putlog "Channel Banlist Cleaner $banlist(ver) by $banlist(auth) has been loaded successfully."</li></ul></li></ul></div></blockquote>how I can modify the time of hours for minutes?<br>Thanks !!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11312">demetrius_reis</a> — Wed Aug 25, 2010 10:46 am</p><hr />
]]></content>
	</entry>
	</feed>
