 |
Eoin Newbie
Joined: 03 Feb 2005 Posts: 3
|
Posted: Thu Apr 21, 2005 4:48 pm
In programming it was an IF|ELSE statement |
Quick query which I'm sure the brains can solve:) On my char I can attempt certain actions, which generate a fixed text whether successful or not - TextA . If successfull a second (new line) line of text is received - TextB . Now my query is.... is there any way to set an IF|Else funtion to trigger off the first line i.e.
TextA tfires a trigger which waits to see if the second line (TextB) appears and if not sends a command.
Tried using nexted classes with a #WAIT trigger in the nested folder and a #T- {Nested} in the containing folder which fired on the success message being received but the Nested trigger is still firing.
Any suggestions?:) |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu Apr 21, 2005 6:03 pm |
Check out the #cond helpfile
#cond says to fire if the 2nd line appears |
|
_________________
 |
|
|
 |
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Thu Apr 21, 2005 6:03 pm |
This would be a two state trigger. First one uses TextA and then set a condition for TextA passing/failing (TextB). From my point of view failing would be more appropriate such that: if fail recast type thing.
#TRIGGER {TextA} {#NOOP}
#COND {TextB} {recast} "options"
TextA: action
TextB: fail message
recast: command to send to recast
options: either "dur|param=2000" to match within two seconds or "within|param=2" match within next two lines (or whatevers appropriate)
When the condition is done it will loop back to the original trigger and not fire again unless you recast the spell... |
|
|
 |
Eoin Newbie
Joined: 03 Feb 2005 Posts: 3
|
Posted: Thu Apr 21, 2005 10:44 pm |
Thanks for both suggestions guys, unfortunately the problem is that TextB is actually a success message which confirms that the action worked. A specific case would be that the char attempts to cham himself which generates the message 'You attempt to blend in with your surroundings.' . In the case of a failure this is all that is displayed. In the case of a success a second line is received from the mud 'You successfully blend into your surroundings.' Both of the solutions suggested (unless I've misunderstood) are more suited to a situation where TextB was a failure message rather then a success message.
Given that any further suggests?:)
Regards,
Eoin/Dardalion/Heather/Fiachra/Gadai/Abbanbas from Dragonswords |
|
|
 |
Maelstrom Apprentice
Joined: 10 Feb 2005 Posts: 158
|
Posted: Fri Apr 22, 2005 12:06 am |
Ok, thats tougher...
Is the output one line right after another with no intermediate lines? If so you can use this one. Otherwise youll need something different.
#TRIGGER {TextA} {#NOOP}
#COND {^(*)$} {#IF !(%match("%1","TextB")) {Recast}}
Where TextB is the success message. |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Apr 22, 2005 3:17 am |
how about this?
#TRIGGER {TextA} {#noop}
#COND {} {#if (@Failure) {recast}} "wait|param=time in milliseconds"
#trigger {TextB} {#variable Failure 0}
I dunno if a wait-state trigger has any of the limitations of the #WAIT command in triggers, so if you find other things getting wacky on you you might have to find another solution. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
|
|