Icy Peak Meat Farming updated April 29

This script is based on farming the Icy Peak for meat, however very little code in it is directly related to the Icy Peak. Most of it is eating and drinking, and it tries to eat the best possible food for each character class, and drink appropriately too. The script handles TPS drinks, bartender explosion (on each crafting cycle), and nightcaps.

The script will not eat if you are 1 point below falling down drunk. This allows the script to be ran again in the event of an error like running out of elemental. I may have over did my double checking drunkenness, but I always say better safe than sorry.

This script does not yet make foods. That is a future upgrade. It does purchase items from the mall as needed. It has one definite glitch. That being that if you are wearing your filthy hippy disguise, and you don't have a spare set, it will buy a second set.

I still need to do a lot of code cleaning, and optimizing, but it does get the job done.

Edit: Updated eating part. If the character has the pastamastery skill, then this script now makes the needed chow mien instead of buying it. The script will buy the components if needed.

Bartenders and chefs are now made instead of bought if you don't have an extra. Any components you don't have will be bought.

After replacing a chef or bartender, a currently do nothing function is called which in the future will put an items left in inventory from the explosion into the mall at maximum price. It currently contains a bunch of comments as a build a list of explosion items.

Edit2:
*added MP testing for casting of ODE to Booze, 
*ported the SkillCost function (written by myself, renamed and finished by Nightmist) into the script for use while casting Ode To Booze, and later implementation of self buffing.
*Ported a shortened down version of Presto Ragu's RestorerSelector into the script to help scrounge inventory for unused mp restorers. The shortened down version is split into 3 separate functions 2 of which only mimic an array of items the actual RestorerSelector Function now uses a loop/array combination. This is currently used for casting Ode, and will be used later for other self buffing.
*if enough MP restorers cannot be found to cast Ode, 1 Phonics Down is bought and used. On my todo list is including magical mystery juice when possible to the list of items.

Edit3:
*The script now places items which appear in inventory after a chef or bartender explodes into the mall. a few are set for min price, but most are at maximum price.
*A GetKnobBuffs() function has been added to obtain the effects wasabi sinuses, and heavy petting for the duration of adventures. A GoElite() function has been added as a helper function.
*Casting of Leash of Linguini is now handled by the script.
*Another conversion function has been added. effect SkillToEffect(skill buff) Logic will tell you what it does.
*The DoDaily function has been revamped to prevent purchasing and using of knob goblin items if the script needs to be ran a second time. It also prevents changing to the "meatfarm" outfit if all you are running the script for is rollover preparation.
*The very last command in the script is now print("Script Finished"); so that you know that it is done. For some reason this script does not display "script returned value 0" like other scripts do. Before it ended with "putting on outfit custom rollover" No indication of success or fail.
Edit 4:
*Added Mushroom fields to the script for  those who are a muscle sign. Currently set to farm knoll mushrooms. Can easily be changed to any first generation mushroom. If after harvesting the field it finds that it has not gained any of the type of mushroom it is farming it will not plant the field. This is so that the script can be ran over again as needed. If it finds it has gained 1, Then it will plant all of the locations. Harvesting the field only picks full grown mushrooms. The fields farming can be turned off in void main() by commenting out the line:
Code:
if(my_zodiac() == $zodiac[wallaby] || my_zodiac() == $zodiac[vole] || my_zodiac() == $zodiac[mongoose]){DoMushroomFields();}
*Now Creates a file in the same directory as KOLMafia is in which contains some data about what the script accomplished today. There is still more to be added to this part. The filename is based on the characters name. For my character it would be efilnikufecin_data.inf Each time the script is run it will append the new info to the end of the file from the previous day unless it has been deleted. Before going to much further with that I am going to write in an easy way to stop it from writing this file. This script will probably soon have a sister script called settings.ash which will be used to set things like the use of clockwork chef or bartender, what mushrooms to plant, and so on.

Edit 5
*fixed booze drinking errors listed below and 1 that wasn't. The one that wasn't listed was tps drinks when having a drunkenness level of 1 when the script starts (same issue, wrong drinks drunk). I believe drinking is handled properly now.
I just watched the script go through and build a bartender on a character that didn't have advanced cocktailcrafting so I know it works now :)
*added the settings() function at the top of the script. Some settings have been added. Change DoFields = true; to DoFields = false; and the script will not handle the mushroom fields. if someone wanted, they could use a my_name test for using this script in different ways on different characters.
*I noticed some clutter appearing in the kolmafia folder. The .inf files. They are now going into a folder called chardata which will be created in the kolmafia folder. Hopefully that will be helpfull on multi user computers.
*added the function "Boolean IsZodiacStat(stat Test)" for use in determining wether or not you are a muscle sign for the mushroom fields, and determining if you are moxie for the supertinker
*added optional use of clockwork bartender and/or chef. This option can be changed in settings() also added a function to create a clockwork sphere if you are a moxie sign and want to use a clockwork servant. If not a moxie sign, and you don't have a sphere, 1 is bought. This option can be very expensive, and risky. Clockwork spheres seem to spike in price quite often.

Edit6:
Another update:
Made a slight change to the way Ode to Booze purchasing is handled, and added purchasing of empathy, phat loot, polka and elemental.
Based on present settings, it will buy 6000 turns of a buff except ode when that buff drops below 1000 adventures remaining. Prices, buffbot names, and minimum before purchasing more of a buff are stored in a variable so that other users can set buff purchasing up according to their own preferences. Prices are also a variable for quick fixing price changes.

More options:
//ode1 is the amount to send before adventuring
//ode2 is sent after adventuring.
int ode1 = 1;
int ode2 = 11;

//how low the buffs will get before triggering auto purchase.
int minbuff = 1000;
//the amount to send to the buff bot for each buff
int Elemental = 12995;
int Empathy = 7581;
int loot = 6497;
int polka = 2887;
//the preferred sauceror buffer
string SCBuffer = "testudinata";
//preferred Turtle tamer buffer
string TTBuffer = "testudinata";
//preferred accordian thief buffer
string ATBuffer = "testudinata";
 

Attachments

  • IcyPeak.ash
    36.9 KB · Views: 544

Sako

Member
Re: Icy Peak Meat Farming but this one falls into several categories.

Just a slight change I did to the adventuring part, that may be useful for those who have Leash.

Code:
 while(my_adventures() != 0)
 {
  if (have_skill($skill[Leash of Linguini]))
  {
   if (have_effect($effect[Leash of Linguini]) < 1)
   {
    while (my_mp() < 12)
    {
     if(item_amount($item[soda water]) < 1)
     {
      buy(10, $item[soda water]);
     }
     use(1, $item[soda water]);
    }
    use_skill(1, $skill[Leash of Linguini]);
   }
  }
  adventure(1, $location[Icy Peak]);
 }

You can always change the MP restoring method to a better one instead of only using soda waters.
After all, having Leash active means +25% bonus meat! ;)
 
Re: Icy Peak Meat Farming but this one falls into several categories.

Yes Leash needs to be added along with empathy, polka, fat loot, and elemental and/or astral shell.

There are a lot of little addaitions like that in the works. A key thing to note is a shortened version of Presto Ragu's restorer_selecter has been imbedded into the code. If function calls to it are written right, it will scrounge inventory for MP restorers, and use them. The next step would be to buy a MP restorer if restorer_selecter effectively returns that you do not have any restorers left.

There is also the plans for Polka of plenty, and fat loot being cast. Also in my future plans is purchasing of +meat and + item drop skills if they haven't already been purchased. This will include finishing the guild quest if needed. Also in the works is a matching hp/mp auto restore script for kolmafia to use on the fly. Yes I mean a restore script that will be set as the MP restore script, and the HP script both. 1 script, less clutter on my hard drive. I which kolmafia could have just a function in the script it is currently working with set as the method of MP and HP restoration. 1 script that does it all.

This is my script written for handling "babysitting" of other players high level accounts while they are unable to use their adventures on their own. This means that there is further plans for this script. I plan to remove the use of custom outfits, and instead equip the items 1 at a time because I want to do as little manual interaction with the accounts as possible. Also in my plans is to farm a different area if the players character is not high enough level or does not have high enough stats for this script to work effectively as-is. Presently I am manually doing buffs, and ramping the characters up to 5000+ adv of the needed buffs for long term babysitting. Short term I just multiply the number of days by 250, and that's how many adv of the skill I cast (or buy) give or take a few hundred.

My reason for re-writing Presto Ragu's restorer_selecter function was simply due to the fact that this is a very long script to begin with, and any methods of shortening it should be applied. My version of restorer_selecter has the exact same output as the original function posted by Presto Ragu, and is called in the exact same way.
 

Sako

Member
Re: Icy Peak Meat Farming but this one falls into several categories.

I see. I just added Leash because it's a self-buff; I usually get the other effects from Testudinata.
Anyway, I'm really looking forward to the final version of this script. Keep up the good work.
 

cold_blu_ice

New member
Ok, yeah I don't knowif you got my personal message or not, but I need help with running your script. Each time I try to run it I get a "you can't wear that outfit" message and it holds up stuff. HELLLLLLLLLLLLLLLP!!!!
 

Nightmist

