Overview
$Fld can be used in a script to tell if $1, a nickname, is flooding you. Whenever you use $fld, it increases a hash-value that increases everytime you use $fld, until it reaches a max line limit in a specified number of seconds. Say, you had a snippet like this:
on *:TEXT:*:?: {
If ($fld($nick) = $true) {
.msg $nick Ignored.
window -c $nick
ignore $nick
}
}
Let's say the max Time Limit, the time in which they flood you, is 3 seconds. Let's also say the max line limit, the number of times they flood you, is 5. That means the limit is 5 lines in 3 seconds. Everytime you use $fld, it increases a hash-value for flooding that nick, which is unset after the max Time Limit.
So in that script there, taking in that the Time Limit is 3secs, and that the Line Limit is 5 lines, if $nick has flooded you with 5 lines in 3 secs, it $fld($nick) will return $true. And then, as a result, it will carry out the commands inside the If statement
This snippet can be used in any script that has to respond to text, to prevent you from being disconnected from a server for "Excess Flood".
One of the other main points of this snippet, is to save someone the line-space to have to MAKE flood protection for a script. So that makes mode flooding Mode Thankers a lot harder to do with $Fld.
You can change the Time Limit and Line Limit in your Channel Popups. Right-click in any channel, go down to ' "$fld settings" Change Line Limit/Time Limit ' and click. The first question is the max number of lines, and the second question his in how many seconds. So, Question1 lines in Question2 seconds, will be the Line Limit/Time Limit.
** Notes:
Update v1.1:
All of the above is still true, but now if you specify a $2 value, you can work on an exclusive table. The point of this is, say, if someone is flooding your away system, and you want the limit for that to be 5 lines 3 secs, and someone's flooding your query blocker, and you want the limit for THAT to be something like 7 lines 5 secs, then you won't have to use just $fld($nick) to do so. You could use $fld($nick,tablename) for a private flood protection.
This is quite MORE efficient than my v1.0.
So now you can do something like, saying that the Time Limit is 3 secs, and the Line Limit is 5 lines...
on *:TEXT:*:?: {
If ($fld($nick,query) = $true) {
.msg $nick Ignored.
window -c $nick
ignore $nick
}
}
While at the same time having
on *:TEXT:*:?: {
If (%PM.Blocker = on) {
If ($fld($nick,PMBLOCKER) = $true) {
.msg $nick Ignored.
window -c $nick
ignore $nick
}
}
So that way, $fld can use $nick for two completely opposite things, since the value $nick holds changes depending on the table.
** Notes:
Update v1.1.1
Took out all /halt's in the script, using /goto end instead.
Not bad. As a scripter, I prefer to see proper usage of the if/elseif/else statements, as well as $iif where appropriate.
Additionally the halt statement should be used as little as possible, and with a re-write using the statements mentioned earlier, this code could be used with no halt statements at all.