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
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Mon Jul 15, 2002 8:22 pm   

question with variables and if statements
 
i have variables set up for my health and mana
i set up a trigger to say if my hp gets below somethign to cast a healing spell
but when my mana gets below a number i want it to stop...is that possible?
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Mon Jul 15, 2002 8:40 pm   
 
Yes, you can use AND and OR in #IF statements. You can also nest #IF statements.

First Example:
#IF ((@hp < @hpmin) & (@mana > @manamin)) {cast heal}

Second Example:
#IF (@hp < @hpmin) {#IF (@mana > @manamin) {cast heal} {#SAY Insufficient Mana to cast heal.}}

Troubadour
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Mon Jul 15, 2002 9:39 pm   
 
cool, that worked. now i'm playing around with brew and i'm trying to get it to seperate shady vials from the potions...my attempts so far in it looping the triggers or not working at all.

#tr {brew (*)} {#IF ((brew '%1') & ("You have created a potion of cure critical!")) {"put potion pouch"} {drop potion}}

not exactly sure where i'm going wrong..
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 16, 2002 12:25 am   
 
I'm not sure if you intended to use a trigger (#TR, for MUD output) or an alias (#AL, for MUD input). In any case, since both conditions are strings, and they aren't compared to anything else, they will both be true.

Putting the good potions away is easy:
#TR {You have created a potion of} {put potion pouch}
Is there any message when you attempt to make a potion and it doesn't work?

LightBulb
Senior Member
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Tue Jul 16, 2002 1:27 am   
 
A small shady vial explodes violently! - Fail
You have created a potion of <spell name>! - Success
You have created a small shady vial! - Fail

the shady vial is the same name as the regular potions u want to keep
is there a way u can loop making lots of potions and toss out the bad?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 16, 2002 5:35 pm   
 
#TR {You have created * shady vial} {drop potion}
#TR {shady vial explodes} {drop potion}

You might not need to drop a vial if it exploded.

LightBulb
Senior Member
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