mIRC Homepage
Posted By: Firstmate Inc -uN - 09/11/08 07:56 PM
Lets say you had a script similar to:
Code:
on *:TEXT:!test:#: {
 inc -u5 $+(%,spam.,$nick)
 if (%spam. [ $+ [ $Nick ] ] > 3) { }
 else { msg $chan test! }
}


Now take this chat for example

<nick>: !test ;inc %spam.nick | value=1
<Bot>: Test!
<nick>: !test ;inc %spam.nick | value=2
<Bot>: Test!
<nick>: !test ;inc %spam.nick | value=3
<Bot>: Test!
<nick>: !test ;inc %spam.nick | value=4

My question is, since the script incs a variable each time they talk, would the script wait another 3 seconds after the second time nick talked.

I'm not quite sure how to phrase this, but more or less, the script waits 3 seconds before unsetting it, but if they talk again, would it make it wait ANOTHER 3 seconds?
Posted By: RusselB Re: Inc -uN - 09/11/08 08:11 PM
The variable will unset 5 seconds after the last set/increase

So if it was increased at 10:00:00, it would unset at 10:00:05, unless it was increased again between 10:00:00 and 10:00:05
Posted By: Horstl Re: Inc -uN - 09/11/08 09:06 PM
yepp, but you could bypass this effct by e.g.:
set -u5 $+(%,spam.,$nick,.,$ctime) x
if ($var($+(spam.,$nick,.*),0) > 3) { stuff }

You thereby don't have one var for nick with value "N", but N vars, each with their own "time to expire"

instead of $ctime you could use $ticks or a random number to make it more "accurate", e.g.:
set -u5 $+(%,spam.,$nick,.,$rand(1,9999)) X

© mIRC Discussion Forums