mIRC Home    About    Download    Register    News    Help

Print Thread
#243593 01/12/13 03:25 PM
Joined: Nov 2013
Posts: 49
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Nov 2013
Posts: 49
I'm not a huge fan, but I've not been able to think of another way to do it. Feel free to suggest alternate ways of doing it.

Code:
on *:TEXT:!test*:#: {
  var %var1 = oneobject twoobject threeobject
  var %var2 = carobject sumobject whyobject
  if ($regex(%var1,/^[ $2 ]/i)) {
    $msgbot($chan,Number objects)
  } 
  if ($regex(%var2,/^[ $2 ]/i)) {
    $msgbot($chan,Weird objects)
  }
}


How do I make it so that it identifies each word (oneobject, twoobject etc) and matches if the word is in the variable list correctly?

Thanks!

Last edited by lindenkron; 01/12/13 03:25 PM.
Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Don't use regex, use tokens.

if ($istok(%var1,$2,32)) { ...

Loki12583 #243597 02/12/13 03:59 AM
Joined: Nov 2013
Posts: 49
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Nov 2013
Posts: 49
Originally Posted By: Loki12583
Don't use regex, use tokens.

if ($istok(%var1,$2,32)) { ...


Exactly, beautiful.


Link Copied to Clipboard