mIRC Homepage
Posted By: MsDiz Twitch bot response to multiple words - 05/10/14 06:55 AM
I'm trying to figure out how to make my bot respond to multiple words like "hey, hello, hi ect." with a simple msg like "hey thanks for coming" without having separate lines of code for each variation like:

on *:text:*hello*:#: { msg $chan Sup, $nick !Thanks for coming }

on *:text:*hi *:#: { msg $chan Sup, $nick ! Thanks for coming }

on *:text:hi:#: { msg $chan Sup, $nick ! Thanks for coming }

on *:text:hey*:#: { msg $chan Sup, $nick ! Thanks for coming }

on *:text:sup *:#: { msg $chan Sup, $nick ! Thanks for coming }

I don't want to have the bot just greet everyone who comes into the channel but those who just say hi. I have spent the last like 3 days trying to find/figure this out please give me a hand smile
Posted By: hixxy Re: Twitch bot response to multiple words - 05/10/14 10:18 AM
Code:
on *:text:*:#:{ 
  var %i = 1
  while ($gettok(%matches,%i,44) != $null) {
    if ($v1 iswm $1-) { 
      msg $chan Sup, $nick ! Thanks for coming
      break
    }
    inc %i
  }
}


Now all you need to do is set what you want your matches to be, by typing:

/set %matches <matches> (separated by commas)

So for your current list you would do:

/set %matches *hello*,*hi *,hi,hey*,sup *
Posted By: MsDiz Re: Twitch bot response to multiple words - 05/10/14 05:36 PM
ahh THANK YOU <3
© mIRC Discussion Forums