Harvest – A highly customisable farming script

I personally would like the choice of what the failure() does, set by a variable at some point. Also, exit; when Harvest runs by itself simply ends the script, so the standard user will not notice the difference ordinarily.

In the most ideal world Harvest.ash would output how it ended programatically so other ASHs could react.
 
Since it's a SVN script, you can change your own copy of it and svn sync it without having other people's copy affected. But for the average user who will need to manually react to why the script didn't adventure at all and decided to just do... nothing (line 992) or if you've broken your consumption script and it doesn't properly get you prepared or overdrunk (line 1040) or if it doesn't fill you up fully because you set it wrong and so your adventuring will be suboptimal (line 1095), or if you selected an invalid/unknown hatter buff (line 1205)...

For your personal case, changing abort to print/exit might work well if you don't care about fixing the problem that made the script break. For the average user, they probably want to fix what is broken, which means they need to know that it broke. The red screen helps to prompt their noticing.
 
I just committed an update that records _har_endmeat before running OCD. The problem was that Harvest was double-counting any OCD autosale meat. This isn't usually much of an issue, but it became very apparent when I modified my personal copy of Harvest to run my volcano mining script. Since autosale (of 1,970 carat gold) is the majority of the output of that, Harvest was inflating my "meat gained for the day" by ridiculous amounts.
 
For those who are interested, I made a between-combat script for Harvest that will automatically use the free ghost fights given to you by your protonic accelerator pack. It assumes you have a custom combat script called "Ghostbusting" that uses the appropriate "Shoot Ghost" and "Trap Ghost" skills.

Code:
if(get_property("questPAGhost") == "started") {
	print("Ghost quest active", "blue");
	string ghostLocation = get_property("ghostLocation");
	print(ghostLocation, "blue");
	string old_ccs = get_property("customCombatScript");
	set_property("customCombatScript", "Ghostbusting");
	adv1(to_location(ghostLocation), -1, "");
	set_property("customCombatScript", old_ccs);
}

Just save that in your "scripts" directory and configure Harvest.ash to use it as a between-combat script, and you'll automatically bust ghosts while farming.
 
My script also changes combat scripts, but to be safe, I use try/finally to make sure it changes back if there is an abort. I also check to make sure I'm actually wearing the protonic accelerator.
Code:
        if (get_property("questPAGhost") == "started") {
            if (have_equipped($item[protonic accelerator pack])) {
                try {
                    string tmp = get_property("customCombatScript");
                    set_property("customCombatScript", "ghost");
                    print("Fighting ghost");
                    adv1(get_property("ghostLocation").to_location(), -1, "");
                }
                finally {
                    set_property("customCombatScript", tmp);
                }
            }
        }
You might also get some ideas from Bale's version, which makes sure you use the right equipment (or start the quest) to access the zone.
 
Last edited:
Did Harvest.ash break recently?

