mIRC Home    About    Download    Register    News    Help

Print Thread
#126826 05/08/05 04:19 PM
Joined: Jul 2005
Posts: 13
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jul 2005
Posts: 13
[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)

#126827 05/08/05 05:23 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

#126828 05/08/05 07:19 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
#126829 05/08/05 08:27 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Why not simply use

Code:
 inc -u4 %jflood 


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#126830 05/08/05 09:41 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
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

#126831 06/08/05 12:16 PM
Joined: Jul 2005
Posts: 13
C
Pikka bird
OP Offline
Pikka bird
C
Joined: Jul 2005
Posts: 13
the code is not working frown
it's supposed to lock to chennel with those modes
when there is 4 joins in 4 secs

#126832 06/08/05 01:21 PM
Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
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

#126833 06/08/05 05:21 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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)


New username: hixxy
#126834 08/08/05 08:28 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
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.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!

Link Copied to Clipboard