|
fumi Beginner
Joined: 27 May 2015 Posts: 10
|
Posted: Fri Oct 02, 2015 10:51 am
How do I extract list item in a %b{@stringlist}%b trigger |
I have figured out how to trigger on a string list item. Now I would like to utilize the specific list item that triggered. For example
stringlist: monster1 | monster2 | monster3
#TRIGGER {%b{@stringlist}%b} {kill monster#}
If monster 3 triggered, I would now like to execute "kill monster3"
Can anyone shed some light on this please? Thanks |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Fri Oct 02, 2015 6:00 pm |
Just use parenthesis to turn it into an anonymous variable
#TR {%b({@stringlist})%b} {kill %1) |
|
_________________ Discord: Shalimarwildcat |
|
|
|
fumi Beginner
Joined: 27 May 2015 Posts: 10
|
Posted: Sat Oct 03, 2015 3:47 pm |
Thanks for the response!
I just tried it with parenthesis, and the trigger is no longer firing. Is there anything else I can try? I am running CMUD latest version. |
|
|
|
fumi Beginner
Joined: 27 May 2015 Posts: 10
|
Posted: Sat Oct 03, 2015 3:59 pm |
Just tried changing the location of parenthesis, and it WORKED!
This is what works for me
#TRIG {(%b{@list}%b)} {kill %1}
I can't believe it finally works. This has been something I've struggled with for a long time. Thank you so much for your insight shalimar! |
|
|
|
|
|