Skip to content

Instantly share code, notes, and snippets.

@DamianDominoDavis
Last active January 6, 2022 01:22
Show Gist options
  • Save DamianDominoDavis/264d588638f3e0f7de6c9a43536c2781 to your computer and use it in GitHub Desktop.
Save DamianDominoDavis/264d588638f3e0f7de6c9a43536c2781 to your computer and use it in GitHub Desktop.
// defaults to 20 tries per goal, override with property goo_gift_limit
int limit = get_property('goo_gift_limit').to_int();
if (limit < 0)
abort(`set goo_gift_limit = 20`);
if (limit == 0)
limit = 20;
int[item] gifts = {
$item[fleshy putty]: 1,
$item[third ear]: 1,
$item[festive egg sac]: 1,
$item[poisonsettia]: 2,
$item[peppermint-scented socks]: 2,
$item[the Crymbich Manuscript]: 2,
$item[projectile chemistry set]: 3,
$item[depleted Crimbonium football helmet]: 3,
$item[synthetic rock]: 3,
$item[10862]: 4,
$item[self-repairing earmuffs]: 4,
$item[carnivorous potted plant]: 4,
$item[universal biscuit]: 5,
$item[yule hatchet]: 5,
$item[potato alarm clock]: 5,
$item[lab-grown meat]: 6,
$item[golden fleece]: 6,
$item[boxed gumball machine]: 6,
$item[cloning kit]: 7,
$item[electric pants]: 7,
$item[can of mixed everything]:7
};
int[int,int] prices = {
1: {30,0,0},
2: {0,30,0},
3: {0,0,30},
4: {15,15,0},
5: {0,15,15},
6: {15,0,15},
7: {10,10,10}
};
void main(string make_this_item) {
item target = make_this_item.to_item();
if (target == $item[none] || !(gifts contains target))
abort(`can you make a {make_this_item} out of goo?`);
int was = my_session_items(target);
int x;
while (x++ < limit && my_session_items(target) == was) {
if (item_amount($item[gooified animal matter]) >= prices[gifts[target], 0]
&& item_amount($item[gooified vegetable matter]) >= prices[gifts[target], 1]
&& item_amount($item[gooified mineral matter]) >= prices[gifts[target], 2]) {
visit_url('http://127.0.0.1:60080/place.php?whichplace=northpole&action=np_toylab');
run_choice(gifts[target]);
}
else {
print('Out of ingredients.');
break;
}
}
if (was == my_session_items(target))
print(`Didn't get {target} in {x-1} tries. :(`, 'red');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment