[code]
[on !*:join:#:{
inc $iif(!%jflood,-u4) %jflood
if (%jflood > 4) {
mode # +MRiN
msg # Possible clones attack
.timer 1 300 //mode # -MRiN
}
}
/code]
Error is: * /inc: invalid parameters (line 2, script23.ini)
Your syntax for the $iif() function is invalid.
$iif(!%jflood,do something,otherwise do somethingelse)
You'd be better off doing:
if (!%jflood) inc -u4 %jflood
-Andy
His usage of $iif is perfectly fine, check the help file for $iif.
The problem lies in an oddity when setting vars, which is a known bug, though I can't seem to find it in the bug reports.
If that $iif returns $null the var %jflood is evaluated. To fix that:
inc $iif(!%jflood,-u4) % $+ jflood
Although xDaeMoN's suggestion makes more sense
the code is not working
it's supposed to lock to chennel with those modes
when there is 4 joins in 4 secs
This is for 4 joins in 4 seconds:
on @*:join:#:{
inc -z %joins. $+ # 4
if (%joins. [ $+ [ # ] ] > 12) {
msg # Possible clone attack
mode # +MRiN
.timer 1 300 mode # -MRiN
unset %joins. $+ #
}
}
With /inc -u4 checking the var is > 4 it would trigger for 4 joins in up to 16 seconds
When one person joins the variable will be unset in 4 seconds, when the second person joins the variable will again be unset in 4 seconds, as you can most likely see this means the script no longer kicks on 4 joins in 4 seconds, but on 4 joins in 16 or less (depending on the time between each join)
Hmm I thought that once the unset timer was set, it will keep decreasing the time & will not add more time even if the /inc or /set -uN has been used again. Thanks for the clarifying it.