Feature - Implemented Harvest Any

Paragon

Member
Can there be an option to make KoL harvest whatever is in the garden on login. Currently we have it so that we can harvest anything specifically but if I switch garden types (pumpkins to peppermints or vis versa) and forget to switch the option I end up with ginormous pumpkins or giant candy canes.
 

slyz

Developer
I know it's not a real fix, but meanwhile you can simply select "peppermint sprout", it should also harvest pumpkins as a result.

EDIT: sorry, you have to select "pumpkin" to harvest anything, not peppermint.
 
Last edited:
That doesn't work, Slyz. As mentioned in the other breakfast thread, I add a line to my login script.
Code:
if (contains_text(visit_url("campground.php","action=garden")) cli_execute("garden pick");
I have two characters, one who currently has pumpkins and one who currently has sprouts, and regardless of what I set that setting to, it would harvest one and not the other, which is sorta what I expected when you look at the options that are available.
 

slyz

Developer
That doesn't work, Slyz.
Oh, of course it doesn't, it's the other way around. Sorry. Select "pumpkin", and it should also harvest peppermint.

Here is how CampgroundRequest knows about the different crops:
PHP:
public static final AdventureResult [] CROPS =
{
	CampgroundRequest.PUMPKIN,
	CampgroundRequest.HUGE_PUMPKIN,
	CampgroundRequest.GINORMOUS_PUMPKIN,
	CampgroundRequest.PEPPERMINT_SPROUT,
	CampgroundRequest.GIANT_CANDY_CANE,
};

And here is how CampgroundRequest.hasCropOrBetter() works ("crop" is the crop selected in the breakfast settings):
PHP:
String currentName = current.getName();
if ( crop.equals( currentName )  )
{
	return true;
}

// Iterate through CROPS.
for ( int i = 0; i < CROPS.length; ++i )
{
	String cropName = CROPS[ i ].getName();
	// We found the current crop before we found the
	// desired crop. Not good enough.
	if ( cropName.equals( currentName ) )
	{
		return false;
	}
	// We found the desired crop before we found the
	// current crop - which must be better. Cool.
	if ( cropName.equals( crop ) )
	{
		return true;
	}
}
If it finds the desired crop before the current crop, it returns true, and the crop is picked. So, basically, if you choose "Pumpkin" from the dropdown, Mafia should harvest anything it finds in your garden.
 
Last edited:

Veracity

Developer
Staff member
Heh. I just switched from peppermint to pumpkins a while ago and was consterned when I harvested a huge pumpkin. I have now switched my desired crop to "pumpkin", but I think "harvest any" would be clearer.

So, I approve of this request. Maybe I'll look at it - although it wouldn't bother me if someone else wanted to. ;)
 

Catch-22

Active member
Bored ;)

Also lostcalpolydude doesn't seem to have patched the most recent bypass I found to the visit_url checks, so I may post that soon too (not sure what the hold up is).
 
Top