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


Joined: 02 Oct 2009
Posts: 2

PostPosted: Fri Oct 02, 2009 10:49 pm   

Conversion from ZMUD that just won't work
 
Could someone kindly tell me what it is I've got wrong here? This is a script for refills Achaea that worked perfectly in Zmud but refuses to cooperate in CMUD and I can't work out why...

@totFill = 0
@FiftyBatches = 0
@ModusBatches = 0
#IF (%1) { @totFill = %eval( %1 * 4)} {@totFill = 4}
@FiftyBatches = %eval( @totFill / 50)
@ModusBatches = %eval( @totFill \ 50)
#LOOP @FiftyBatches {
outr 50 valerian
outr 50 goldenseal
outr 50 ginseng
outr 50 myrrh
inpot 50 valerian in pot
inpot 50 goldenseal in pot
inpot 50 ginseng in pot
inpot 50 myrrh in pot
}
#IF (@ModusBatches > 0) {
outr @ModusBatches valerian
outr @ModusBatches goldenseal
outr @ModusBatches ginseng
outr @ModusBatches myrrh
inpot @ModusBatches valerian in pot
inpot @ModusBatches goldenseal in pot
inpot @ModusBatches ginseng in pot
inpot @ModusBatches myrrh in pot
}
@totFill = 0
@FiftyBatches = 0
@ModusBatches = 0

I had separate ones for each sort of refills, of course, and in case it's someone who isn't a complete Achaea addict who sees this, you can only inpot a maximum of 50 of one herb at a time which is why it's like this.

Does anyone know why it won't work? I would dearly love a solution...
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 03, 2009 1:52 am   
 
First of all, the syntax is:

var=blah

Not

@var=blah.

That will probably solve a lot of your problems there. Other than that, I don't see anything else wrong right now.

Charneus
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Oct 05, 2009 3:37 pm   
 
Also, CMUD doesn't require the %eval function anymore. Just using () parenthesis is enough. So you should be able to just do this:
Code:
#IF (%1) { totFill = ( %1 * 4)} {totFill = 4}
FiftyBatches = ( @totFill / 50)
ModusBatches = ( @totFill \ 50)

Using %eval in CMUD still works, but is slower than just using the parenthesis.
Reply with quote
Dhya
Newbie


Joined: 02 Oct 2009
Posts: 2

PostPosted: Tue Oct 06, 2009 10:00 pm   
 
Thank you both very much! It's all working nicely now, though I haven't tested all of them yet...
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