Results 1 to 4 of 4

Thread: Order of automaticly called scripts

  1. #1
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

    Default Order of automaticly called scripts

    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 by Paragon; 10-02-2009 at 02:52 PM.

  2. #2
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    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.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


  3. #3
    Senior Member
    Join Date
    Mar 2009
    Posts
    650

    Default

    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 by Spiny; 10-03-2009 at 01:29 AM.

  4. #4
    Minion Bale's Avatar
    Join Date
    Jun 2008
    Posts
    13,287

    Default

    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;
    }
    Attached Files
    Last edited by Bale; 10-07-2009 at 12:46 AM.
    If people like my scripts, please send me stuffed Hodgmen.
    Universal Recovery, OCD Inventory Control, CounterChecker, newLife, ChIT.


Similar Threads

  1. Replies: 0
    Last Post: 04-02-2015, 12:40 PM
  2. Replies: 0
    Last Post: 11-27-2013, 10:21 PM
  3. Replies: 0
    Last Post: 11-25-2013, 12:20 AM
  4. Replies: 5
    Last Post: 01-18-2012, 03:52 PM
  5. Bug - Not A Bug Using Anti-anti-antidotes automaticly cause a debuglog
    By Ferdawoon in forum Bug Reports
    Replies: 3
    Last Post: 07-07-2011, 07:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •