mIRC Homepage
Posted By: ricktee76 correct use of pipes in query - 08/10/13 01:27 PM
the script is basically like this right now
Code:
ON *:TEXT:*throw*:#:{

  if ($2 == elephant ) { msg $chan thats impossible !!! | halt }
  if ($2 == ball ) { msg $chan throws ball | halt }
   }



how can i make so i can use different 'throws'

like:
Code:
  if ($2 == elephant | ship | buffalo | etc ) { msg $chan thats impossible !!! | halt }
Posted By: Loki12583 Re: correct use of pipes in query - 08/10/13 03:16 PM
Here are two different ways: $istok looks for the token in a list of values separated by the specified character (space, ascii 32 in this case), $regex is a more powerful and general purpose matching syntax.

Code:
if ($istok(elephant ship buffalo,$2,32)) { }

if ($regex($2,/elephant|ship|buffalo/iS)) { }
Posted By: ricktee76 Re: correct use of pipes in query - 08/10/13 08:54 PM
Thanks, I used the regex example and it worked perfectly.
© mIRC Discussion Forums