mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2014
Posts: 4
A
Aroulhs Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Sep 2014
Posts: 4
Hey. I wrote this code the other day:

Code:
on *:text:*Hello*:#: { msg $chan $read(Greetings.txt) $nick }


Which has been really working out for my mIRC bot so far.

The thing is, people tend to abuse it (duh) typing the word hello like 25 times in a minute, thus forcing my bot to flood and my computer to lag.

What I need is some sort of $if parameter or something, which would halt this code for like 5 minutes, when somebody repeats himself 3 times in a row.

Like if somebody types 4 times in a row the word "hello", I would like my bot to respond to just the first three, and then setting off the script or just stop responding for 5 minutes or so.

It's got to be simple, but I'm really amateur in mIRC scripting.

Thanks in advance!

Joined: Jan 2004
Posts: 1,361
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,361
Putting this at the top of your event will allow it to be run 3 times per minute:

Code:
if (%hello > 60) return
inc -z %hello 20

Joined: Sep 2014
Posts: 4
A
Aroulhs Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Sep 2014
Posts: 4
Thanks for the answer, but I don't get it. As I said I'm kind of an amateur in mIRC scripting.
Where exactly do I have to write the code you gave me?

Could you please give me the full code with your adjustment cause I'm a real noob :P

Joined: Jan 2004
Posts: 1,361
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,361
Code:
on *:text:*Hello*:#:{
  if (%hello > 60) return
  inc -z %hello 20

  msg $chan $read(Greetings.txt,n) $nick
}

Joined: Sep 2014
Posts: 4
A
Aroulhs Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Sep 2014
Posts: 4
It totally worked! You're a genius thanks laugh


Link Copied to Clipboard