|
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Thu Sep 07, 2006 6:31 pm
VAR strings help |
Say i have a variable string list
#VAR ingredients {apple|orange|banana}
I want to buy everything in that list
#FO @ingredients {buy 8 %i}
can't work cuz i might be full after buying 8 apples
What i need is to keep buying till the line comes out that says i'm full. then stop buying and maybe continue again later on.
thanks |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Fri Sep 08, 2006 3:26 pm |
Why do you have multiple ingredients (since the example you give, you're just eating apples)? When does having multiple ingredients become important (When the shop is sold out? Are some preferable to others?)?
Do you get a message when you buy something and eat it and aren't full yet? E.g. You consume a delicious apple., vs. You consume a delicious apple and feel completely full. |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Fri Sep 08, 2006 3:55 pm |
I'm prolly wrong, but i'm thinking that maybe if the shop is OUT of apples or doesn't sell apples it will move on to the next item?
|
|
|
|
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Fri Sep 08, 2006 7:22 pm |
Hmm, sorry, wasnt too clear in my explanation, what i meant was:
i wanna buy 8 apples, 8 oranges and 8 bananas, but after buying 8 apples, my inventory might be full.
So.. when the msg comes out that my inventory is full, i wanna stop buying everything, and at a command later on, i wanna continue buying, ie, after the 8 apples, so i'll continue buying 8 oranges and so on. |
|
|
|
edb6377 Magician
Joined: 29 Nov 2005 Posts: 482
|
Posted: Sat Sep 09, 2006 7:50 am |
it can work just fine
#CLASS AUTOSHOP]
TRIGGER/ALIAS to start purchasing
TRIGGER TO TURN OFF IF YOU ARE FULL {#t- {AUTOSHOP|WHATTOBUY}
#CLASS 0
#CLASS {AUTOSHOP|WHATTOBUY}
commands to run to purchase what you want
for etc..
#class 0
please understand this is a simple example and your request could be scripted a much better way i am sure with the use of real scripting but its 4am and im not doing it now :P |
|
_________________ Confucious say "Bugs in Programs need Hammer" |
|
|
|
sav Wanderer
Joined: 09 Jan 2006 Posts: 86
|
Posted: Sat Sep 09, 2006 8:07 am |
but what can i use to buy do the same command for every variable in the string?
#FO doesn't go 1 by 1 does it?
as in, #FO will issue the command for all the variables in the string at the same time right?
so closing the class won't help anything.. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Sep 09, 2006 8:15 am |
What Edb is trying to say is no one can write this for you without actual mud outputs. The way to do it is use another variable as a counter. After each purchase you increment the counter with the #ADD command. You use the %item function to determine what to buy on each iteration.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|