So I updated to the latest KoL Mafia svn build the other day (previous version I was on was probably a 2 weeks old build or so) and when I played KoL last night, I noticed that Harvest.ash would get stuck at the start saying (sorry I don't remember the exact wording) Consumption Script not defined, or some such, I had to run EatDrink manually when normally Harvest would just deal with this. Normally I just run Harvest, it does its thing, deposits, feeds me up and buffs me, etc. then I run a Meat farming script until I'm out of adventures, then after Harvest fills me up and gets me ready for rollover. Sorry if I'm missing some much needed/required info for debugging this, but I don't have access right now and my memory if fuzzy, but I can check again later after rollover tonight if the problem still persists.
 
So I updated to the latest KoL Mafia svn build the other day (previous version I was on was probably a 2 weeks old build or so) and when I played KoL last night, I noticed that Harvest.ash would get stuck at the start saying (sorry I don't remember the exact wording) Consumption Script not defined, or some such, I had to run EatDrink manually when normally Harvest would just deal with this. Normally I just run Harvest, it does its thing, deposits, feeds me up and buffs me, etc. then I run a Meat farming script until I'm out of adventures, then after Harvest fills me up and gets me ready for rollover. Sorry if I'm missing some much needed/required info for debugging this, but I don't have access right now and my memory if fuzzy, but I can check again later after rollover tonight if the problem still persists.

Yup, I'm seeing the same behavior. It appears to be at least partially due to the new ZLib version that just came out, which changed the way settings are stored. I'm working with the author of ZLib to figure out a fix.
 
Okay, I've now updated Harvest to use the new getvar() ZLib paradigm. For some reason, all of my Harvest settings were lost once I did the update, but once I re-set them all back up, they appear to be stable once more and have persisted across KoLMafia restarts and rollover. Once you update your copy of the script, you should be able to use Harvest once more.
 
Last edited:
Great, thanks for your work. I'll have to test this when rollever happens. /crosses figers

EDIT: So things look like they are back to normal for me, but I did notice that when finished I looked at the logs and it said something like "Could not sell, inventory data is Corrupt, hope you didn't lose anything." again something about vars_ not being setup correctly.

This seems related to Bales OCD Inventory control, I don't remember seeing this message before, but honestly I never really looked either so this might just have always been the case as I'm now looking more closely at things since the recent breakage.
 
Last edited:
Simple question: how do I run without a consume script? "none" is not a valid string.

Better yet, how do I run without filling my spleen? EatDrink.ash doesn't care, but Harvest.ash doesn't like it.

Thanks!

Also...

Makes sure you have buffing items such as the Rock and Roll Legend and the Mace of the Tortoise.

By "makes sure", you mean won't run unless you've ascended as an AT and TT, and within the last couple years. Sigh.
 
Last edited:
That second part is not true: anyone can buy an antique accordion from uncle P's and craft a ouija board, ouija board with items from the mall. That said, I don't know how the script checks, since it's a really old one, so I don't know if those would satisfy the script.

(but post itself is from 2011, so I'm not sure why you are complaining about outdated items being called out.)
 
That second part is not true: anyone can buy an antique accordion from uncle P's and craft a ouija board, ouija board with items from the mall. That said, I don't know how the script checks, since it's a really old one, so I don't know if those would satisfy the script.

(but post itself is from 2011, so I'm not sure why you are complaining about outdated items being called out.)

It doesn't matter that the post itself is from 2011, as the latest version of the script still very specifically will not farm unless you have those two items. Not an antique accordion and ouija board, but the Mace and Legend.

If it's not clear, I'm complaining because the script will not run. That seems to be a valid thing to comment on, no?

The check only seems to occur before normal farming, as the script can farm ducks just fine.
 
By "makes sure", you mean won't run unless you've ascended as an AT and TT, and within the last couple years. Sigh.
Seriously? This is a problem?

Yeah, in 2015, those items became untradeable,

I guess a 5-year-old script might want to assume that you'd simply buy a 5K item from the mall, if you hadn't made one of your own, but I guess I can't understand why somebody would whine because they chose to not ascend and acquire an important item after it became an "ascension only" items.

Suck up and do it and stop whining.

Alternatively, modify the script - whose source is completely open for you to modify to your taste! - to behave the way you prefer it to behave.

In either case, shut the fuck up with your whining about how a freely published script doesn't behave the way YOU want it to behave, given zero effort - and zero contribution - on your part.

Either ascend and get an item which any normal person will have acquired, or edit the script.

Hint: I have 157 Rock and Roll Legends in storage, as well as 62 Maces of the Tortoise and 13 5-Alarm Saucepans.

All I (and you) REALLY need is one of each.

It's too much trouble for you to get ONE of each to last the entire rest of your KoL career?

Really?

That said, I don't see why a script will REQUIRE you to have an item which will halve your buff costs You'd be an idiot NOT to have such items, but a script should not require it.

Which is where the "you have complete control over the open source script" comes in.
 
It doesn't matter that the post itself is from 2011, as the latest version of the script still very specifically will not farm unless you have those two items.
Of course it matters that the script was last updated in 2011.

Things in the game have changed in the six years since the script was last updated.

Either find a more recent script, or change this six-year-old script to reflect the current game.

Please stop complaining that a script last updated six-years-ago does not work the way you you'd like it to behave, when KoL itself has changed and invalidated the assumptions of the script, which were completely reasonable six years ago, when the script was last updated.
 
Please get a fucking grip. My first post was a question and my second was a response to a statement that was factually incorrect. I had no idea when the script was actually last updated, given the last response to this thread was a few months ago and SVN reports a build but not a date through the mafia interface.

But fuck yeah, use that shit as an excuse to come unhinged! Was it fun for you?
 
Yeah, it gets irregularly updated by those of us with commit access when an actual bug gets posted. Whining by non-ascenders who don't want to edit code doesn't generally qualify as a bug though. :)
 
Been searching for an answer but can't find one. When EatDrink fails to fill my spleen, Harvest just stops. Any suggestions for how to get around this?
 
Been searching for an answer but can't find one. When EatDrink fails to fill my spleen, Harvest just stops. Any suggestions for how to get around this?

I've been seeing the same thing recently, but with booze -- I think it's due to the mime army shotglass throwing EatDrink's accounting off. I haven't gotten around to digging into the code to fix it yet because simply running Harvest again after EatDrink almost fills my liver is a valid workaround for that.

Do the logs for EatDrink give you any indication of why it might be failing to fill your spleen?

If all else fails, the line that's causing Harvest.ash to stop reads as follows:
Code:
failure(CONSUME_SCRIPT +" failed to fill your organs completely");

Commenting out that line (by putting a // at the beginning) will remove the check and allow Harvest.ash to blithely continue on its way even if you aren't completely full after EatDrink.
 
Last edited:
Back
Top