looking for a script for a buffset using mostly sauceror potions

basically, im hoping for a script for buying X/using X of these potions:
2 Ferrigno's Elixir of Power
2 philter of phorce
2 potion of temporary gr8tness
2 tomato juice of powerful power
2 Connery's Elixir of Audacity
2 serum of sarcasm
the 4 trivial avocation cards
2 bottle of fire
2 SPF 451 lip balm
2 drop of water-37
2 can of black paint
1 cold-filtered water
1 graveyard snowglobe
1 cool cat elixir
1 too legit potion
1 radium-flavored potato chips
1 wintergreen-flavored potato chips

and, if its not too much to ask, a spell based one as well...
2 potion of temporary gr8tness
2 tomato juice of powerful power
the 4 trivial avocation cards
2 can of black paint
1 cold-filtered water
1 ennui-flavored potato chips
2 Hawking's Elixir of Brilliance
2 ointment of the occult
2 cordial of concentration
2 concentrated cordial of concentration
2 sugar cherry
2 recording of Elron's Explosive Etude
2 Funky dried mushroom
use Jackass Plumber home game (i have it, just try and use it, might want to make this last, in case ive already used one once already...
2 black sheepskin diploma

alright, i think that should do it, thanks very much for the help!
EDIT: also, if theres some seemingly obvious one i missed, please, mention it and ill add it, but i dont want anything that req full, drunk, spleen, ect.
 
Last edited:

Theraze

Active member
Also... this is the repository, not (optimally) the place for questions. If you're looking to offer a buffing script, you've found the right spot. If you're asking for one... or even trying to figure out how to get there... Scripting Discussion would be a better place for discussion on it.
 

Theraze

Active member
Okay, now that we've moved to the talkie zone... :)

Decision tree one: Are you trying to build a script yourself or commission one?

Decision tree two - a: If you're trying to build it, are you wanting to use CLI or ASH? CLI works more easily to start, just save your script with the .txt extension, but ASH lets you do things that are niftier.
Decision tree two - b: If you're trying to commission it, any payment?
 
Okay, now that we've moved to the talkie zone... :)

Decision tree one: Are you trying to build a script yourself or commission one?

Decision tree two - a: If you're trying to build it, are you wanting to use CLI or ASH? CLI works more easily to start, just save your script with the .txt extension, but ASH lets you do things that are niftier.
Decision tree two - b: If you're trying to commission it, any payment?

um was kinda asking for one, but i can make it myself, if needed, especially since i dont think i have a way to pay for it. just would like to know how, esp. since its quite a few different items, i can just do it myself as long as i know the format, and was hoping for making it an ash script i can put in my script folder, i got enough things i copy into the cli, and thanks for any help. also, wouldn't that just be the outcome of desision tree one, instead of desision tree 2 a/b? dunno, seems odd. but then again, maybe thats why i know jack all about scripting.

EDIT: sorry for the longish delay, i just forgot, i got a mind like a sieve. oddly excellent memory, but i can forget why i walked into a room...
 
Last edited:

Theraze

Active member
Okay, so we've picked one->build, and two(a)->ASH.

ASH basics:
Buying items: buy(count, $item[item name]);
Using items: use(count, $item[item name]);

Example for getting 2 philters:
buy(2, $item[philter of phorce]);
use(2, $item[philter of phorce]);
 

heeheehee

Developer
Staff member
Note that you can actually use a CLI script by sticking it into a txt file and running it in exactly the same way that you run an ASH script.
 

Bale

Minion
leeman27534, could you tell us why a mood won't do the job? How does it fail to meet your needs?
 
i want this script for just every now and then, for only an instance or two, and just like the idea of a manual trigger for all of these as opposed to something that might auto run, if i neglect it. im a frigging idiot at times, and i will forget it at least once for sure, so id rather it be somethign not auto-refreshing, im not planning to use it for something like basement just yet, i just kinda want to build it while im thinking of it...
 

Catch-22

Active member
i want this script for just every now and then, for only an instance or two, and just like the idea of a manual trigger for all of these as opposed to something that might auto run.

Check out the ASH commands Theraze posted here. That should be enough to get you started. You may also be interested in a template that you can base the script on, so I came up with this. Every ASH scripter will have their own style, but I find this one usually works well for most of the things I can come up with.

PHP:
//Title:   template.ash
//Purpose: A template to be used for ASH scripts.
//Author:  Catch-22

script "template.ash"

void template() {
    //ASH commands go here.
}

void main() {
    template();
}

Note that an ASH script doesn't need to look like this, you could simply put ASH statements line after line without even having a main() method, but you may as well get into good practices while you can :) Note that lines beginning with "//" are comment lines, so they're only useful to someone reading the script, they aren't needed.
 
Alright, can someone look them over real quickly...

the potions that give more than just 10 to non saucerors i do only want 1 of, the saucerors ones i do want 2 of... i think its fine, but still. i dont want to waste 20k+ testing it out, so if someone that knows what scripts are supposed to look like, thanks much.
 

Attachments

  • z Attacker Buffs.ash
    1.7 KB · Views: 43
  • z Spellslinger Buffs.ash
    1.6 KB · Views: 36

Catch-22

Active member
the potions that give more than just 10 to non saucerors i do only want 1 of, the saucerors ones i do want 2 of... i think its fine, but still. i dont want to waste 20k+ testing it out, so if someone that knows what scripts are supposed to look like, thanks much.

For a first attempt it's not too bad. I don't see why it wouldn't work. Just as a note, you don't need to call your first function "template()" that was just an example, you could call it "spellslinger_buffs()" or something.

There are ways to determine how much of an effect you will get for using a potion, but that is more in-depth and will come with the refining process.

Although what you have would probably work, something I would do is use "retrieve_item()" instead of "buy()". This will use KoLmafia's logic to determine the best way to get an item and, assuming you have your buy preferences set right, will prevent you from purchasing an overly expensive potion if all the cheap ones are sold out.

Edit: I also noticed that you removed the comment lines from the script. That's fine, but sometimes it can be good to leave them there. They won't affect the script performance, but it can be good to remind you of things or as notes to someone reading the script. Maybe the way I explained them before suggested that you should remove them.
 
Last edited:
nah, but since the script is 99% for me, and im never opening the /ash in txt unless it needs modded for some new buff i adore, i figure notes aren't necessary for anything. but i thought the buy command tried to buy from the mall at the lowest price it can?
 

lostcalpolydude

Developer
Staff member
It does, even if the lowest price is 100k. With retrieve_item() your autoBuyPriceLimit value (default 20k) will keep you from buying anything that's way too expensive, but it also means that you have to turn on mall buying.
 

Bale

Minion
My 2 cents:
PHP:
script "z Attacker Buffs.ash"

void invoke(int x, item it) {
   // Don't buy items if you already own them
   if(x > available_amount(it))
      buy(x - available_amount(it), it);
   use(x, it);
}

void template() {

   invoke(2, $item[Ferrigno Elixir of Power]);
   invoke(2, $item[philter of phorce]);
   invoke(2, $item[potion of temporary gr8tness]);
   invoke(2, $item[tomato juice of powerful power]);
   invoke(2, $item[Connery Elixir of Audacity]);
   invoke(2, $item[serum of sarcasm]);
   invoke(2, $item[bottle of fire]);
   invoke(2, $item[SPF 451 lip balm]);
   invoke(2, $item[drop of water-37]);
   invoke(2, $item[can of black paint]);
   invoke(1, $item[Trivial Avocations Card: Where?]);
   invoke(1, $item[Trivial Avocations Card: When?]);
   invoke(1, $item[Trivial Avocations Card: What?]);
   invoke(1, $item[Trivial Avocations Card: Who?]);
   invoke(1, $item[cold-filtered water]);
   invoke(1, $item[graveyard snowglobe]);
   invoke(1, $item[cool cat elixir]);
   invoke(1, $item[too legit potion]);
   invoke(1, $item[radium-flavored potato chips]);
   invoke(1, $item[wintergreen-flavored potato chips ]);

}

void main() {
    template();
}

Though, like Catch-22 and lost I would normally prefer to use retrieve_item() instead of buy(). Which would make invoke() look like this:

PHP:
void invoke(int x, item it) {
   retrieve_item(x, it);
   use(x, it);
}
 
Last edited:

Rinn

Developer
retrieve_item will also take creation into consideration if it's cheaper to buy the ingredients and create the item instead of buying outright.
 
alright, ill change it to that, bale, but i have no real idea what it does, i am guessing the part at the top is the stuff where it checks if i have it, if not, trys to buy it from the mall if under a certain meat threshold, then uses the number, all tied to one code phraze, invoke? and would this still work for my spellcaster buff one, just replacing the numbers and items as needed? and as to the "how much of an effect i would get" thing, i dunno about all that, mostly the script is for going up against hobo bosses, some other instances i guess, if i ever go basement diving, which i doubt... i dont think any of these items will ever shoot up to 100k and if they ever get too pricey for my taste,ill just remove them, but having the script check if i got the item first is nice, esp. since i got hundreds of some of these items... is there a way to make it in the script so it buys as long as i have under, say, 5 of any of these items, so if i want to manually buff, ill be sure to have some in stock? i dont forsee many instances where i would need to run more than 50 adv of a buff potion in aftercore, so 5 will be nice. i dunno why, but i didlike the idea of skill buffs, but love the idea of potions.
 

Catch-22

Active member
is there a way to make it in the script so it buys as long as i have under, say, 5 of any of these items

There's a few different ways to tackle it, the easiest way would be to acquire 5 of them and use only 1, that way you'd always have 4 in stock.

retrieve_item(5, $item[potion])
use(1, $item[potion])


If you already had 50 of $item[potion], retrieve_item(5, $item[potion]) wouldn't buy anything, if you had say only 3 of them, it would buy/make 2 more to bring it back up to 5.
 
Top