Garden Optimization Script

Lxndr

Member
With Jick's declaration that gardens are unlikely to happen after next year, I'm preparing to face the reality that any garden I have planted will grow in the background and I'll have to harvest it after I break the prism.

I'm looking at trying an ash script that will tell me which garden is the most profitable. I've done the math and I need to figure out some code to match this pseudocode:

Code:
a=mallprice(pumpkin)
b=3*mallprice(peppermint sprout)
c=5*mallprice(skeleton)
d=((21*mallprice(handful of barley)+21*mallprice(21*cluster of hops)+3*mallprice(fancy beer label)+3*mallprice(fancy beer bottle))/7
e=(9*mallprice(snow berries)+9*mallprice(ice harvest)+mallprice(frost flower))/3


if a=max(a,b,c,d,e) return "Pumpkins"
if b=max(a,b,c,d,e) return "Peppermints"
if c=max(a,b,c,d,e) return "Skeletons"
if d=max(a,b,c,d,e) return "Beer"
if e=max(a,b,c,d,e) return "Winter"

At this point I'm ignoring the skulldozer, the giant candy cane and the differently sized pumpkins.
 

Lxndr

Member
If anyone's curious I managed it with this:

Code:
int a = mall_price($item[pumpkin]);
int b = 3*mall_price($item[peppermint sprout]);
int c = 5*mall_price($item[skeleton]);
int d = (21*mall_price($item[handful of barley])+21*mall_price($item[cluster of hops])+3*mall_price($item[fancy beer label])+3*mall_price($item[fancy beer bottle]))/7;
int e = (9*mall_price($item[snow berries])+9*mall_price($item[ice harvest])+mall_price($item[frost flower]))/3;

print("Pumpkin: "+a+" Peppermint: "+b+" Skeleton: "+c+" Beer Garden: "+d+" Winter Garden: "+e);

I probably could set up the ifs that I want at the end, I might do that.
 

Bale

Minion
I guess when the year is over I'll have to add some version of that to my preAscensionScript. I'll be sad not to have any real use for my Garden anymore. Thanks for pointing out his solution even though you're 7 months early.

I understand though why he'd make that choice. Because people complain about buying a new Garden when they already have one. He actually gets less flack for letting the garden go fallow than he'd get for creating a whole new slot. That is probably one of the big reasons he instituted standard. So that he doesn't have to care about people complaining about competition for available slots.
 

Bale

Minion
From your efforts, I made this function:

Code:
item best_garden() {
	int [item] dailyValue;
	dailyValue[ $item[packet of pumpkin seeds] ] = mall_price($item[pumpkin]);
	dailyValue[ $item[Peppermint Pip Packet] ] = 3*mall_price($item[peppermint sprout]);
	dailyValue[ $item[packet of dragon's teeth] ] = 5*mall_price($item[skeleton]);
	dailyValue[ $item[packet of beer seeds] ] = (21*mall_price($item[handful of barley])+21*mall_price($item[cluster of hops])+3*mall_price($item[fancy beer label])+3*mall_price($item[fancy beer bottle]))/7;
	dailyValue[ $item[packet of winter seeds] ] = (9*mall_price($item[snow berries])+9*mall_price($item[ice harvest])+mall_price($item[frost flower]))/3;
	
	item [int] gardens;
	foreach packet in dailyValue
		gardens[ count(gardens) ] = packet;
	sort gardens by -dailyValue[value];
	return gardens[0];
}

Now all I have to do is add some version of the line use(1, best_garden()) to my preAscensionScript.
 
Last edited:

Lxndr

Member
I guess when the year is over I'll have to add some version of that to my preAscensionScript. I'll be sad not to have any real use for my Garden anymore. Thanks for pointing out his solution even though you're 7 months early.

Yeah, I know i'm early. But I have the time to work on this now and if I didn't solve it now, I'd probably forget before next year. Coping skills for memory issues, for the win.
 

Bale

Minion
I know. That's why I put that function into my script already. I really do just have to add a function call and it happens.
 
Top