Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ethershade
Beginner


Joined: 17 Oct 2008
Posts: 11

PostPosted: Fri Oct 24, 2008 6:39 pm   

Unable to use #break?
 
I made this code, but the loop doesnt break when the variable equals 1. Any thoughts as to whats wrong?

Code:
herbamount = %1
herbtarget = %2
herbtotal = %1
#echo
#echo Commencing harvesting!
#loop @herbamount {
     #if (herbabort=1) {#break}
     harvest @herbtarget
     #add herbamount -1
     #waitfor {^You have recovered balance}
}
#echo
inr all spices
inr all @herbtarget
herbabort=0
#echo Harvesting Completed!




Solved it, added a @ before the variable
Reply with quote
intoK
Apprentice


Joined: 18 Feb 2007
Posts: 190

PostPosted: Fri Oct 24, 2008 6:48 pm   
 
#if (herbabort=1) {#break} ?!?

perhaps try
#if (@herbabort=1) {#break}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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