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


Joined: 17 Nov 2000
Posts: 31
Location: USA

PostPosted: Wed Sep 18, 2002 5:22 am   

Logic Potion Problem
 
Im having troubles trying to figure out whats wrong with my potion quaffer. Heres triggers I have so far.

Alias po
#IF (@potion1 > 0) {get plat.satchel @potioncontainer;quaff plat.satchel};#IF (@potion1 = 0) {#IF (@potion2 > 0) {get golden.flask @potioncontainer;quaff golden.flask}};#IF (@potion2 = 0) {#IF (@potion3 > 0) {get book.herbalism @potioncontainer;recite book.herbalism}};#IF (@potion1 = 0 and @potion2 = 0 and @potion3 = 0) {#SH %ansi( 11)Out of -- HEAL POTIONS --;:gwen:#SA %ansi( 12)KENTA....out... --HEAL POTIONS--}

Now it works fine if theres every type of potion, however if theres lets say 2 of type 1 and 3 of type 3 it will mess up and try quarfing, both 1 and 3. Im sort of clueless on how to fix this problem any help would be awesome. The way I keep track of the amount of potions is by a series of triggers. I dont thnk you need that though. I also store the potions in variables Potion1, Potion2, and Potion3. Thanks

-Ash
Reply with quote
cingulli
Wanderer


Joined: 30 Aug 2001
Posts: 53
Location: Finland

PostPosted: Wed Sep 18, 2002 8:58 am   
 
#IF (@potion1 > 0) {get plat.satchel @potioncontainer;quaff plat.satchel} {
#IF (@potion2 > 0) {get golden.flask @potioncontainer;quaff golden.flask} {
#IF (@potion3 > 0) {get book.herbalism @potioncontainer;recite book.herbalism} {
#SH %ansi( 11)Out of -- HEAL POTIONS --;:gwen:#SA %ansi( 12)KENTA....out... --HEAL POTIONS--}}}
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Sep 18, 2002 4:59 pm   
 
The problem is simple, when you decide whether to quaff potion 3, you don't check the value of potion 1. So, anytime potion 2 is 0 and potion 3 isn't you'll quaff potion 3. The fix is also simple, check potion 1.

Alias po
#IF (@potion1 > 0) {get plat.satchel @potioncontainer;quaff plat.satchel};#IF (@potion1 = 0) {#IF (@potion2 > 0) {get golden.flask @potioncontainer;quaff golden.flask}};#IF ((@potion1 = 0) AND (@potion2 = 0)) {#IF (@potion3 > 0) {get book.herbalism @potioncontainer;recite book.herbalism}};#IF (@potion1 = 0 and @potion2 = 0 and @potion3 = 0) {#SH %ansi( 11)Out of -- HEAL POTIONS --;:gwen:#SA %ansi( 12)KENTA....out... --HEAL POTIONS--}

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