mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2013
Posts: 7
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Oct 2013
Posts: 7
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 }

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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)) { }

Joined: Oct 2013
Posts: 7
R
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Oct 2013
Posts: 7
Thanks, I used the regex example and it worked perfectly.


Link Copied to Clipboard