|
Dhya Newbie
Joined: 02 Oct 2009 Posts: 2
|
Posted: 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... |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
Dhya Newbie
Joined: 02 Oct 2009 Posts: 2
|
Posted: 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...
|
|
|
|
|
|