mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2016
Posts: 34
F
Furiny Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Sep 2016
Posts: 34
Hey,

I haven't got here for a while but here is new idea where I need help and if it's possible.

So, I wonder if I could compare messages from multiple users and then trigger a warning in chat.

For example, if multiple users (more than X) come in and they all say "bitch" in chat, then let script say "Calm down boys!".

Thanks & kindly,
Furiny

Joined: Oct 2017
Posts: 8
G16 Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
Joined: Oct 2017
Posts: 8
Yes there is, check this out:
Quote:

var %i = 0
on *:text:*word*:#:{
inc %i
If (%i > 3) {
/msg $chan Calm down lads!
set %i 0
}
}

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Furiny, can you clarify whether you have a specific word in mind, or just that several people say the same thing in close proximity, whatever that is.

G16's code works for a specific word being used within someone's sentence, but it works on the 4th occurrence, but it also keeps a permanent count for all time, using the very common %i variable that most scripts feel free to use. Better to use something like %scriptname.i instead. Also, if you want to count people doing it only within a few seconds of each other instead of counting someone doing it across several days, change

inc %i
to instead be:
inc -u5 %i

The -u switch unsets the variable after 5 seconds delay, so as soon as someone does not use the word for 5 seconds the variable vanishes regardless of the value, but each time someone uses the magic word the countdown resets to 5.


Link Copied to Clipboard