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


Joined: 19 Sep 2005
Posts: 3

PostPosted: Mon Sep 19, 2005 8:08 pm   

Non-terminating capture trigger
 
Okay, I'm pretty new to zMUD. I've been working on adapting the StormFront XML-ish tags sent from the DragonRealms server (I say XML-ish because it doesn't follow conventions =/). My issue is with a trigger that doesn't stop storing data into a variable.

Consider the following output from the server:
Code:
<roundTime value='1127163488'/><dialogData id='minivitals'><skin id='manaSkin' name='manaBar' controls='mana' left='25%' top='0%' width='25%' height='100%'/><progressBar id='mana' value='98' text='mana 98%' left='25%' customText='t' top='0%' width='25%' height='100%'/></dialogData>


I have another trigger that handles dialogData. What I want to do is extract the value element of the roundTime tag without storing the rest of the line with it.

The trigger I have is as follows:
Code:
#TRIGGER {~<roundTime value='(&roundtime_max)'~/~>} {#DOSTUFF}


This is the content of the roundtime_max variable:
Code:
1127164061'/><dialogData id='minivitals'><skin id='manaSkin' name='manaBar' controls='mana' left='25%' top='0%' width='25%' height='100%'/><progressBar id='mana' value='98' text='mana 98%' left='25%' customText='t' top='0%' width='25%' height='100%


I would greatly appreciate any help in fixing this buggy trigger.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Sep 19, 2005 8:49 pm   
 
#TRIGGER {~<roundTime value='(&%droundtime_max)'~/~>} {#DOSTUFF}

The * pattern is used by default when none is specified. It is a greedy pattern meaning it will try to match as many characters as possible. Using the more limited %d pattern for your match will give you the results you want.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
SolarianKnight
Newbie


Joined: 19 Sep 2005
Posts: 3

PostPosted: Mon Sep 19, 2005 11:30 pm   
 
That got it, thanks.
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