mIRC Home    About    Download    Register    News    Help

Print Thread
Prob with on join #126826 05/08/05 04:19 PM
Joined: Jul 2005
Posts: 13
C
Clyde_The_Glide Offline OP
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)

Re: Prob with on join #126827 05/08/05 05:23 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
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

Re: Prob with on join #126828 05/08/05 07:19 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
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.
Re: Prob with on join #126829 05/08/05 08:27 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
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!
Re: Prob with on join #126830 05/08/05 09:41 PM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
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

Re: Prob with on join #126831 06/08/05 12:16 PM
Joined: Jul 2005
Posts: 13
C
Clyde_The_Glide Offline OP
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

Re: Prob with on join #126832 06/08/05 01:21 PM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
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

Re: Prob with on join #126833 06/08/05 05:21 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
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
Re: Prob with on join #126834 08/08/05 08:28 PM
Joined: Mar 2005
Posts: 420
X
xDaeMoN Offline
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!