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


Joined: 05 Mar 2003
Posts: 2
Location: United Kingdom

PostPosted: Wed Mar 05, 2003 11:40 am   

relfex healing
 
this is my first request I have a trigger to automatically sip health or mana when a threshold is hit. At the moment it works well BUT it sips twice (the second does not effect)
Here are the elements of the set

Variable Name: healbalance
Value: 1

Trigger pattern: You may drink another health or mana elixir.

Value : Healbalance=1

Trigger Pattern : %1h, %2m (*)-
Value:
#if @healbalance=1 {#if %1<1400 {
sip health
healbalance=0
}}
#if @healbalance=1 {#if %2<300 {
sip health
healbalance=0
}}

Any reasons for the dupoble sip i would be gratefull.

Regards

Questron

(this is used in achaea)
Reply with quote
icemanvko
Beginner


Joined: 05 Mar 2003
Posts: 19
Location: USA

PostPosted: Wed Mar 05, 2003 3:45 pm   
 
I'm by no means a Zmud Scripting expert, but it looks like you might want to change the %1 and %2 to @hp and @sp variables, because then could put them in a status bar and see that they are getting populated correctly.

I think the correct syntax would be

&d{hp}h, &d{sp}m

the create the hp and sp vars.

Then the reason it sips twice is because you don't have an or statement. Not sure the syntax for or, but if your %1 and %2 variables aren't being filled, then they would bothe be < than the values you put in your if statements and thus they would both trigger you to sip health.

your logic statement should be

if healbalance = 1 then if (@hp<1400) or (@sp<300) then sip health, healbalance =0 endif

Not sure how to convert that into zmud script. but you should be able to figure it out.
Reply with quote
questron
Newbie


Joined: 05 Mar 2003
Posts: 2
Location: United Kingdom

PostPosted: Thu Mar 06, 2003 9:36 am   
 
Thnaks for this but i've been told that its soemthing to do with inherited things. Anyone with any ides please lets me know.

Regards

Questron
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Thu Mar 06, 2003 12:25 pm   
 
Trigger Pattern : (%n)h, (%n)m (*)-
Value:
#if (@healbalance=1) {#if (%1<1400) {
sip health
healbalance=0
} {}}
#if (@healbalance=1) {#if (%2<300) {
sip health
healbalance=0
} {}}

umm...these are some changes that i would add and see if it works...if it does, i guess post back.

-=Realms of the Forgotten=-
rotf.net:5000
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Mar 11, 2003 12:20 am   
 
Check the trigger options (Options tab in the editor window). Under "Trigger on" (right side of options) make sure you have Newline unchecked and Prompt checked. Change the order of actions so that you set the variable, @healbalance, to zero before sipping. Use the %n or %d wildcards in your pattern rather than %1 and %2, so the trigger doesn't fire on things like:
You see a lot of trash, whoever lives here must be a junk-collector.
(%1 = "You see a lot of tras", %2 = "whoever lives here ", and %3 = "ust be a junk")

Trigger Pattern : (%n)h, (%n)m (*)-
Value:
#if (@healbalance=1) {#if (%1<1400) {
healbalance=0
sip health
}}
#if @healbalance=1 {#if %2<300 {
healbalance=0
sip mana
}}


LightBulb
Advanced Member
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Mar 11, 2003 1:26 am   
 
Can you sip twice or only once? Currenly it is possible to spam 2 sips if
both mana and health is low. If you can not sip twice then prioritzing health

Trigger Pattern : (%n)h, (%n)m (*)-
Value:


#if (@healbalance=1) {
#if (%1<1400) {
healbalance=0
sip health
} {
#if (%2<300) {
healbalance=0
sip mana
}


Ton Diening
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