 |
Michael Nelson Novice
Joined: 03 Oct 2005 Posts: 36
|
Posted: 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 |
|
|
 |
Michael Nelson Novice
Joined: 03 Oct 2005 Posts: 36
|
Posted: 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 |
|
|
 |
|
|