Harvest – A highly customisable farming script

fronobulax

Developer
Staff member
fronobulax- sorry did not mean to disparage eat drink. yours is another script that has been awesome over the years. I was poking around in the files trying to find where in the scripts where that file then tells eat drink to reach 15 spleen. if that can get turned off i suspect the spleen nerf will be a minor bump

No apology needed. When the spleen nerf happened there were a whole lot of people who thought the problem was with eatDrink and not with the call to eatDrink. I thought the issue had been dealt with but maybe it wasn't Harvest.

Lines 1095-1099 in Harvest

Code:
		if(my_fullness() < fullness_limit()-cookie_room || my_inebriety() < inebriety_limit() || my_spleen_use() < spleen_limit()) {
			print(CONSUME_SCRIPT +" failed to fill your organs completely", "red");
			print("Desired fullness: " + (fullness_limit()-cookie_room) + " food " + inebriety_limit() + " drunk " + spleen_limit() + " spleen", "red");
			print("Attained fullness: " + my_fullness() + " food " + my_inebriety() + " drunk " + my_spleen_use() + " spleen", "red");
		}

If you delete the last clause "|| my_spleen_use() < spleen_limit()" that should stop Harvest from aborting because the spleen was not filled.

Line 354 also uses spleen_limit() but I'm not sure the test has any practical effect.
 

Tom Sawyer

Member
Fronbulax. That did not work but I believe the line 354 (not sure how to make word show line numbers) tinkering did. Took out the spleen use vs spleen limit - This section:

Code:
boolean finished_farming() {
	/* Returns true if you have finished farming for the day, or false if you are still 
	able to farm */
	announce(2, "finished_farming");
	
	boolean result;
	if(my_inebriety() > inebriety_limit())
		result = true;
	else if (my_fullness() < fullness_limit()-cookie_room || my_inebriety() < inebriety_limit() || my_spleen_use() < spleen_limit())
			result = false;
	else if (my_adventures() > 0)
		result = false;
	else
		result = true;	
	
	announce(3, result);
	
	return result;
	}

When I run it tonight after rollover if it does a normal complete run without failing it will have passed the acid test. Thanks again!
 
Last edited by a moderator:

deseano

New member
I think I finally got this working, but I am getting stuck at the Buff Items. I have a sauceror that is why I am a bit baffled at this:

"You need 1 more Rock and Roll Legend to continue."

I already found the post where you mentioned that: "
Jun 2011
Posts
92
Default
I just pushed an update out that should disable the Mace of the Tortoise/Rock and Roll Legend check if you have an Ouija Board, Ouija Board and an antique accordion (both purchasable on non-ascended characters), so if you get those it shouldn't complain about the Mace any more. Let me know if you have any more issues!"

I have both the Ouija Board, Ouija Board and an antique accordion in my inventory. When I manually equip the accordion, I cannot equip the Board because it is two handed. When I just equip the Board I get the "You need 1 more Mace of the Tortoise to continue" Warning again. any help would be greatly appreciated.
 

deseano

New member
Hmm, that should be fixed. Are you using the most recent version of the script?

I am, I did an update right before I posted (KOLmafia is also set to autoupdate). I did not play for a few days and when I started it this morning, it just worked again. That is so odd. I cannot see an update to the script but I did change some gear this morning before I started Harvest. I might have an a combination that broke the script at that point, sorry I did not keep track of what I had equipped overall. But the script did change to the items it needed on its own this morning, familiar, weapons etc.

I just had a look at the script itself:

Written by Banana Lord with much help from
the KoL Mafia community

\***********************************************/

script "Harvest.ash";
notify Banana Lord;
import <EatDrink.ash>;
import <canadv.ash>;
import <OCD Inventory Control.ash>;
import <zlib.ash>;

check_version("Harvest", "Harvest", "2.0.9", 7015);

I am not sure if there were updates between my post and today though.


On a side note, I tried to figure out why the script always takes my meat and goes down to 100000 meat when it starts because it puts away meat. I did change the value of adventures and lowered the limit to 15000 in the eatdrink script as I know it is eatdrink, not Harvest that does the spending. Could you point me in the right direction?
 

coandco

Member
The "meat going down to 100000" thing is because Harvest keeps a budget and closets the rest of your meat before spending anything. The amount Harvest is allowed to spend is stored in the "har_gen_budget" zlib variable; to access it, type "zlib har_gen_budget" into KoLMafia's graphical CLI. It'll print out the current value and instructions for how to change it.
 

deseano

New member
The "meat going down to 100000" thing is because Harvest keeps a budget and closets the rest of your meat before spending anything. The amount Harvest is allowed to spend is stored in the "har_gen_budget" zlib variable; to access it, type "zlib har_gen_budget" into KoLMafia's graphical CLI. It'll print out the current value and instructions for how to change it.

Thank you, I can take it from here. I triple checked the Harvest Script since my last comment and I was not able to reproduce the issue I originally mentioned. So odd. Thank you kindly for your help and the amazing work you do here.
 

philmasterplus

Active member
Harvest uses Bale's OCD Inventory Control. Unfortunately, Bale has been inactive for almost a year. There is a community-maintained fork named OCD-Cleanup in active development.

Because Harvest still uses OCD Inventory Control, it cannot receive any updates made to OCD-Cleanup.

Furthermore, the original and the fork can clash in unexpected ways. @Rinn and @Magus_Prime have reported issues when trying to use OCD-Control with Harvest. While that particular issue has been resolved, other problems may arise in the future.

I therefore propose that we use OCD-Cleanup instead of OCD Inventory Control.

When I asked ioeth (who I assume is @Banana Lord), he kindly gave me admin access to the SourceForge.net repository for Harvest.

However, since this affects everyone using Harvest, I would like to ask for their opinions first. Switch to OCD-Control--yay or nay?

A tentative timeline:
  • Collect and review user opinions for 2 weeks (~Jan 13 2021).
  • If the consensus is "yay", move to OCD-Cleanup.
    • Due to the way KoLmafia works, users will have to manually uninstall OCD Inventory Control.
 

philmasterplus

Active member
Fixed in r35.

Btw, I didn't have time to make a switch to OCD-Cleanup. Originally, I wanted to allow users to choose between OCD Inventory Control and OCD-Cleanup. Unfortunately, this won't be possible because
  1. ASH doesn't support conditional/dynamic imports, so we can't choose which to import at runtime.
  2. We could run OCD Inventory Control via cli_execute(), but it would prevent us from passing OCDdata_HAR_Default.txt to OCD Inventory Control.
Also, OCD-Cleanup is undergoing refactorings and may be unstable for the moment, so I'm still hesitant to make the switch.
 

CTBC

New member
I keep running into an error "Attempt to access missing script setting 'valueOfAdventure'!" and I'm not sure what I'm missing
 

MCroft

Developer
Staff member
I keep running into an error "Attempt to access missing script setting 'valueOfAdventure'!" and I'm not sure what I'm missing
It's a KoLmafia setting. The default is 500.


> prefref valueOf

NameValueDefaultScope
valueOfAdventure500500user
valueOfInventory0.01.8user
valueOfStill00user
valueOfTome00user

So, if you don't have it, then your prefs have an issue.

And if you do have it, the script isn't reading them, somehow.
 
All I really want is for Mafia to automatically use dolphin whistles for valuable items. All the rest of the stuff this script does, I don't care about, and some of it I don't even want it to do. What's the simplest way to get just the dolphin functionality?
 
Yeah, I saw BBB as well. I guess my main problem is that I'm pretty dense when it comes to scripting/coding language; I can follow directions to install stuff, but I don't know how to toggle specific functionalities on or off.
 
Top