Why do some people still try to make their code unintelligible when with a few commands (actually is just one command with two different arguments) that anyone can easily find on a Google search (if uses the right *cough* info *cough*) can get the exact code with variables and all that?
Anyway... I looked at the code and I can confirm it has some sort of flood control mechanism inside:
Code: Select all
set flood_protect [blackmeteo:flood:prot $chan $host]
if {$flood_protect == "1"} {
set get_seconds [blackmeteo:get:flood_time $host $chan]
blackmeteo:say $nick $chan [list $get_seconds "6" $nick] 0
return
}
The
blackmeteo:flood:prot returns 1 if the user is listed, else the
blackmeteo:get:flood_time (another anti-flood mechanism) kicks in. This returns a number of seconds that are then used to say something into the channel via
blackmeteo:say function. It's too early morning for me to try to follow his logic.
PS: @BLaCkShaDoW
Code: Select all
set number [scan $meteo(flood_prot) %\[^:\]]
set timer [scan $meteo(flood_prot) %*\[^:\]:%s]
really?
Here's a cleaner version:
Code: Select all
scan $meteo(flood_prot) {%d:%d} number timer
and from here you can take things one step further like:
Code: Select all
if {[scan $meteo(flood_prot) {%d:%d} number timer] != 2} {
set number 4
set timer 10
}
to enforce two default values in case user input something wrong, like instead of a number put a letter or whatever.
Other two ways to get the two numbers out of meteo(flood_prot) variable:
Code: Select all
foreach {number timer} [split $meteo(flood_prot) :] { break }
lassign [split $meteo(flood_prot) :] number timer
Once the game is over, the king and the pawn go back in the same box.