Harvest – A highly customisable farming script

First, your call to eatdrink.ash fails on Linux. Author of that script calls it EatDrink.ash, and case is significant in Unices
I'll change the default setting for that, but you can easily adjust the case yourself from the settings table in the relay script.

Second, running the script yields an error message as follows:
I've never seen that issue before, and no-one else seems to have run into it. Could you download a new version of Harvest.ash (just in case)? Are you using the latest version of OCD? Could it be another unexpected interaction with Linux (I have no experience with that OS I'm afraid)? Do you get that error every time you run the script? If so set Verbosity to 3 (from the relay script), run the script again and post the relevant CLI output here.
 
Last edited:
Err, okay. I tried this morning to replicate the failure, and simply couldn't. Sorry about that, Banana Lord.
 
@Peter: If you give me some CLI output (with verbosity set to 3) I'll look into that when I get a chance.

@Dan: No problem, I'm just happy it's working :-) If it does happen again drop me a line.
 
Is there a way to tell the script not to abort when the cookie counter runs out? I don't really care about it and I'd rather the script continue running than having to have me restart it every time the counter runs out. I thought telling it that I didn't want it to farm semirares would solve the problem but it didn't.
 
Options:
1) Don't eat cookies if you don't want it to abort when the cookie counter wears off.
2) Set a dummy counterScript that does nothing, at least for the Fortune Cookie counter.
3) Have your counterScript automatically farm semirares.
4) Manually wipe the Fortune Cookie counter.
 
Is there a way to tell the script not to abort when the cookie counter runs out? I don't really care about it and I'd rather the script continue running than having to have me restart it every time the counter runs out. I thought telling it that I didn't want it to farm semirares would solve the problem but it didn't.

That should prevent it from eating a cookie, but if a cookie was eaten then this script has nothing to do with stopping (or not) to get it. If you use CounterChecker (linked in the first post) then you can get semi-rares without any more effort than running this script.
 
Actually Morwen, I think there may be something else going on here. I keep getting abort errors around the SR counter, but I don't think it's anything to do with Harvest... I'll post back here if I discover anything.

EDIT: Oh, well that was easy. If your problem is anything like mine then updating CounterChecker.ash will fix it. The transfunctioner update broke CounterChecker's handling of the 8-bit realm semi-rare, but because CounterChecker doesn't get called until well after you run Harvest it's highly likely that you won't be looking at mafia when it prompts you to update the script.
 
If you don't have a counterchecker I think Mafia aborts when your SR counters are up since you might want to do soemthing else then. So if that's the case here that is a probable cause at least...
 
Hrm. I still have no idea why it's coming up. I updated counterchecker but that didn't seem to help and I can't for the life of me figure out how to get it to stop counting for semirares. I have everything set to NOT eat cookies, but I still get a message every 60-100 adventures or so saying that the counter stopped. I didn't know if there was an option in the harvest script for it, since there was for neocow (although there wasn't one in the vars file for harvest, so it was more of a double check kind of thing). Blahh. I'm just going to continue using neocow for now until I figure it out. I want it for the BHH anyway.
 
Could you post the CLI output from when it aborts? And can you tell if the script's eating a cookie or not? It should be in your session log just before EatDrink runs.
 
If anyone's interested, here's a stable beta version of Harvest updated with bountyhunting capabilities. Included are a few other minor tweaks and improvements I've been working on. As always comments are greatly appreciated (especially if they are of the "it works!!" variety :p). I'll release it properly in a couple of days if it continues to run smoothly.
 

Attachments

Been using a while now, great script.

One tiny item - would it be possible to specify an outfit to wear while eating&drinking? Just that mafia has me set up nicely with 100s of turns of 3 AT buffs, so extra AT song needs equipment equipping.
 
Glad you're finding it useful :)

By "mafia has me set up nicely with 100s of turns of 3 AT buffs" I take it you mean that you have a lot of turns of AT buffs that you'd rather not shrug just to run ode while you eat/drink/spleen, is that correct? How about I have the script check to see if you have any items that could raise your song cap (thus allowing you to run ode without shrugging anything) and equip one of those while consuming and then switch back to your farming outfit? There aren't many to keep track of so it wouldn't be terribly difficult to do.

EDIT: On the basis that that's a good idea even if that wasn't what you meant I have added such a feature. I don't have any AT song-cap-raising items so I can't test the code as thoroughly as I would like, but I'll give it a run through tomorrow and all going well will release the next update (yay bountyhunting!)
 
Last edited:
Since you cannot test this yourself I'll offer a tip. I'm not sure how you implemented this, but there is a trick to it. I found that it didn't work right if I tried to maximize for "Four Songs, Additional Song" on the theory that I might have either or both of those. (Though I cannot remember at the moment exactly what caused the malfunction.) I ended up having to do them in sequence like this:

PHP:
if(current_at() >= max_at()) {
if(!boolean_modifier("Four Songs"))
	maximize("Four Songs -tie", false);
if(current_at() >= max_at() && !boolean_modifier("Additional Song"))
	maximize("Additional Song -tie", false);
}
 
Thanks for the tip Bale. I didn't actually do it like that, instead I made use of some existing code (max_at_songs and num_at_songs) along with some additional logic to a) find an accessory slot that isn't occupied by an item that raises your song cap and then b) equip an item in that slot which does increase it.

PHP:
void equip_song_raiser()
	{
	announce(2, "equip_song_raiser");
	
	load_at_buff_data();
	if(num_at_songs() == max_at_songs())
		{
		outfit(FARMING_OUTFIT);
		
		string [item] song_raisers;
		song_raisers [$item[plexiglass pendant]] = "";
		song_raisers [$item[brimstone beret]] = "";
		song_raisers [$item[super-sweet boom box]] = "";
		
		slot the_slot;
		foreach space in $slots[acc1, acc2, acc3] // Find a suitable slot to equip the song_raiser in
			{
			if(space == $slot[none]) // If the slot's empty we can just use that
				the_slot = space;
			
			if(the_slot == $slot[none]) // Make sure we haven't already found a suitable slot
				{
				if(song_raisers contains equipped_item(space)) // If the item is a song_raiser itself don't unequip it
					announce(3, "That item ("+ equipped_item(space).to_string() +") is a song_raiser so it was not unequipped");
				else
					{
					the_slot = space;
					announce(3, "the_slot: "+ the_slot.to_string());
					equip(the_slot, $item[none]);
					}
				}
			}
		
		item song_raiser;
		foreach gear in song_raisers
			{
			if(!have_equipped(gear) && item_amount(gear) > 0)
				song_raiser = gear; // We don't really care WHICH song_raiser we equip, as long as we equip one
			}
		announce(3, "song_raiser: "+ song_raiser);
		
		if(my_class() == $class[accordion thief] && item_amount($item[La Hebilla del Cinturon de Lopez]) > 0)
			song_raiser = $item[La Hebilla del Cinturon de Lopez];
		
		if(song_raiser != $item[none])
			equip(the_slot, song_raiser);
		else
			announce(3, "No item could be equipped to raise your AT song cap");
		}
	else
		announce(3, "No item was equipped because you already have room for another AT song");
	
	clear(at_buffs);
	}

It's not a terribly elegant function, but I'm fairly sure it'll work reliably.
 
My code is shorter and doesn't need to be updated when KoL adds more items to boost AT song capacity.

:P
 
That is the benefit of simplicity. Since KoLmafia has maximize() it seems like a waste of programmer's time to check for all possible equipment.
 
Back
Top