mIRC Home    About    Download    Register    News    Help

Topic Options
#261429 - 01/10/17 08:14 PM Twitch - Multiple message for reply
Furiny Offline
Ameglian cow

Registered: 21/09/16
Posts: 34

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,

#261529 - 18/10/17 12:41 AM Re: Twitch - Multiple message for reply [Re: Furiny]
G16 Offline
Nutrimatic drinks dispenser

Registered: 17/10/17
Posts: 8
Yes there is, check this out:

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

#261532 - 18/10/17 02:59 AM Re: Twitch - Multiple message for reply [Re: G16]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1158
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.