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
bebamedo
Novice


Joined: 02 Aug 2006
Posts: 32

PostPosted: Wed Aug 16, 2006 3:17 pm   

script help again
 
I've made following script for healing double afflictions:

#CLASS {Advanced_Healing}
#VAR Paralysis {0}
#VAR herbbalance {1}
#VAR eating {0}
#VAR astma 0
#TRIGGER {H:%d} {#IF ((@herbbalance) AND (@eating = 0)) {#IF (@Paralysis) {outr maidenhair;eat maidenhair;eating = 1};#IF (@astma = 1) {outr kelp;eat kelp;eating = 1}}} "" {nocr|prompt}
#TRIGGER {Terror takes hold, as a numb sensation overcomes your body} {#VAR Paralysis 1}
#TRIGGER {You quickly eat a maidenhair leaf.} {#VAR herbbalance 0;#VAR eating 0}
#TRIGGER {You may eat another herb or plant} {#VAR herbbalance 1}
#TRIGGER {Your paralysis fades and you can move once more.} {#VAR Paralysis 0}
#TRIGGER {Your lungs relax and you can breath easy once again.} {#VAR astma 0}
#TRIGGER {^Your lungs tighten and it becomes hard to breathe.} {#VAR astma 1}
#CLASS 0

Now the problem is that it eats 2 kelps instead of 1., ince bowt ifs fire on doublestab lines. I want the second if to wait for herbbalance. Let me give my output


Rosalina pricks you twice in rapid succession with her dirk.
Your lungs tighten and it becomes hard to breathe.
Terror takes hold, as a numb sensation overcomes your body.
H:234 M:334 <eb> outr maidenhair
eat maidenhair
outr kelp (<<<< HERE IS MY PROBLEM)
eat kelp

You remove 1 maidenhair leaf, bringing the total in the Rift to 48.
H:234 M:334 <eb>
You quickly eat a maidenhair leaf.
Your paralysis fades and you can move once more.
H:234 M:334 <eb>
You remove 1 kelp, bringing the total in the Rift to 26.
H:234 M:334 <eb>
You quickly eat a piece of kelp.
The plant does nothing for you.
H:234 M:334 <eb>
You may eat another herb or plant.
H:234 M:334 <eb> outr kelp
eat kelp

You remove 1 kelp, bringing the total in the Rift to 25.
H:234 M:334 <eb>
You quickly eat a piece of kelp.
Your lungs relax and you can breathe easy once again.
H:234 M:334 <eb>
You may eat another herb or plant.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Aug 16, 2006 3:31 pm   
 
The solution is to put the second #IF inside the "else" part of the first #IF. That way, if you are paralyzed and have asthma, you will deal with the paralysis first and once you have regained herb balance, then the asthma:

#TRIGGER {H:%d} {#IF ((@herbbalance) AND (@eating = 0)) {#IF (@Paralysis) {outr maidenhair;eat maidenhair;eating = 1} {#IF (@astma = 1) {outr kelp;eat kelp;eating = 1}}}} "" {nocr|prompt}
_________________
Kjata
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