Order of automaticly called scripts

Paragon

Member
Ok.. I looked into the prefs and found:
betweenBattleScript <---- This is called before battles(?) so it should kind of be a prebattle script? What arguments can it take?

buyScript <---- Called when the cli command buy is used? What arguments can it take?

counterScript <---- called when a counter expires? what args?

recoveryScript <---- called when you get beaten up? (can it be called after every battle?) what args?
 
Last edited:

Bale

Minion
I don't know anything about buyScripts, but for the other three, there are excellent examples on this site you can learn from.

betweenBattleScript: Best Between Battle
counterScript: CounterChecker
recoveryScript: Universal Recovery

Looking at those scripts will easily tell you what args they take and a LOT more about how they work. Plus you can learn a lot from reading those thread. Please read the questions that have already been asked and answered.
 

Spiny

Member
It looks like buyScript was implemented in Nov 2008's build 6466.

On Feb. 5, 2009, JH said something about buyScript in a post here at the KoL forums.
 
Last edited:

Bale

Minion
Actually, buyScript is kinda interesting. Looking at that, this cute little script popped into my head to ensure that you will always purchase potions from the mall unless you're a sauceror. A lot of people have clamored for that, so here's the answer. Note that this will change nothing if you are a sauceror, nor will it change behavior for anything that saucerors can only make 1 of.

set buyScript = potionBuy.ash

For those who aren't comfortable with copy/pasting a script, I've attached this here.
Code:
// This will ensure you always purchase potions if you're not a Sauceror!
// set buyScript = potionBuy.ash

script "potionBuy.ash";
notify "Bale";

boolean main(item itm, int qty, int ingredientLevel, boolean defaultBuy) {
	if(my_class() != $class[sauceror])
		switch(itm) {
		case $item[philter of phorce]:
		case $item[Frogade]:
		case $item[potion of potency]:
		case $item[oil of stability]:
		case $item[ointment of the occult]:
		case $item[salamander slurry]:
		case $item[cordial of concentration]:
		case $item[oil of expertise]:
		case $item[serum of sarcasm]:
		case $item[eyedrops of newt]:
		case $item[eyedrops of the ermine]:
		case $item[oil of slipperiness]:
		case $item[tomato juice of powerful power]:
		case $item[banana smoothie]:
		case $item[perfume of prejudice]:
		case $item[libation of liveliness]:
		case $item[milk of magnesium]:
		case $item[papotion of papower]:
		case $item[oil of oiliness]:
		case $item[cranberry cordial]:
		case $item[concoction of clumsiness]:
		case $item[phial of hotness]:
		case $item[phial of coldness]:
		case $item[phial of stench]:
		case $item[phial of spookiness]:
		case $item[phial of sleaziness]:
		case $item[Ferrigno's Elixir of Power]:
		case $item[potent potion of potency]:
		case $item[plum lozenge]:
		case $item[Hawking's Elixir of Brilliance]:
		case $item[concentrated cordial of concentration]:
		case $item[pear lozenge]:
		case $item[Connery's Elixir of Audacity]:
		case $item[eyedrops of the ocelot]:
		case $item[peach lozenge]:
		case $item[cologne of contempt]:
		case $item[potion of temporary gr8tness]:
		case $item[blackberry polite]:
			return true;
		}
	return defaultBuy;
}
 

Attachments

  • potionBuy.ash
    1.7 KB · Views: 111
Last edited:
Top