That FN Ninja
Member
TraFa 1.7 - The familiar helper
Training Familiars the Mafia way.
This hodgepodge of ash functions will do a variety of things depending on how you set up the user preferences at the beginning of the script. Hurray for my first published script! Kolmafia ash scripting is the first scripting I've ever done and I'm still fairly unsure of my work, so feedback please! Comments & suggestions on ways to clean up the code and reduce server hits is most welcome!
Requires Zlib.
User Preferences
boolean trainall
string famtotrain
int trainweight
int trainturns
If trainall is true the script will train any of your collected familiars whose base weight is < trainweight for trainturns amount of turns or until all familiars base weight equals trainweight.
If famtotrain is anything other than empty quotation marks the script will train the famtotrain while it's base weight is < trainweight for trainturns amount of turns. Uses mafia's fuzzy matching (i.e. "lep" = "Leprechaun").
boolean trophy_train
boolean buytrophies
If trophy_train is true the script will check the total weight of your terrarium and current familiar weight trophies and then train each familiar one pound until the next trophies weight requirements are met or until trainturns reaches zero. If you don't have enough familiars for the next trophy it will tell you how many more you need to collect before you can obtain that trophy, but it will still attempt to train if you have familiars whose base weight is less then 20 lbs.
If buytrophies is true after the training the script will attempt to buy any familiar weight trophies you qualify for as long as you have enough meat.
boolean arena_tt
boolean arena_wt
string locale
If arena_tt is true the script will train familiars in the arena until either they reach the trainweight or trainturns reaches zero.
If arena_wt is true the script will train familiars in the arena until they reach the trainweight. Please note that if arena_wt is true trainturns is disregarded.
If arena_wt & arena_tt are false the script will train familiars by farming with them at locale until either they reach the trainweight or trainturns reaches zero.
boolean get_fe
If get_fe is true the script will check which of your familiars are missing their familiar specific equipment and then obtain it. It evaluates whether it would be cheaper to buy the equipment or to train in the arena for it.
boolean feed_stocking
If feed_stocking is true any time the script uses your stocking mimic it will try feed it to gain weight. The script will buy the cheapest candy and feed your stocking.
Uses Mafias valueOfAdventure.
The default for this setting is 500. To change it type
set valueOfAdventure=X into the cli, where X is the value you want to set it to.
The valueOfAdventure is the value of one adventure and should be set to the average amount of meat you make per adventure. Obviously the more meat you make the more meat is lost with every adventure not used farming. If you train a familiar 2 times in the arena not only does it cost you 200 meat(100 per arena match), it also costs you the meat you would have made if you had used those adventures elsewhere. This will change from time to time depending on what areas a character has access to, what they are wearing, etc., etc. Anyways, this is factored into the familiar equipment obtaining logic to make sure meat is not wasted by getting the equipment in the arena.
Notable Functions:
void faminfo()
Prints various info about your familiars. It tells you the total base weight of all the familiars in your terrarium, it lists which familiars you have and haven't collected, it tells you how many familiars you've collected out of the total currently available. Of the familiars you have collected it tells you their base weight, if they have their familiar specific equipment, and if they have a 100% run associated with them. Also tells you exactly how many tour guide runs you've completed. Use finfo("missing") for a list of familiars you have not collected yet. See aliases in the preceded post.
boolean have_fe(familiar famtocheck)
Returns true if you have the familiar specific equipment for famtocheck. This works without switching out your current familiar.
boolean famequip(string famtoequip)
Equips the famtoequip with their familiar specific equipment. If you don't have it it will obtain it first. Returns true upon successfully equipping famtoequip.
boolean tune(string to_tune)
Tunes your Frumious Bandersnatch to the stat specified in to_tune. Valid arguments for to_tune - moxie, muscle, mysticality, mox, mus, & myst.
boolean feast(familiar famtofeed)
Ruturns true if it successfully gorges famtofeed with the Moveable Feast or if famtofeed is already extremely well-fed. Using feast() without passing a familiar attempts to gorge your currently equipped familiar. Each day, after the Moveable Feast has been used five times the script sets the property "_feastDepleted".
hatter.ash, The Function:
boolean hatter(string command)
Returns true if it successfully gets a buff from the Mad Hatter. For the most part it works the same as the hatter.ash script. For a valid list of command arguments see the main hatter.ash thread.
Sellbot(#1053259) functions:
int[item] sellbot_gifts()
Returns a map of the items currently being sold by Sellbot and their price.
boolean sellbot_buygift(int amount, item gift)
Attempts to buy amount gift from Sellbot. Returns true if it successfully buys gift from Sellbot.
boolean sellbot_buygifts(int[item]gifts)
Attempts to buy the requested amount of each item in gifts from Sellbot. Returns true if it successfully buys from Sellbot.
boolean sellbot_buygifts(boolean[item]gifts)
Attempts to buy one of each item in gifts from Sellbot. Returns true if it successfully buys from Sellbot.
If you find this script useful donations in the form of in-game ninja paraphernalia are always appreciated! Thanks and enjoy the script!
Change log:
09.22.09 - The faminfo() function now also displays which familiars have a 100% run.
10.18.09 - Fixed version tracking. Small tweak in how faminfo() is displayed.
11.19.09 - v1.1 Added special handling of familiars that cannot be trained in the arena.
12.01.09 - v1.2 Trophy training now trains the lightest familiar first. Now uses the valueOfAdventure Mafia setting instead of adv_value.
12.02.09 - v1.3 Fixed some bugs with familiar weight trophy detection & buying. Cleaned up the code.
01.11.10 - v1.4 Fixed a bug that was preventing 100% runs from being parsed correctly, added a tour guide run count to faminfo(), added special handling for bander equipment, added support for the stocking mimic.
06.01.10 - v1.5 Re-factored code, changed prints to vprints, changed aborts to exits, improved familiar equipment obtaining logic, added tune() function, added special handling for various familiars. See details here.
10.02.10 - v1.6 Re-factored code some more, added the feast() function, special handling for the Hipster, Stocking Mimic is no longer calculated or trained when trying to get the trophies, fixed a bug when training arena handicapped familiars.
05.29.11 - v1.7 Re-factored code, Holiday Log support, Sellbot(#1053259) support & functions, hatter() function, gets the Three Days Slow buff from the Mad Hatter, now maximizes familiar xp when combat training.
Training Familiars the Mafia way.
This hodgepodge of ash functions will do a variety of things depending on how you set up the user preferences at the beginning of the script. Hurray for my first published script! Kolmafia ash scripting is the first scripting I've ever done and I'm still fairly unsure of my work, so feedback please! Comments & suggestions on ways to clean up the code and reduce server hits is most welcome!
Requires Zlib.
User Preferences
boolean trainall
string famtotrain
int trainweight
int trainturns
If trainall is true the script will train any of your collected familiars whose base weight is < trainweight for trainturns amount of turns or until all familiars base weight equals trainweight.
If famtotrain is anything other than empty quotation marks the script will train the famtotrain while it's base weight is < trainweight for trainturns amount of turns. Uses mafia's fuzzy matching (i.e. "lep" = "Leprechaun").
boolean trophy_train
boolean buytrophies
If trophy_train is true the script will check the total weight of your terrarium and current familiar weight trophies and then train each familiar one pound until the next trophies weight requirements are met or until trainturns reaches zero. If you don't have enough familiars for the next trophy it will tell you how many more you need to collect before you can obtain that trophy, but it will still attempt to train if you have familiars whose base weight is less then 20 lbs.
If buytrophies is true after the training the script will attempt to buy any familiar weight trophies you qualify for as long as you have enough meat.
boolean arena_tt
boolean arena_wt
string locale
If arena_tt is true the script will train familiars in the arena until either they reach the trainweight or trainturns reaches zero.
If arena_wt is true the script will train familiars in the arena until they reach the trainweight. Please note that if arena_wt is true trainturns is disregarded.
If arena_wt & arena_tt are false the script will train familiars by farming with them at locale until either they reach the trainweight or trainturns reaches zero.
boolean get_fe
If get_fe is true the script will check which of your familiars are missing their familiar specific equipment and then obtain it. It evaluates whether it would be cheaper to buy the equipment or to train in the arena for it.
boolean feed_stocking
If feed_stocking is true any time the script uses your stocking mimic it will try feed it to gain weight. The script will buy the cheapest candy and feed your stocking.
Uses Mafias valueOfAdventure.
The default for this setting is 500. To change it type
set valueOfAdventure=X into the cli, where X is the value you want to set it to.
The valueOfAdventure is the value of one adventure and should be set to the average amount of meat you make per adventure. Obviously the more meat you make the more meat is lost with every adventure not used farming. If you train a familiar 2 times in the arena not only does it cost you 200 meat(100 per arena match), it also costs you the meat you would have made if you had used those adventures elsewhere. This will change from time to time depending on what areas a character has access to, what they are wearing, etc., etc. Anyways, this is factored into the familiar equipment obtaining logic to make sure meat is not wasted by getting the equipment in the arena.
Notable Functions:
void faminfo()
Prints various info about your familiars. It tells you the total base weight of all the familiars in your terrarium, it lists which familiars you have and haven't collected, it tells you how many familiars you've collected out of the total currently available. Of the familiars you have collected it tells you their base weight, if they have their familiar specific equipment, and if they have a 100% run associated with them. Also tells you exactly how many tour guide runs you've completed. Use finfo("missing") for a list of familiars you have not collected yet. See aliases in the preceded post.
boolean have_fe(familiar famtocheck)
Returns true if you have the familiar specific equipment for famtocheck. This works without switching out your current familiar.
boolean famequip(string famtoequip)
Equips the famtoequip with their familiar specific equipment. If you don't have it it will obtain it first. Returns true upon successfully equipping famtoequip.
boolean tune(string to_tune)
Tunes your Frumious Bandersnatch to the stat specified in to_tune. Valid arguments for to_tune - moxie, muscle, mysticality, mox, mus, & myst.
boolean feast(familiar famtofeed)
Ruturns true if it successfully gorges famtofeed with the Moveable Feast or if famtofeed is already extremely well-fed. Using feast() without passing a familiar attempts to gorge your currently equipped familiar. Each day, after the Moveable Feast has been used five times the script sets the property "_feastDepleted".
hatter.ash, The Function:
boolean hatter(string command)
Returns true if it successfully gets a buff from the Mad Hatter. For the most part it works the same as the hatter.ash script. For a valid list of command arguments see the main hatter.ash thread.
Sellbot(#1053259) functions:
int[item] sellbot_gifts()
Returns a map of the items currently being sold by Sellbot and their price.
boolean sellbot_buygift(int amount, item gift)
Attempts to buy amount gift from Sellbot. Returns true if it successfully buys gift from Sellbot.
boolean sellbot_buygifts(int[item]gifts)
Attempts to buy the requested amount of each item in gifts from Sellbot. Returns true if it successfully buys from Sellbot.
boolean sellbot_buygifts(boolean[item]gifts)
Attempts to buy one of each item in gifts from Sellbot. Returns true if it successfully buys from Sellbot.
If you find this script useful donations in the form of in-game ninja paraphernalia are always appreciated! Thanks and enjoy the script!
Change log:
09.22.09 - The faminfo() function now also displays which familiars have a 100% run.
10.18.09 - Fixed version tracking. Small tweak in how faminfo() is displayed.
11.19.09 - v1.1 Added special handling of familiars that cannot be trained in the arena.
12.01.09 - v1.2 Trophy training now trains the lightest familiar first. Now uses the valueOfAdventure Mafia setting instead of adv_value.
12.02.09 - v1.3 Fixed some bugs with familiar weight trophy detection & buying. Cleaned up the code.
01.11.10 - v1.4 Fixed a bug that was preventing 100% runs from being parsed correctly, added a tour guide run count to faminfo(), added special handling for bander equipment, added support for the stocking mimic.
06.01.10 - v1.5 Re-factored code, changed prints to vprints, changed aborts to exits, improved familiar equipment obtaining logic, added tune() function, added special handling for various familiars. See details here.
10.02.10 - v1.6 Re-factored code some more, added the feast() function, special handling for the Hipster, Stocking Mimic is no longer calculated or trained when trying to get the trophies, fixed a bug when training arena handicapped familiars.
05.29.11 - v1.7 Re-factored code, Holiday Log support, Sellbot(#1053259) support & functions, hatter() function, gets the Three Days Slow buff from the Mad Hatter, now maximizes familiar xp when combat training.
Attachments
Last edited: