Filling script

by Aebrin

Back to Mechanic's Corner.

Aebrin2005-02-28 06:13:38
This is the Zmud script
QUOTE
@refillnumber = %1
#MATH ngalingale 8*@refillnumber
#MATH nsargassum 2*@refillnumber
outr @ngalingale galingale
outr @nsargassum sargassum
outr @refillnumber juniper
outr @refillnumber yarrow
#LOO @ngalingale {add galingale}
#LOO @nsargassum {add sargassum}
#LOO @refillnumber {add juniper}
#LOO @refillnumber {add yarrow}
@ngalingale = 0
@nsargassum = 0
@refillnumber = 0


And this is the commands sent (when trying 3 healths):

QUOTE
outr 24 galingale
outr 6 sargassum
outr 3 juniper
outr 3 yarrow
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add galingale
add sargassum
add sargassum
add sargassum
add sargassum
add sargassum
add sargassum
add juniper
add juniper
add juniper
add yarrow
add yarrow
add yarrow


And this is the result:

QUOTE
You remove 24 galingale, bringing the total in the Rift to 444.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You remove 6 sargassum, bringing the total in the Rift to 63.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You remove 3 juniper, bringing the total in the Rift to 76.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You remove 3 yarrow, bringing the total in the Rift to 74.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a stem of galingale in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-You must specify a valid alchemical ingredient.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a juniper berry in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a juniper berry in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a yarrow sprig in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a yarrow sprig in a glass alembic in preparation for amalgamation.
2493h, 2646m, 2187e, 10p, 11365en, 12130w ex-
You put a yarrow sprig in a glass alembic in preparation for amalgamation.


When doing one refill it works, then the others, it screws up... anybody know why?
Aebrin2005-02-28 06:15:16
EDIT: Nevermind I realised I mentioned it above

EDIT 2: Thought maybe my Edit is giving the false impression that I solved it, no I still need help.
Unknown2005-02-28 13:12:01
The only real script problem I see here, which will have unwanted side effects even if it isn't the cause of your problem, is that you are assigning the values to the wrong variables. Do not put the @ in front of a variable when assigning to it unless you know what this does and it's what you intended. Basically, zMUD will evaluate the contents of the variable and make a new variable using the contents as the name.

CODE
TestOne = "TestTwo"
@TestOne = "Hello"


This code snippet gives you TestOne = "TestTwo" and TestTwo = "Hello" instead of what you probably thought would happen.

The only other problem I might see is if Lusternia has a limit on the number of commands you execute within a certain period of time (which they don't appear to have done yet). If it ever becomes a problem, you'll have to add a very brief wait period in the alias to space out your commands more.
Unknown2005-02-28 14:53:07
QUOTE
The only other problem I might see is if Lusternia has a limit on the number of commands you execute within a certain period of time (which they don't appear to have done yet). If it ever becomes a problem, you'll have to add a very brief wait period in the alias to space out your commands more.
62348



That's actually most likely what the problem is. The input gets cut off after 16th galingale and resumes only at the 2nd juniper. That probably means that on the MUD's side all input between those two points becomes something like:

"add galingaleadd galingaleadd galingaleadd galingaleadd galingaleadd galingaleadd galingaleadd galingaleadd sargassumadd sargassumadd sargassumadd sargassumadd sargassumadd sargassumadd juniper"

Happened to me before when sending too much stuff at once. So putting pauses after every 10th or so command should solve the problem.
Unknown2005-02-28 16:08:57
I've suspected this, but sometimes I can get 30 commands through and other times only about 15 or 20. In Achaea, it tells you to please wait before sending more. Lusternia doesn't have a direct warning like that (yet).
Aebrin2005-03-01 02:24:49
Is there a way to pause it then? Like put the herb for one set in, then the program pauses, then puts the other lot in, until all the needed herb is in?
Drago2005-03-01 02:43:07
Just put a #wa in between each command, it'll wait until it detects something from the mud. Its slower but it wont fail..

Of course, most people think waits are evil. ninja.gif
Unknown2005-03-01 02:44:22
Try setting up an alias that uses alarms and have each alarm decrement the count of vials you're filling and fire off another alarm if the count is still greater than zero.

(Pseudo-code)
CODE
#ALIAS fill {#var Count %1;#var Type %2;indredients}
#ALIAS ingredients {put blah in alembic;put bleh in alembic;#alarm +1 {#add Count -1;#if (@Count > 0) {ingredients}}}


It's very rough, but I hope it makes sense enough to help you out.
Drago2005-03-01 02:45:41
See, mine was so much simpler to understand happy.gif
Raezon2005-03-01 03:16:36
I just created aliases such as healthpot, that individually grabbed the items I needed for one health vial and added them to the pot. That way I could type healthpot 20 times if I needed to without worrying about the input being sent in all at once.
Unknown2005-03-01 03:30:31
I'm mildly curious as to why Raezon needs a health potion alias. cool.gif
Daganev2005-03-01 04:30:10
he wants to learn EVERYTHING
Terenas2005-03-01 16:21:29
I guess being an Elder god doesn't support his living, refilling must pay better. happy.gif