mIRC Homepage
Posted By: Clyde_The_Glide Prob with on join - 05/08/05 04:19 PM
[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)
Posted By: SladeKraven Re: Prob with on join - 05/08/05 05:23 PM
Your syntax for the $iif() function is invalid.

Code:
$iif(!%jflood,do something,otherwise do somethingelse)


You'd be better off doing:

Code:
if (!%jflood) inc -u4 %jflood


-Andy
Posted By: FiberOPtics Re: Prob with on join - 05/08/05 07:19 PM
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.
Posted By: xDaeMoN Re: Prob with on join - 05/08/05 08:27 PM
Why not simply use

Code:
 inc -u4 %jflood 
Posted By: Sigh Re: Prob with on join - 05/08/05 09:41 PM
If that $iif returns $null the var %jflood is evaluated. To fix that:

Code:
inc $iif(!%jflood,-u4) % $+ jflood


Although xDaeMoN's suggestion makes more sense
Posted By: Clyde_The_Glide Re: Prob with on join - 06/08/05 12:16 PM
the code is not working frown
it's supposed to lock to chennel with those modes
when there is 4 joins in 4 secs
Posted By: Sigh Re: Prob with on join - 06/08/05 01:21 PM
This is for 4 joins in 4 seconds:

Code:
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
Posted By: tidy_trax Re: Prob with on join - 06/08/05 05:21 PM
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)
Posted By: xDaeMoN Re: Prob with on join - 08/08/05 08:28 PM
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.
© mIRC Discussion Forums