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
Michael Nelson
Novice


Joined: 03 Oct 2005
Posts: 36

PostPosted: Wed Oct 11, 2006 12:49 pm   

Line Parsing Help Please
 
Ok this is the issue

I recieve text in this form from the MUD

------------------------- [ Resistances ] ----------------------
bash : 14 energy : -22
mental : 41 poison : 19
water : -29
----------------------------------------------------------------

my goal is to store each of the numbers in a variable @EnergyRes etc.
the fields change can be any of like 20 different resistances and are not displayed if 0

If one of my triggers of the form #TRIGGER {bash%s:%s(%n)}{#var BashRes %1} fires it will not parse the remainder of the line and get energyres or whatever that resistance may be.

It seems there is a way to do this using #COND but I have been unable to figure it out

Thanks
Reply with quote
Michael Nelson
Novice


Joined: 03 Oct 2005
Posts: 36

PostPosted: Wed Oct 11, 2006 7:31 pm   Work Around
 
Though this doesn't answer my underlying question here is what I did to solve it

#TRIGGER {^(%w)%s:%s(%*)%s(%w)%s :%s(%*)$} {
#IF (%1 == "acid") {#AddKey Mob Acid=%2}
#IF (%3 == "acid") {#AddKey Mob Acid=%4}
#IF (%1 == "bash") {#AddKey Mob Bash=%2}
#IF (%3 == "bash") {#AddKey Mob Bash=%4}
#IF (%1 == "pierce") {#AddKey Mob Pierce=%2}
#IF (%3 == "pierce") {#AddKey Mob Pierce=%4}
#IF (%1 == "slash") {#AddKey Mob Slash=%2}
#IF (%3 == "slash") {#AddKey Mob Slash=%4}
#IF (%1 == "air") {#AddKey Mob Air=%2}
#IF (%3 == "air") {#AddKey Mob Air=%4}
#IF (%1 == "cold") {#AddKey Mob Cold=%2}
#IF (%3 == "cold") {#AddKey Mob Cold=%4}
#IF (%1 == "disease") {#AddKey Mob Disease=%2}
#IF (%3 == "disease") {#AddKey Mob Disease=%4}
#IF (%1 == "earth") {#AddKey Mob Earth=%2}
#IF (%3 == "earth") {#AddKey Mob Earth=%4}
#IF (%1 == "energy") {#AddKey Mob Energy=%2}
#IF (%3 == "energy") {#AddKey Mob Energy=%4}
#IF (%1 == "fire") {#AddKey Mob Fire=%2}
#IF (%3 == "fire") {#AddKey Mob Fire=%4}
#IF (%1 == "holy") {#AddKey Mob Holy=%2}
#IF (%3 == "holy") {#AddKey Mob Holy=%4}
#IF (%1 == "lightning") {#AddKey Mob Lightning=%2}
#IF (%3 == "lightning") {#AddKey Mob Lightning=%4}
#IF (%1 == "magic") {#AddKey Mob Magic=%2}
#IF (%3 == "magic") {#AddKey Mob Magic=%4}
#IF (%1 == "mental") {#AddKey Mob Mental=%2}
#IF (%3 == "mental") {#AddKey Mob Mental=%4}
#IF (%1 == "negative") {#AddKey Mob Negative=%2}
#IF (%3 == "negative") {#AddKey Mob Negative=%4}
#IF (%1 == "poison") {#AddKey Mob Poison=%2}
#IF (%3 == "poison") {#AddKey Mob Poison=%4}
#IF (%1 == "shadow") {#AddKey Mob Shadow=%2}
#IF (%3 == "shadow") {#AddKey Mob Shadow=%4}
#IF (%1 == "water") {#AddKey Mob Water=%2}
#IF (%3 == "water") {#AddKey Mob Water=%4}
}

I then followed by a single copy of this for when there is only one on a line
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