Member
[quote author=cold_blu_ice link=topic=52.msg550#msg550 date=1146379747]
Ok, yeah I don't knowif you got my personal message or not, but I need help with running your script. Each time I try to run it I get a "you can't wear that outfit" message and it holds up stuff. HELLLLLLLLLLLLLLLP!!!!
[/quote]

Do you have the outfits listed below?
filthy hippy disguise
knob goblin elite guard uniform

And custom outfits with the names?
meatfarm
rollover
 

Sako

Member
To Efil:

I think there's a problem in the drinkIt methods. I think it should be
Code:
void DBDrinkIt(item fruit, item bottle, item base, item mixer, item final)
{
 while(my_inebriety() <= (MyMaxInebriety() -4))
 {
  if(my_inebriety() > (MyMaxInebriety() -4)) 
   break;
  DBDrinking(fruit, bottle, base, mixer, final);
 }
}
Note the <= on the second line, instead of your <.
In fact, if I have liver and no TPS, your script will drink 4 DB drinks, getting me to 16 drunkness, and then skip the DrinkViaLevel1() method, going straight to DrinkViaLowLevelBooze() which will buy me 3 shots, getting me to 19 drunkness. If you add the =, the DrinkViaLevel1() method would not be ignored, and bring me to 19 drunkness using a Whiskey Sour/Wine Spritzer/Strawberry Daiquiri.
 

Havanacus

New member
Their should be a list of requirements here so we are sure of what kind of preparations need to be made before using the script... also, some sort of recommended meat requirement because you have some commands spending meat...
 
[quote author=Havanacus link=topic=52.msg564#msg564 date=1146426506]
Their should be a list of requirements here so we are sure of what kind of preparations need to be made before using the script... also, some sort of recommended meat requirement because you have some commands spending meat...
[/quote]

Simple enough:
On normal days when no servant explodes, the script shouldn't use more than 30K meat. Days when the chef and/or bartender explode It will require considerably more. I cannot be certain how much meat will be used because the market is always fluctuating.

An outfit for doing the actual farming of the icy peak is required. This outfit must be saved as a custom outfit called "meatfarm" when you are first able to farm the icy peak this outfit may need to include some stat boosting gear. Once your stats are high enough, it's +meat drop gear all the way.

An outfit to wear for rollover is required. It must be named "rollover". It will include your +adventure gear. All other equipment needs (hippy disguise, and elite guard) are handled by the script. If you don't have them the script will buy them.

Ran into problems running the script like "desired purchase quantity not reached"?
If it happened while attempting to eat, then manually eat, then drink to at least 1 drunkenness. Re-run the script. If it happens any other time, re-run the script. If it repeats, then manually buy what it wanted.

Presently, the script handles Leash, but all other buffs must be handled manually. I didn't write buying of buffs into the scripts because the prices keep changing.

I am starting to see a need for some changeable settings in this script. The next version I post will have some with preset defaults. Those settings will be changed in a function called void Settings() which will be at the top of the script. Currently there are 2 settings:


  • [li]filename = my_name() + "_data.inf";[/li]
    [li]MushroomToFarm = $item[knoll mushroom]; [/li]

They can be changed in void InitializeVars() at the top of the script.

filename is the name of the file which the script will write it's data to.
MushroomToFarm is the type of mushroom the script will plant in the mushroom fields if you are a muscle sign. The next version will have a setting to stop the script from handling the mushroom fields.
To start the mushroom fields part, plant the mushrooms you want to farm (you must manually plant to start the cycle), and put the correct type into the MushroomToFarm setting. Currently this script only handles 1st generation mushrooms. Default is knoll. These seem to me to be the most profitable 1st generation mushroom to farm. If this script is ran more than once, it will find nothing but spores in the mushroom field, and will not pick them, or try to plant new spores.

One of the biggest desires I have for this script is for it to be able to be ran again in the event of an error, and just pick up where it left off. I think it remains that way.
 
[quote author=Sako link=topic=52.msg553#msg553 date=1146393852]
To Efil:

I think there's a problem in the drinkIt methods. I think it should be
Code:
void DBDrinkIt(item fruit, item bottle, item base, item mixer, item final)
{
  while(my_inebriety() <= (MyMaxInebriety() -4))
  {
    if(my_inebriety() > (MyMaxInebriety() -4)) 
      break;
    DBDrinking(fruit, bottle, base, mixer, final);
  }
}
Note the <= on the second line, instead of your <.
In fact, if I have liver and no TPS, your script will drink 4 DB drinks, getting me to 16 drunkness, and then skip the DrinkViaLevel1() method, going straight to DrinkViaLowLevelBooze() which will buy me 3 shots, getting me to 19 drunkness. If you add the =, the DrinkViaLevel1() method would not be ignored, and bring me to 19 drunkness using a Whiskey Sour/Wine Spritzer/Strawberry Daiquiri.
[/quote]

I had been studying that issue, and had noticed it, but the answer totally eluded me. DrinkViaLowLevelBooze() was intended for TPS owners, and the script should only ever drink 1 of those drinks a day if liver is in the skills list. DrinkViaLevel1() was intended for those using disco bandit drinks as you have figured out. Making revisions soon.
 
Watching this script run in version 7.2, here's what I saw:

Begining 320 adventures (McLarge: Icy Peak)
No Autorestore settings found.
logging out.

Loading the character into the gcli revealed kolmafia had lost my MP auto-restoration information.

This very issue is why I wrote so many checks into the script. The character had 320 adventures, and would have been falling down drunk if I hadn't put those checks in place. I fixed the missing MP auto restore data, then re-ran the script, and all ran perfectly.
Now If I could just remember to remember to run that script daily. :)
 
[quote author=efilnikufecin link=topic=52.msg628#msg628 date=1146638499]
Now If I could just remember to remember to run that script daily. :)
[/quote]

The "Master of all Batch Files" hasn't figured out a way to do that yet? :p :p
 
[quote author=Presto Ragu link=topic=52.msg640#msg640 date=1146675327]
The "Master of all Batch Files" hasn't figured out a way to do that yet?  :p :p
[/quote] Ha ha, I know how to batch it, just I keep forgetting to run the batch file. I know I could use task scheduler, but that would mean re-enabling the service...something I prefer not to do.
 

arrggg

Member
[quote author=efilnikufecin link=topic=52.msg642#msg642 date=1146687862]
Ha ha, I know how to batch it, just I keep forgetting to run the batch file. I know I could use task scheduler, but that would mean re-enabling the service...something I prefer not to do.
[/quote]
http://malektips.com/xp_dos_0002.html
shows how you can add in a sleep function into a bat file.
just have the bat file run the script, sleep 24hrs, and call itself
 
[quote author=arrggg link=topic=52.msg648#msg648 date=1146693530]
http://malektips.com/xp_dos_0002.html
shows how you can add in a sleep function into a bat file.
just have the bat file run the script, sleep 24hrs, and call itself
[/quote]
A goto command would avoid the "calling itself" do you know what happens when a batch file repeatedly calls itself? If not, write one to do it, and watch for a while.

Tossing a sleep command in there would be the same as running task scheduler. That extra un-needed program would be running. No, wait, it would be worse...there would be a button in the task bar. Ugggh!
 

macman104

Member
[quote author=arrggg link=topic=52.msg648#msg648 date=1146693530]
http://malektips.com/xp_dos_0002.html
shows how you can add in a sleep function into a bat file.
just have the bat file run the script, sleep 24hrs, and call itself
[/quote][quote author=efilnikufecin link=topic=52.msg653#msg653 date=1146695052]
A goto command would avoid the "calling itself" do you know what happens when a batch file repeatedly calls itself? If not, write one to do it, and watch for a while.

Tossing a sleep command in there would be the same as running task scheduler. That extra un-needed program would be running. No, wait, it would be worse...there would be a button in the task bar. Ugggh!
[/quote]Pwnd by the Batchmaster! Heh, I kid :D
 
[quote author=efilnikufecin link=topic=52.msg653#msg653 date=1146695052]
No, wait, it would be worse...there would be a button in the task bar. Ugggh!
[/quote]


Ahhhh.... A minimalist I see...

Then why is your screen name so gnikcuf long? :p :p
 

Nightmist

Member
[quote author=efilnikufecin link=topic=52.msg653#msg653 date=1146695052]
No, wait, it would be worse...there would be a button in the task bar. Ugggh!
[/quote]
Heh totally agree with you there.
 
[quote author=Alexander Daychilde link=topic=52.msg700#msg700 date=1146844486]
100 Daychilde points.
[/quote]


One of these days I am going to have to find out what Daychilde points do...

I seem to be the only one collecting them, and I am up to 125 - if I recall correctly...

I wonder if this is a good thing, or a bad thing. :p
 
I have recieved 3 in game PMs/kmails asking me to write support in for the new DB booze. I cannot do this until kolmafia has been rewritten to support the same. kolmafia cannot fully be rewritten to handle them until the various boozes are discovered, and the information about them becomes available. Once this happens, then I will be waiting a bit for mall prices to stabilize. Then i will see if it is feasible, and if so, exactly how it will need to be written. It may start as a DB only option, or all classes may use them.

Sorry for the thread bump, I just need those who check to be able to see there is new info here.
 
Top