|
Ardsheal Newbie
Joined: 25 Oct 2013 Posts: 2
|
Posted: 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 |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: 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")} |
|
|
|
|
Ardsheal Newbie
Joined: 25 Oct 2013 Posts: 2
|
Posted: Fri Oct 25, 2013 4:13 pm Thanks |
Thanks this worked great.
|
|
|
|
|
|
|
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
|
|