mIRC Home    About    Download    Register    News    Help

Print Thread
#27987 03/06/03 09:29 PM
Joined: Mar 2003
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Mar 2003
Posts: 2
Hi I'm trying to set an ontext event from being flooded over and over. I want it to stop responding after a person uses it 4 times within 3 seconds and auto ignore them. And I'm trying to add a kick to it if opped. Thanks for all the help sorry this is so brief but I'm in a hurry.

#27988 03/06/03 10:06 PM
Joined: Feb 2003
Posts: 27
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Feb 2003
Posts: 27
A simple way would just to increment a variable everytime its triggered then say if (%somevar == 4) { do something } then you could also use a timer to unset the variable after 3 seconds
but that isn't a great way to do it because It'll ignore who ever says it the 3rd time even if they didn't do it the other 2 times what you want to look at is [Helpdesks Protection Tut]

#27989 03/06/03 10:14 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Instead of using a timer to unset it just use /set -u3 %varname and that will automatically unset it after 3 seconds.

#27990 03/06/03 11:41 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
if you want a really accurate method, I recommend the -z flag, because using -u3 will constantly reset the Unset-Timer each time its called... allowing the data to never expire. (eg, if someone uses your !trigger precisely once every 2 seconds, after 4 tries in 8 seconds, he would be ignored)

Using the -z flag method takes a bit of math. In your case, it's relatively easy, the user is allowed 1 line per 1 second.

/inc -z %TriggerFlood 1
if ( %TriggerFlood > 3 ) set -z %TriggerIgnore 60
If ( %TriggerIgnore ) return
(ending your script)

You can reference %TriggerIgnore to see how many seconds are left on the ignore. Alternately, you can set -u60 %TriggerIgnore $true


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard