mIRC Homepage

Twitch - Multiple message for reply

Posted By: Furiny

Twitch - Multiple message for reply - 01/10/17 07:14 PM


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,
Posted By: G16

Re: Twitch - Multiple message for reply - 17/10/17 11:41 PM

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
Posted By: maroon

Re: Twitch - Multiple message for reply - 18/10/17 01:59 AM

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.
© 2020 mIRC Discussion Forums