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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
riemer11
Beginner


Joined: 28 Oct 2003
Posts: 10

PostPosted: Fri Aug 13, 2010 9:35 am   

Multi line trigger help
 
Hi,

I've been searching the forum for help on multi-line triggerss, but couldn't find what was needed: capture two lines whereas the second line defines how to read the first line. Not really complex, here's an example of mud output:

---mud output---
The Administrator tells you 'of The Elder's Home which is in the general area'
The Administrator tells you 'of The Wood Elves of Nalondir.'
---mud output

This should result in sending the following commands to the mud:
runto wood elves of nalondir
n;e;etc (self-defined path to Elders home, taken from first line)

The first line holds the room name and the second line has the area name. Room names are not unique across areas so you need both lines to find the correct destiny. Normally, you can use COND upon receiving the area name, and then wait for the room name. However, the order is reversed in this mud (Aardwolf) and I just can't get it to work properly. Any solution? Thanks!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Aug 13, 2010 6:11 pm   
 
Capture the entire speech, using a normal pattern-type trigger and a manual-state #CONDITION. Other than the first line and the blank line separating the mob/room/area paragraph and the time, nothing else is static enough to trigger on due to the word-wrapping of the mob/room/area paragraph (ie, room name might appear across two lines instead of just one). This #condition will then concat the text speech into a single line (minus the Questor tells you '...' formatting) and you can then #CALL %match() for an easy way to parse out all the necessary information.

I'll leave it to you to get it working, but it will look something like this:

#trigger "tQuestSpeech" {^{@Questors} tell you 'Thank you, brave %w!'$} {Questspeech = ""}
#condition {^(*)$} {#if ("%1" = "") {#state tQuestSpeech 2} {line = "";#call %match(%1,"tells you '(*)'",@line);QuestSpeech = %concat(@QuestSpeech," ",@line)}}
#condition {^{@Questors} tells you 'You have (%d) minutes to complete your quest.'$} {QuestTime = %1;#call %match(@QuestSpeech,"Seek (*) out somewhere in the vicinity of (*) which is in the general area of (*).",@QuestMob,@QuestRoom,@QuestArea);runto @QuestArea;stuff to go from area entrance to quest room}
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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