efilnikufecin
Member
Problem:
With the ever changing buff prices I have many times found myself needlessly spamming the buffbots with invalid buff requests because I forgot (or didn't know) to update my scripts.
This script is the solution.
First let me say that this script will not buy a philanthropic (once a day) buff. This is in respect for Holatuwol's wishes that scripts not do that. There are 2 blocks in place. 1 is obvious, the other not so obvious.
Now on with how to use it. The script is meant to be imported into your own script. You should know what buffbot you want to use, and kolmafia's buffbot interface must be able to purchase buffs from the chosen bot. You should also know how many turns of the buff you want, and of course what buff you want.
boolean buy_buff(int length, skill buff, string bot) returns false if the buffbot is not in kolmafia's database, or if the script is unable to acquire the bot's price list, or if you request a buff length larger than the buffbot's largest single purchase buff length for the given buff is. Returns true under all other circumstances. length is the minimum number of adventures of the buff you want. The function will send the appropriate amount for the next larger length in the bot's list. buff is of course the buff required. bot is the name of the bot to buy the buff from.
What this script does not do:
It does not wait for the buff. This should be written into the calling script.
It does not verify the buff is received. This also is up to the calling script if required.
It does not verify the buffbot is online. This is not possible within a script.
It does not verify the kmail was actually sent. If you are banned, or the buffbot has you baleeted, that is your own issue. It is not possible to verify sending kmails via script.
It does not check ronin, or hardcore status of your character, or the buffbot.
It does not check your AT buff count.
It does not buy one a day buffs.
It does not load information about all of the buffbots. It only loads info about buffbots in which it needs info about.
What this script does do:
Prevents buffbot spam!!! ;D
Reduces the likelihood of unintentional un-buffed adventuring.
what this script should do:
work with all of the buffs, and buffbots. I have only tested testudinata and ode to booze for 15 adventures, but my understanding is that the buffbots (in kolmafia's database) all use the same "kolmafia parseable" price list so they should all work.
my test results:
resulted in a kmail from testudinata
edit: a problem has been found Problem fixed. see below
jalepeno and jabanero do not work properly.
presently the script ends up with
instead of
or
as the name of the buff in it's compiled database. attempting to place the character represented by ? into a script so as to find it and convert it results in other issues because the file ends up saved in a format kolmafia does not seem to like.
(code tags did not work to stop html decoding spaces inserted.)
Edit again: Inserting the following code fixed the script.
Not pretty, but it works. New version uploaded.
With the ever changing buff prices I have many times found myself needlessly spamming the buffbots with invalid buff requests because I forgot (or didn't know) to update my scripts.
This script is the solution.
First let me say that this script will not buy a philanthropic (once a day) buff. This is in respect for Holatuwol's wishes that scripts not do that. There are 2 blocks in place. 1 is obvious, the other not so obvious.
Now on with how to use it. The script is meant to be imported into your own script. You should know what buffbot you want to use, and kolmafia's buffbot interface must be able to purchase buffs from the chosen bot. You should also know how many turns of the buff you want, and of course what buff you want.
boolean buy_buff(int length, skill buff, string bot) returns false if the buffbot is not in kolmafia's database, or if the script is unable to acquire the bot's price list, or if you request a buff length larger than the buffbot's largest single purchase buff length for the given buff is. Returns true under all other circumstances. length is the minimum number of adventures of the buff you want. The function will send the appropriate amount for the next larger length in the bot's list. buff is of course the buff required. bot is the name of the bot to buy the buff from.
What this script does not do:
It does not wait for the buff. This should be written into the calling script.
It does not verify the buff is received. This also is up to the calling script if required.
It does not verify the buffbot is online. This is not possible within a script.
It does not verify the kmail was actually sent. If you are banned, or the buffbot has you baleeted, that is your own issue. It is not possible to verify sending kmails via script.
It does not check ronin, or hardcore status of your character, or the buffbot.
It does not check your AT buff count.
It does not buy one a day buffs.
It does not load information about all of the buffbots. It only loads info about buffbots in which it needs info about.
What this script does do:
Prevents buffbot spam!!! ;D
Reduces the likelihood of unintentional un-buffed adventuring.

what this script should do:
work with all of the buffs, and buffbots. I have only tested testudinata and ode to booze for 15 adventures, but my understanding is that the buffbots (in kolmafia's database) all use the same "kolmafia parseable" price list so they should all work.
my test results:
Code:
buy_buff(15, $skill[ode to booze], "testudinata");
a quick look at her DC revealed 59 meat was the correct amount to send for 20 adv (non philanthropic) of ode to booze.This buffbot was unable to process your request. Selected target has 3 AT buffs already. Please try again later.
snip snip
You gain 59 Meat.
jalepeno and jabanero do not work properly.
presently the script ends up with
Code:
Jaba?ero/Jalape�o Saucesphere
Code:
Jaba & N t i l d e ero/Jalape & N t i l d e o Saucesphere
Code:
Jabañero/Jalapeño Saucesphere
as the name of the buff in it's compiled database. attempting to place the character represented by ? into a script so as to find it and convert it results in other issues because the file ends up saved in a format kolmafia does not seem to like.
(code tags did not work to stop html decoding spaces inserted.)
Edit again: Inserting the following code fixed the script.
Code:
if(contains_text(temp.name, "o Saucesphere"))
{
if(contains_text(temp.name, "Jaba")){temp.name = skill_to_string($skill[Jabañero Saucesphere]);}
if(contains_text(temp.name, "Jalape")){temp.name = skill_to_string($skill[Jalapeño Saucesphere]);}
}