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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ardsheal
Newbie


Joined: 25 Oct 2013
Posts: 2

PostPosted: Fri Oct 25, 2013 2:46 pm   

Having Trouble Creating a trigger with a variable in the pattern.
 
This is what I have so far.

I have a button containing this:

Code:

#var mobName %prompt("","Please input a value for the name of the mob.")
#var thePattern %prompt("","Please input trigger exactly as you want it.")

#call @CreateAMobTrigger()


I have a function containing this:
Code:

#tr {@thePattern} {
#var MobArray %additem(@mobName,@MobArray)
#cw @mobcolor} CreateTriggersUsingButtons


What I want it to do is make a Trigger with the value in @thePattern expanded.

So that instead of this:
Code:

Pattern: @thePattern
Value:
#var MobArray  %additem(@mobName,@MobArray)
#cw  @mobcolor

I would like this to happen instead:
Code:

Pattern: The light is here. (This is the value contained in @thePattern)
Value:
#var MobArray  %additem(@mobName,@MobArray)
#cw  @mobcolor


Any help would be appreciated. I know I am missing something simple, I just don't know what.

Thanks in advance,
Ardsheal
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Oct 25, 2013 3:58 pm   
 
You'll need to build your trigger command as a string, concatenating in the values of your variables, then #execute it.
Code:
#execute {%concat("#tr {", @thePattern, "} {#var MobArray %additem(@mobName,@MobArray);#cw @mobcolor} CreateTriggersUsingButtons")}
Reply with quote
Ardsheal
Newbie


Joined: 25 Oct 2013
Posts: 2

PostPosted: Fri Oct 25, 2013 4:13 pm   Thanks
 
Thanks this worked great.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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