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;
}
}