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

	<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>2013-01-12T15:13:52-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Diamond85]]></name></author>
		<updated>2013-01-12T15:13:52-04:00</updated>

		<published>2013-01-12T15:13:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=100578#p100578</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=100578#p100578"/>
		<title type="html"><![CDATA[need help - flood code - random wait time]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=100578#p100578"><![CDATA[
Hello EggHelp user! I need help again ...<br>I want a flood code.<br>three times that a user can use the command.<br>then he must wait one random time of under 30 seconds minimum and maximum 3Minutes..<br>Important: (the person should not be ignored but the command can not use).<br>it should be a variable available for the command, for example:<br><br># How often can use<br>varaible maxuse "3"<br><br><br>is that possible?<br><br><br>with my code that I have, I will not work: (<br><div class="codebox"><p>Code: </p><pre><code>  variable command_char "!"  # set these to your preferred binds  variable command_bind "Join_Counter"  # how many requests in how many seconds is considered flooding? # by default, this allows 2 queries in 60 seconds, the 3th being wait  variable flood_limit "2:60"  # number of wait seconds for the flooder # "0" - disable wait, "60" - the flooder must wait 60 seconds  variable wait_time "60"  # set here the admin flags (m=Master / n=Owner / o=OP ...) # to enable or disable this script on channel commands  variable user_flags "+mno|+mno"  # set here the default language # "en" - english, "de" - german  variable text_lang "de"  # set here the nicks are not to be added to database  variable no_nicks "*guest*"   # set here to channel record default on / off  variable chan_record "on"</code></pre></div><div class="codebox"><p>Code: </p><pre><code> ############################################################################# #                                Flood Check                                # #############################################################################  proc fc_check {nick host hand chan arg} {   if {[channel get $chan Join_Counter]} {    if {[Join_Counter::fa_flood $nick $host $hand $chan $arg]} {     return    }    Join_Counter::sa_action2 $nick $host $hand $chan $arg   }  } ############################################################################# #                               Flood Action                                # #############################################################################  variable fa_data  variable fa_array  proc fa(init) {} {   foreach chan [channels] {    if {![string match *:* [channel get $chan Join_Counter-Flood]]} {     if {[channel get $chan Join_Counter-Lang] == "en"} {      putlog "\[14Join_Counter 04Error\] 14variable \(09flood_limit: 09[channel get $chan Join_Counter-Flood]) 14is not set correctly."      return 1     }         if {[channel get $chan Join_Counter-Lang] == "de"} {      putlog "\[14Join_Counter 04Error\] 14variable \(09flood_limit: 09[channel get $chan Join_Counter-Flood]) 14wurde nicht richtig Eingestellt."      return 1     }    }    set Join_Counter::fa_data(flood_num) [lindex [split [channel get $chan Join_Counter-Flood] :] 0]    set Join_Counter::fa_data(flood_time) [lindex [split [channel get $chan Join_Counter-Flood] :] 1]    set i [expr $Join_Counter::fa_data(flood_num) - 1]    while {$i &gt;= 0} {     set Join_Counter::fa_array($i) 0     incr i -1    }   }  }  ; fa(init)  proc fa_flood {nick host hand chan arg} {   if {$Join_Counter::fa_data(flood_num) == 0} {    return 0   }   set i [expr ${Join_Counter::fa_data(flood_num)} - 1]   while {$i &gt;= 1} {    set Join_Counter::fa_array($i) $Join_Counter::fa_array([expr $i - 1])    incr i -1   }   set Join_Counter::fa_array(0) [unixtime]   if {[expr [unixtime] - $Join_Counter::fa_array([expr ${Join_Counter::fa_data(flood_num)} - 1])] &lt;= ${Join_Counter::fa_data(flood_time)}} {    Join_Counter::wa_action $nick $host $hand $chan $arg    return 1   } else {    return 0   }  } ############################################################################# #                               Wait Action                                 # #############################################################################  proc wa_action {nick host hand chan arg} {   if {[set timeleft [Join_Counter::wa_throttled $host,$chan [channel get $chan Join_Counter-Wait]]]} {    if {[channel get $chan Join_Counter-Lang] == "en"} {     putnow "PRIVMSG $chan :\[14Join_Counter 04Flood Protection\] 09You 14can only again in 04$timeleft 14seconds!"    }    if {[channel get $chan Join_Counter-Lang] == "de"} {     putnow "PRIVMSG $chan :\[14Join_Counter 04Flood Protection\] 09Du 14darfst erst wieder in 04$timeleft 14Sekunden!"    }   } else {    Join_Counter::sa_action2 $nick $host $hand $chan $arg   }  }  proc wa_throttled {id time} {   global wa_throttled   if {[info exists wa_throttled($id)]} {    return [expr {($wa_throttled($id)+$time)-[clock sec]}]     } {    set wa_throttled($id) [clock sec]    utimer $time [list unset wa_throttled($id)]    return 0   }  }</code></pre></div><br>the whole script I have here has 1069 lines so I'd rather not post this <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><a href="http://pastebin.com/dgbeQ7MG" class="postlink">Link to TCL on Pastebin</a><br><br>sorry for my bad english<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10289">Diamond85</a> — Sat Jan 12, 2013 3:13 pm</p><hr />
]]></content>
	</entry>
	</feed>
