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
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Fri Aug 08, 2003 3:54 am   

Multi-line trigger: Is this even possible?
 
This item is up for auction from Victoriana.
Item 'a thick parchment scroll' is type scroll, alignment 0, made of paper,
has keywords 'thick parchment spell scroll'.
This item weighs 0 stones and 6 pebbles, and is valued at 1,250 gp.
This level 50 item has the attributes: none nochange
A thick parchment scroll is in excellent condition.
Contains knowledge of the spell of 'wizard eye', scribed at level 50.
This is a magical spell scroll, written by wizards and containing the
instructions on how to perform a magical spell. Other wizards can 'scribe'
it into their spellbooks and thus learn the spell in order to cast it many
times, or it can be cast directly from the scroll one time if necessary.
The minimum bid on this item is [100] gp.
Magusmagnus is the current bidder on this item, with [3,000] gp.
The imp disappears with an ear-splitting BANG!

I want to assign everything between the first and last line to a single variable, so I can #SHOW the exact same info again, without having to send the command to the MUD.

I tried using
"This item is up for auction from %w.$(%*)^The imp disappears with an ear-splitting BANG!$"
as the trigger pattern, but it doesnt fire... any ideas?
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Fri Aug 08, 2003 5:34 am   
 
Here you go.

#TRIGGER {This item is up for auction from (%w).} {#VAR Auction {Auctioneer: %1}}
#COND {(%*)} {#IF ("%1" =~ "The imp disappears with an ear-splitting BANG!") {
#SET 1
} {
#VAR Auction {@Auction%char(10)%1}
}} {manual}

Everything between the first and last lines will be captured into the @Auction variable.

#SHOW @Auction

(Edit: I foresaw a problem with it capturing every line after using the #SHOW above until it saw another "imp" line, so I changed the first captured line so it would not trigger.)

Hope this helps Very Happy
Reply with quote
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Fri Aug 08, 2003 6:23 pm   
 
However, it still does it.. it doesnt capture the auction, but captures every line.. and @auction gets assigned to the last line the mud sent.. no matter what it is.
Reply with quote
Carabas
GURU


Joined: 28 Sep 2000
Posts: 434
Location: USA

PostPosted: Sat Aug 09, 2003 5:11 pm   
 
quote:
Originally posted by zex0s

However, it still does it.. it doesnt capture the auction, but captures every line.. and @auction gets assigned to the last line the mud sent.. no matter what it is.



Works perfectly for me. I pasted my trigger as-is into the command line, and copied your example above and typed #SHOW %clip, then #SHOW @Auction with several lines of MUD ouput between the two commands. The trigger captured only what it was suppose to. Do you have any other triggers that are assigning values to a variable named "Auction"?
Reply with quote
zex0s
Wanderer


Joined: 29 Jun 2003
Posts: 64

PostPosted: Sun Aug 10, 2003 5:30 am   
 
weird.. I re-pasted the trigger, and now it works.. I must have gotten hold of the first one before you edited the post or something.. thnx Carabas :)

zex0s
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