|
yskar Newbie
Joined: 25 Aug 2004 Posts: 7
|
Posted: Sun Oct 29, 2006 7:52 pm
IF statement based on parsing multiple lines for trigger tex |
I have several IF statements working successfully and many triggers likewise.
What I want to try and do is look in a location and act depending on what I see. For example when I LOOK HERE:
A bronze helmet
A stern merchant
An angry bunny
<health prompt>
What I want to do is scan those lines and bash angry bunny if I see one but if theres no angry bunny just 'sheath sword'.
So I think I need an IF statement that can act on the list of items. Or maybe a trigger inside an if statement. Not sure. Any ideas? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sun Oct 29, 2006 9:52 pm |
Make an alias for looking.
In the value Set a variable to null
#var mob %null
Make a trigger that matches the mob that you don't care for the looks of their face. IE
An angry bunny
For the value put something into the mob variable.
#var mob "angry bunny"
At the health prompt check to see if there were any disagreeable blokes in the room.
#if (@mob!=%null) {bash @mob;#var mob %null} {sheath sword}
Notice that the if statement also clears the mob variable here if there was something in the room.
You would probably want to use #t+ and #t- to turn on and off your triggers so that when you didn't type your look alias they won't be firing. Good luck. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|