mIRC Home    About    Download    Register    News    Help

Print Thread
#206227 09/11/08 07:56 PM
Joined: Nov 2008
Posts: 22
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Nov 2008
Posts: 22
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?

Firstmate #206228 09/11/08 08:11 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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

Firstmate #206233 09/11/08 09:06 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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



Link Copied to Clipboard