Harvest – A highly customisable farming script

Banana Lord

Member
Check the name of the CCS you're using to farm with (mafia>Adventure>Custom Combat) and make sure it's exactly the same as the name of the CCS you have set in the Harvest relay script (under General, right at the top). That error just means that you've told Harvest to use a CCS you don't have.
 

hello

New member
Hey, uhm, sorry for being a noob but how do I run the script? I'm at the part where it says this:

'Initialisation complete
Script setup complete. You can now configure the script's options with the relay script
Remember to click the Save button (bottom left) when you're done'

Again, sorry for being a noob
 

Tom Sawyer

Member
Banana Lord: Really like the power and ease of your script. Having run both mine and yours it shows how polished yours has become. It even was making more meat doing tricks I had not thought of so kudos on a great script.

However it still does not seem to want make use of the still. I have accepted the regular drinks are more economical than supercocks but I thought it would auto use the still to make tonic water to sell or such.

I went poking around in yours and found where Bale had lent you the code which is very similar to the one Izchak used which I too "borrowed" :)

You said there was no choice button to allow or disallow use of the still so it is perplexing me. The script does great, runs Eat-Drink, slaps on my meat finding gear, runs the castle, then it completes and reports how much was made ect ect. But the still is never used. I figured it could at least make tonic water which I can squirrel away or sell.

Still a great script!
 

Banana Lord

Member
@hello: You're most of the way there. Have you put relay_Harvest.ash in your relay folder? If so, just open the relay browser from mafia (map icon at the top left, it'll open KoL in your browser) then choose "Harvest" from the drop down box at the top right, just to the left of the chat pane.

@Tom: I'm now officially on holiday so I'll look into that properly when I get a chance (today or tomorrow). It's almost time to start work on that update I've been promising too :) The reason I didn't put a setting on for the Still is that that code runs right at the end of your day, by which time I reason that if you have spare Still there's no situation in which you wouldn't want Harvest to make use of them. If that makes sense.
 

coderanger

Member
Two questions:

1. Is it possible to automate rotating familiars for daily drops and/or running Boots stomps?

2. Is it possible to run other ad-hoc daily tasks (first one that comes to mind is getting a Black Heart each day)?

It seems like the answer to both is probably not currently, but if that is correct would you be interested in the patches for inclusion?
 

Banana Lord

Member
As far as no. 2 goes, while I'm happy to support farming related daily activities that I think ~90% of users will use I don't want to go cluttering Harvest up with too many options and functions. You could always write a script to run on login that meets your specific needs, or one that completes your daily activities and then calls Harvest. But I could see myself adding a feature whereby you could specify a script for Harvest to call after consuming but before Bounty Hunting/Farming. What do you mean by a black heart? There are a couple of items you could be referring to ;-) So yeah, in short, I'm happy to make it easier to use user-made scripts with Harvest, and I'm happy to add daily activities that make sense for the majority, but I want to avoid bloat. The familiar switching thing seems like it would be tricky to implement in that there are a bunch of options that would need to be set and catered for, and a bunch of different familiars to track.

If you've got code that can achieve either of the things you stated I'd love to see it, even if I decide not to include it (and I'm not saying I'll reject it out of hand) others might find it useful :)
 

hello

New member
Thank you!

Uhm, I'm having another problem...

EatDrink.ash failed to fill your organs completely

I guess EatDrink.ash deems the spleen items not worth the price? So, how could i get around this?
 

Winterbay

Active member
The familiar switching thing seems like it would be tricky to implement in that there are a bunch of options that would need to be set and catered for, and a bunch of different familiars to track.

If you've got code that can achieve either of the things you stated I'd love to see it, even if I decide not to include it (and I'm not saying I'll reject it out of hand) others might find it useful :)

There is code in BBB that switches between your item-dropping familiars. You could take a look at that I guess.
 

Banana Lord

