Hooch.ash

Bale

Minion
I couldn't resist fiddling with your script. Note the changes I made to make badge and maximum hooch levels character independent features.

Code:
import <zlib.ash>;

// <td align=right>Hooch:</td><td align=left><b>26 / 27</b></font></td>
int cur_hooch() {
	string charpane = visit_url("charpane.php");
	matcher hooch_matcher = create_matcher("<td align=right>Hooch:</td><td align=left><b>(\\d+) / (\\d+)</b></font></td>", charpane);
	if(hooch_matcher.find())
		return hooch_matcher.group(1).to_int();
	else
		return 0;
}

void turn_in_hooch() {
	visit_url("place.php?whichplace=twitch&action=twitch_shoerepair");
	visit_url("choice.php?pwd=&whichchoice=973&option=2");
}

item badge() {
	foreach b in $items[Time Lord Badge of Honor, Time Bandit Badge of Courage]
		if(available_amount(b) > 0) return b;
	return $item[none];
}

void turn_in_with_badge() {
	item badge = badge();
	item previous_accesory; 
	if(badge != $item[none]) {
		previous_accesory = equipped_item($slot[acc1]);
		equip($slot[acc1], $item[Time Lord Badge of Honor]);
	}
	try {
		turn_in_hooch();
	}
	finally {
		if(previous_accesory != $item[none]) equip($slot[acc1], previous_accesory);
	}
}

void main(string adventures_to_run) {
	if(numeric_modifier("Maximum Hooch") == 0)
		abort("You need to increase your Hoochability to gather Hooch.");
	int adv = adventures_to_run.to_int();
	if(adv == 0)
		adv = my_adventures() - 5;
	while(adv > 0) {
		if(cur_hooch() >= numeric_modifier("Maximum Hooch"))
			turn_in_with_badge();
		adventure(1 , $location[An Illicit Bohemian Party]);
		adv = adv - 1;
	}
}

An even better change would be to alter cur_hooch() to no longer need a server hit. run_combat() will return the last combat page load if you are not currently in a fight. The amount of hooch you gained in that fight could be parsed from that page.
 

coderanger

Member
Yeah, if this was going to be useful for more than 60 minutes it could do with a lot of improvements :) Maybe for the next Twitch event! Thanks for the tips, didn't know about numeric_modifier()
 

xKiv

Active member
An even better change would be to alter cur_hooch() to no longer need a server hit. run_combat() will return the last combat page load if you are not currently in a fight. The amount of hooch you gained in that fight could be parsed from that page.

I would just hack that into charpane override. CHIT already parses current hooch, just store it in a preference.
Does fully automatic adventuring (as opposed to "click in relay browser, let automation take care of the combats/noncombats/betweencombats) invoke charpane override? Would/could you do it yourself?
 

coderanger

Member
I would just hack that into charpane override. CHIT already parses current hooch, just store it in a preference.
Does fully automatic adventuring (as opposed to "click in relay browser, let automation take care of the combats/noncombats/betweencombats) invoke charpane override? Would/could you do it yourself?

If, during the next event, there is still a reason to farm hooch I'll improve it then. Chances are this will join most of the Crimbo scripts as a relic.
 

Bale

Minion
I would just hack that into charpane override. CHIT already parses current hooch, just store it in a preference.

While I like the idea in principle, the problem is that it won't do any good.

If I run the script, mafia won't bother passing the charpane to the relay browser. If the relay browser doesn't see it, then the relay override will not parse the page. Relay overrides do NOTHING unless I am adventuring manually.

If I am adventuring manually in the relay browser then my eyeballs are telling me the current level of hooch without it needing to be saved as a preference. Also, automatic adventuring scripts wouldn't reference the preference because I'm not using them.
 

Crowther

Active member
My script predicted when you'd got over your max and turned in hooch before that, including predicting the non-combat (which was a pain to get right). I'm not posting it, because I don't see anything useful in it. It was not very general purpose (hard coded per-character stuff) and hits the server (even only if once per adventure). By the time I got it working I was sick of KoL.
 

xKiv

Active member
AFAIK, jick wants 1) to preserve the current level of obtaining chroner and 2) the upmost floor to always be the optimal for chroner.
On the stream, he said something about changing the hooch-to-chroner ratio for next time (from 2:1 to 3:1), for that reason.
This means that, for many people, tracking hooch will never again be useful. Probably.
 

Crowther

Active member
While I didn't hear him talk about the ratio change, that's the same impression I got. So I thought it was odd I had to adventure in the old cave to complete a new quest. I burned a lot of tattered scraps doing that. I'm optimistic that I'll never need to farm hooch again.
 

xKiv

Active member
While I didn't hear him talk about the ratio change, that's the same impression I got. So I thought it was odd I had to adventure in the old cave to complete a new quest. I burned a lot of tattered scraps doing that. I'm optimistic that I'll never need to farm hooch again.

You mean the caveman dan quest? That belongs entirely to the first floor, and would have been done last time if they could fit it in ... it also only gave 20 croner, so it was supper ineffective.
 
Top