Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
aslanthekat
Novice


Joined: 17 Sep 2007
Posts: 44
Location: Missouri

PostPosted: Thu Jul 01, 2010 2:13 pm   

Trigger Help: List in Pattern
 
I have a pattern {one|two|three|four} and I want whichever of those 4 that triggers the trigger to be stored in a variable. Something like
Code:
#ONINPUT {{one|two|three|four}} {#var triggerer WhateverMatchedGoesHere}
and the triggerer variable would be either one, two, three, or four. I am going to type one two three four, so it'll have to be #ONINPUT I think, instead of #TR.

Thanks in advance for the help
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Jul 01, 2010 3:56 pm   
 
Code:
#ONINPUT {^({one|two|three|four})$} {#VAR triggerer %1}


Plain and simple. You also want to have the anchors (^ and $) so that it matches only at the beginning and end of a line. If you're needing to type 'one five six', then get rid of the $, but having the ^ will prevent the oninput from firing when you're typing things like 'Hey, it's a quarter to one now!'

Charneus
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net