Member
OK, good idea. But I'm still hesitant. I don't know if it's something I want to support into the future. I'll put it on the back burner for now, as I think it's of minimal gain compared to the other stuff I'm planning. If I have the time and energy I'll look at it again, but for now I'll focus on other things (unless, that is, someone provides me with a compelling reason to add it ;))

@hello: If you're having trouble with ED you're best to post in the thread for that script, but I've run into that myself. In my case it was because I'd set my budget too low and ED was hitting its cap before it'd finished filling me up. Have a look here, starting at #1212.
 
Last edited:

Tom Sawyer

Member
Banana Lord

This is a copy of Izchak's code for the still:

# this tries to use the still, improving whatever you have that can be improved
# however, it will only improve a single item, basically.
# I coded this the way I did on the assumption that one would have multiples of ten
# of several base drinks/mixers, eg. 10 lemons, 30 olives, 10 wines, etc.
boolean utilize_still(){
if(my_primestat() != $stat[moxie]) {
print("youre not a moxie class, and hence cannot use the still");
return false;
}
if(stills_available() == 0) {
print("you have no uses left at the still");
return false;
}
item [item] spirits_n_mixers;
spirits_n_mixers[ $item[grapefruit] ] = $item[tangerine];
spirits_n_mixers[ $item[lemon] ] = $item[kiwi];
spirits_n_mixers[ $item[olive] ] = $item[cocktail onion];
spirits_n_mixers[ $item[orange] ] = $item[kumquat];
spirits_n_mixers[ $item[soda water] ] = $item[tonic water];
spirits_n_mixers[ $item[strawberry] ] = $item[raspberry];
spirits_n_mixers[ $item[bottle of gin] ] = $item[bottle of Calcutta Emerald];
spirits_n_mixers[ $item[bottle of rum] ] = $item[bottle of Lieutenant Freeman];
spirits_n_mixers[ $item[bottle of tequila] ] = $item[bottle of Jorge Sinsonte];
spirits_n_mixers[ $item[bottle of vodka] ] = $item[bottle of Definit];
spirits_n_mixers[ $item[bottle of whiskey] ] = $item[bottle of Domesticated Turkey];
spirits_n_mixers[ $item[boxed wine] ] = $item[boxed champagne];

print("checking spirits, mixers, and crosby nash's still...");
foreach key in spirits_n_mixers {
if( item_amount( key ) > 0 && stills_available() > 0 && item_amount(key) >= stills_available() ) {
print( "hey, you have " + item_amount(key) + " " + key );
print( "you have " + stills_available() + " uses left at the still");
print( "making " + stills_available() + " " + spirits_n_mixers[key]);
return create(stills_available(), spirits_n_mixers[key]);
}
}
print("hmm, you didnt have much, so I made " + stills_available() + " tonic waters");
buy (stills_available(), $item[soda water]);
return create(stills_available(), $item[tonic water]);
}


I am going to mash this into your script and see if it works. Cheers!


EDIT: heh, reviewing the code I see Bale already has this in place. Damn, back to square one. I will force this to use up the still and not waste it should I forget to do so :)

Edit Edit: Went into OCD and set it to craft soda water into tonic water. Not sure if this will fly, see tomorrow
 
Last edited:

Tom Sawyer

Member
Banana Lord I finally got a solution to the still. I ended up adding cli_execute( "call still test.ash" ); to the end of your script. The Still Test ash file contains a mash of my code and some of Bale's so that it checks the market and the uses the still to produce what is the highest value and then chucks it into the store. If anyone else is having still problems this may help.

Again thanks for a kick ass script!


Edit: Heh digging around found an even better code that Bale all ready wrote for still usage and auto-selling. One needs to use a time machine to get ahead of Bale and his scripting power :)
 
Last edited:

Banana Lord

