Skip to content

Instantly share code, notes, and snippets.

@DamianDominoDavis
Created September 28, 2025 21:33
Show Gist options
  • Save DamianDominoDavis/ac6049d5fa7e75558e040ff5a0c8c58b to your computer and use it in GitHub Desktop.
Save DamianDominoDavis/ac6049d5fa7e75558e040ff5a0c8c58b to your computer and use it in GitHub Desktop.
make the most of your takerspace
record Recipe {
item result;
int[string] cost; // key = takerSpace property name
};
int[item,string] recipes = {
$item[sleeping profane parrot] : {"Spice": 15, "Rum": 3, "Silk": 2, "Gold": 1},
$item[pirrrate\'s currrse]: {"Spice": 2, "Rum": 2},
$item[tankard of spiced rum]: {"Spice": 1, "Rum": 2},
$item[tankard of spiced Goldschlepper]: {"Rum": 2, "Gold": 1},
$item[packaged luxury garment]: {"Silk": 3, "Gold": 2},
$item[harpoon]: {"Mast": 2},
$item[chili powder cutlass]: {"Spice": 5, "Anchor": 1},
$item[cursed Aztec tamale]: {"Spice": 2},
$item[jolly roger tattoo kit]: {"Rum": 6, "Anchor": 1, "Mast": 1, "Gold": 6},
$item[golden pet rock]: {"Gold": 7},
$item[groggles]: {"Rum": 6},
$item[anchor bomb]: {"Rum": 1, "Anchor": 3, "Mast": 1, "Gold": 1},
$item[silky pirate drawers]: {"Silk": 2}
//spices
};
int currency_count(string ingredient) {
switch (ingredient) {
case "Spice": return get_property("takerSpaceSpice").to_int();
case "Rum": return get_property("takerSpaceRum").to_int();
case "Anchor": return get_property("takerSpaceAnchor").to_int();
case "Mast": return get_property("takerSpaceMast").to_int();
case "Silk": return get_property("takerSpaceSilk").to_int();
case "Gold": return get_property("takerSpaceGold").to_int();
default: return 0;
}
}
int[string] currency_counts() {
return {
"Spice": currency_count("Spice"),
"Rum": currency_count("Rum"),
"Anchor": currency_count("Anchor"),
"Mast": currency_count("Mast"),
"Silk": currency_count("Silk"),
"Gold": currency_count("Gold")
};
}
boolean can_afford(int[string] real, int[string] proposed) {
foreach i,x in real
if (proposed[i] > x)
return false;
return true;
}
void main() {
int best_value;
int[int] best_config;
for parrot from 0 to creatable_amount($item[sleeping profane parrot])
for curse from 0 to creatable_amount($item[pirrrate\'s currrse])
for rum from 0 to creatable_amount($item[tankard of spiced rum])
for schlepper from 0 to creatable_amount($item[tankard of spiced Goldschlepper])
for garment from 0 to creatable_amount($item[packaged luxury garment])
for harpoon from 0 to creatable_amount($item[harpoon])
for cutlass from 0 to creatable_amount($item[chili powder cutlass])
for tamale from 0 to creatable_amount($item[cursed Aztec tamale])
for tattoo from 0 to creatable_amount($item[jolly roger tattoo kit])
for rock from 0 to creatable_amount($item[golden pet rock])
for groggles from 0 to creatable_amount($item[groggles])
for bomb from 0 to creatable_amount($item[anchor bomb])
for drawers from 0 to creatable_amount($item[silky pirate drawers]) {
int[string] used_amount;
foreach ingredient,qty in recipes[$item[sleeping profane parrot]]
used_amount[ingredient] += parrot * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[pirrrate\'s currrse]]
used_amount[ingredient] += curse * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[tankard of spiced rum]]
used_amount[ingredient] += rum * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[tankard of spiced Goldschlepper]]
used_amount[ingredient] += schlepper * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[packaged luxury garment]]
used_amount[ingredient] += garment * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[harpoon]]
used_amount[ingredient] += harpoon * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[chili powder cutlass]]
used_amount[ingredient] += cutlass * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[cursed Aztec tamale]]
used_amount[ingredient] += tamale * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[jolly roger tattoo kit]]
used_amount[ingredient] += tattoo * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[golden pet rock]]
used_amount[ingredient] += rock * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[groggles]]
used_amount[ingredient] += groggles * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[anchor bomb]]
used_amount[ingredient] += bomb * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
foreach ingredient,qty in recipes[$item[silky pirate drawers]]
used_amount[ingredient] += drawers * qty;
if (!can_afford(currency_counts(), used_amount))
continue;
int value;
value += parrot * historical_price($item[sleeping profane parrot]);
value += curse * historical_price($item[pirrrate\'s currrse]);
value += rum * historical_price($item[tankard of spiced rum]);
value += schlepper * historical_price($item[tankard of spiced Goldschlepper]);
value += garment * historical_price($item[packaged luxury garment]);
value += harpoon * historical_price($item[harpoon]);
value += cutlass * historical_price($item[chili powder cutlass]);
value += tamale * historical_price($item[cursed Aztec tamale]);
value += tattoo * historical_price($item[jolly roger tattoo kit]);
value += rock * historical_price($item[golden pet rock]);
value += groggles * historical_price($item[groggles]);
value += bomb * historical_price($item[anchor bomb]);
value += drawers * historical_price($item[silky pirate drawers]);
if (value > best_value) {
best_value = value;
best_config = int[int]{parrot,curse,rum,schlepper,garment,harpoon,cutlass,tamale,tattoo,rock,groggles,bomb,drawers};
}
}
print(`Best value: {best_value} meat`);
item[int] order = {
$item[sleeping profane parrot],
$item[pirrrate\'s currrse],
$item[tankard of spiced rum],
$item[tankard of spiced Goldschlepper],
$item[packaged luxury garment],
$item[harpoon],
$item[chili powder cutlass],
$item[cursed Aztec tamale],
$item[jolly roger tattoo kit],
$item[golden pet rock],
$item[groggles],
$item[anchor bomb],
};
for i from 0 to 12
if (best_config[i] > 0)
print(`{best_config[i]} x {order[i]} @ {historical_price(order[i])} meat/per = {best_config[i] * historical_price(order[i])} meat`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment