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
ramone_d_hamilton
Newbie


Joined: 12 Mar 2004
Posts: 1
Location: USA

PostPosted: Fri Mar 12, 2004 1:01 am   

Capturing the next line of output
 
I am a relatively new Zmud programmer and I've already come to my first setback. I'm trying to make a trigger so that if I have a pet and the pet kills the mob instead of me, I will automatically get the money from the corpse, examine the corpse and then take items from the corpse if they are held within a variable @loot_objects. Right now I am having a problem with being able to capture the very next line outputted from the mud.

Ex.

The pattern is: You hear (%w)'s death cry.
#IF (@mob_kill_line = ~"Bob") {get coins corpse|examine corpse}

Instead of bob in the parenthesis I want the very next line proceeding the pattern which sets off the trigger. Anyone help would be appreciated.
Reply with quote
user0101
Apprentice


Joined: 01 Aug 2003
Posts: 100
Location: USA

PostPosted: Fri Mar 12, 2004 3:28 am   
 
You said you wanted it for the 'very next line' but I am assuming you mean the line directly above (or preceding) the pattern you supplied. This will trigger off the very next line:

#trigger {You hear %w's death cry.}
#cond {(%w)} {#if (%ismember(%1,@mob_kill_line)) {get coins corpse;examine corpse}} {Within|Param=1}

Or to fire off the preceding line:

#trigger {You hear %w's death cry.} {#loop %numitems(@mob_kill_line) {#if (%line2=~ "%item(@mob_kill_line,%i)") {get coins corpse;examine corpse}}}

Also, from now on please give more information. You didnt supply the preceding line, or the pattern you receive when you look into the contents of the corpse.
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