Member
Finally started work on the update and ended up sending a whole day on it :D. Implemented a handful of simple features which I'll test out after rollover. Still got a couple of bugs to track down and the buffbot code to sort out (that's the only big job, to be honest). I'm going to leave FaxBot support out of this update because there seems to be some activity around adding CLI commands to interface with the bot, so I'll hold off until that's done. So to sum up progress is being made, and much more quickly than I thought it would.

Now, Tom, regarding your question about the Still. The reason for Harvest not using it is because I am an idiot. I added the code Bale provided and completely forgot to put a function call in. How do you even do that?! Actually, don't answer that. Anyway, you can either wait for the update, or simply add "improve_spirits();" on a new line in the "finish_up()" function. Or you could just replace the whole "finish_up()" function with this one, if that's easier:

Code:
void finish_up()
	{
	announce(2, "finish_up");
	set_property("har_current_activity", "finish");
	
	announce(1, "Applying pre-run settings");
	apply_prerun_settings();
	
	if(have_skill($skill[rainbow gravitation]))
		cast_rainbow_gravitation();
		
	improve_spirits();
	
	if(get_property("_har_endmeat") == "")
		{
		// Take WSGC into account (OCD doesn't add these to its total)
		set_property("_har_endmeat", my_meat() + my_closet_meat() + item_amount($item[warm subject gift certificate]) * 450);
		announce(3, "_har_endmeat set");
		}
	if(get_property("_har_endadventures") == "")
		{
		set_property("_har_endadventures", my_adventures());
		announce(3, "_har_endadventures set");
		}
	
	announce(1, "Tidying your inventory");
	int ocd_profit = run_ocd();
	if(get_property("_har_ocd_profit") == "")
		{
		set_property("_har_ocd_profit", ocd_profit);
		announce(3, "_har_ocd_profit set");
		}
	
	if(finished_farming() && my_inebriety() <= inebriety_limit())
		{
		announce(1, "Overdrinking");
		overdrink();
		}
	
	equip_rollover_gear();
	
	take_closet(my_closet_meat());
	
	print_summary();
	}

Oh please let there be nothing wrong with that function

EDIT: Oh and thanks for your praise :) As for auto-selling Still-upgraded drinks, if you let Harvest handle it everything will be handled by OCD and the profit made will be included in your daily total.
 

Tom Sawyer

Member
Banana Lord

Edit: I am going to mash your update in and give a it a go. I will let you know if I catch any bugs, cheers!
 
Last edited:

Xenthes

Member
Great script Banana Lord. I just finally getting around to using it.

One request though. for the rollover option could you also add a familiar option? as part of my rollover gear I use the disembodied hand with a time sword.
 

Banana Lord

Member
Now that's one of those features that should already be there. But since there's only one adventure giving familiar (I don't see the hare being used for farming) and only one item you'd ever want to equip it with I'll make Harvest do it all automatically and avoid adding another cluttery option. That'll be in the next release.

EDIT: Wait. Hold the phone. I thought it was odd that I hadn't already added that feature. I have already added that feature (or more accurately it was already in some code I borrowed from BCC et al.). It should equip your hand and time sword automatically. Is it not doing that?
 

Banana Lord

Member
The code pretty much does that already. I have a hunch that the problem was the difference between item_amount() and available_amount(). If the time sword was equipped on the hand before Harvest ran it would assume you had none in inventory and so skip both. That should be fixed now. I'm still a little unfamiliar with the maximizer, but I think this should do what I want it to, yes?

PHP:
if(can_equip($item[time sword]) && have_familiar($familiar[Disembodied Hand]))
	{
	familiar oldFam = my_familiar();
	use_familiar($familiar[Disembodied Hand]);
	if(valid("time sword"))
		maximize("adv -tie", false);
	else
		{
		use_familiar(oldFam);
		maximize("adv -tie -familiar", false);
		}
	}

EDIT: Valid() just returns true if you have and can equip an item.
 
Last edited:

slyz

Developer
I'm pretty sure you can replace all that code with
PHP:
maximize("adv, switch Disembodied Hand", false);
 
Top