Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"babel-loader": "^9.1.3",
"build": "^0.1.4",
"grimoire-kolmafia": "^0.3.25",
"kolmafia": "^5.28591.0",
"libram": "^0.11.14",
"kolmafia": "^5.29297.0",
"libram": "^0.11.24",
"mafia-shared-relay": "0.0.7",
"webpack": "^5.89.0"
},
Expand Down
11 changes: 10 additions & 1 deletion src/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export const args = Args.create(
default: false,
setting: "",
}),
sea: Args.flag({
help: "Ascend into and run seapath",
default: false,
setting: "",
}),
crimbo: Args.flag({
help: "Farm Crimbo instead of Garbo",
default: false,
Expand Down Expand Up @@ -152,7 +157,11 @@ export const args = Args.create(
default: "",
}),
ih8uscript: Args.string({
help: "The command that will do your You, Robot run for you. Include any arguments desired.",
help: "The command that will do your ih8u run for you. Include any arguments desired.",
default: "",
}),
seascript: Args.string({
help: "The command that will do your sea for you. Include any arguments desired.",
default: "",
}),
pulls: Args.items({
Expand Down
46 changes: 14 additions & 32 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Args, getTasks } from "grimoire-kolmafia";
import { gamedayToInt, getRelated, Item, mallPrice, print } from "kolmafia";
import { $item } from "libram";
import { gamedayToInt, print } from "kolmafia";

import { args } from "./args";
import { ProfitTrackingEngine } from "./engine/engine";
import { AftercoreQuest } from "./tasks/1 aftercoreleg";
import { AscendQuest } from "./tasks/2 ascend";
import { RunQuests } from "./tasks/3 runleg";
import { PostRunQuests } from "./tasks/4 postrunleg";
import { deleteJunkKmails, halloween, notifyVoters, realDay, realMonth } from "./tasks/utils";
import { deleteJunkKmails, halloween, notifyVoters, realDay, realMonth, totalApronMeatDrop } from "./tasks/utils";

const version = "0.0.3";

Expand All @@ -22,34 +21,9 @@ export function main(command?: string): void {
}

if (args.test) {
const coldWadPrice = mallPrice($item`stench wad`);
const twinklyWadPrice = mallPrice($item`twinkly wad`);

const results = Item.all()
.map((item) => {
const p = getRelated(item, "pulverize");

const value =
// cold
((p?.["stench wad"] ?? 0) * coldWadPrice) / 1_000_000 +
((p?.["stench nuggets"] ?? 0) * coldWadPrice) / 5 / 1_000_000 +
((p?.["stench powder"] ?? 0) * coldWadPrice) / 25 / 1_000_000 +
// twinkly
((p?.["twinkly wad"] ?? 0) * twinklyWadPrice) / 1_000_000 +
((p?.["twinkly nuggets"] ?? 0) * twinklyWadPrice) / 5 / 1_000_000 +
((p?.["twinkly powder"] ?? 0) * twinklyWadPrice) / 25 / 1_000_000;

const price = mallPrice(item) > 0 ? mallPrice(item) : Infinity;
const net = value - price;
const roi = net / price;

return { item, value, price, net, roi };
})
.filter((o) => o.net > 0)
.sort((a, b) => b.net - a.net);

for (const { item, net, roi } of results) {
print(`${item}: net ${net.toFixed(0)} meat (ROI ${(roi * 100).toFixed(1)}%)`);
print(`Total meat drop from Apron ${totalApronMeatDrop()}`);
if(totalApronMeatDrop() > 100) {
throw `Apron meat seems pretty good, maybe solve that?`;
}
}

Expand All @@ -63,7 +37,15 @@ export function main(command?: string): void {

print(`Running: candyWrapper v${version}`);

if (!args.cs && !args.smol && !args.casual && !args.robot && !args.zooto && !args.ih8u)
if (
!args.cs &&
!args.smol &&
!args.casual &&
!args.robot &&
!args.zooto &&
!args.ih8u &&
!args.sea
)
throw "Undefined runtype; please choose an acceptable path";

const tasks = getTasks([AftercoreQuest(), AscendQuest(), RunQuests(), PostRunQuests()]);
Expand Down
26 changes: 22 additions & 4 deletions src/tasks/1 aftercoreleg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,20 @@ import { Cycle, setConfiguration, Station } from "libram/dist/resources/2022/Tra

import { args } from "../args";
import { garboValue } from "../engine/profits";

import { chrono, crimbo, garboWeen, noBarf, postRunQuests, preRunQuests } from "./repeatableTasks";
import { Quest } from "../structure";

import {
chrono,
crimbo,
cupOf13sDrink,
fixScreech,
postRunQuests,
pregamePasta,
preRunQuests,
sealClubberFishySetup,
seaPearls,
sWordSetup,
} from "./repeatableTasks";
import { maxBase, pvpCloset, stooperDrunk, totallyDrunk } from "./utils";

const RESOURCES = ["Spice", "Rum", "Anchor", "Mast", "Silk", "Gold"] as const;
Expand Down Expand Up @@ -171,8 +182,14 @@ export function AftercoreQuest(): Quest {
},
...preRunQuests(),
...postRunQuests(),
...noBarf(),
...garboWeen(),
...pregamePasta(),
...cupOf13sDrink(),
...sealClubberFishySetup(),
...sWordSetup(),
...seaPearls(),
...fixScreech(),
//...noBarf(),
//...garboWeen(),
...crimbo(),
...chrono(),
{
Expand Down Expand Up @@ -255,6 +272,7 @@ export function AftercoreQuest(): Quest {
},
tracking: "Organs",
},
...seaPearls(),
{
name: "Nightcap (Marginal)",
ready: () => have($item`Beach Comb`) || have($item`Map to Safety Shelter Grimace Prime`),
Expand Down
73 changes: 65 additions & 8 deletions src/tasks/2 ascend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,32 @@ import {
cliExecute,
equip,
handlingChoice,
mallPrice,
myAdventures,
myDaycount,
retrieveItem,
runChoice,
visitUrl,
} from "kolmafia";
import { $class, $item, $path, $skill, $skills, ascend, CursedMonkeyPaw, have } from "libram";
import { availableCasts, castDownTo } from "libram/dist/resources/2025/BloodCubicZirconia";
import {
$class,
$item,
$items,
$path,
$skill,
$skills,
$slot,
ascend,
BloodCubicZirconia,
CursedMonkeyPaw,
EternityCodpiece,
have,
} from "libram";

import { args } from "../args";
import { Quest } from "../structure";

import { targetPerms } from "./perm";
import { Quest } from "../structure";
import { toMoonSign, totallyDrunk } from "./utils";

const skipPizza = args.cs || args.smol ? false : true;
Expand All @@ -28,17 +42,57 @@ export function AscendQuest(): Quest {
name: "Spend them stats grrrrl",
ready: () => have($item`blood cubic zirconia`),
completed: () =>
availableCasts($skill`BCZ: Prepare Spinal Tapas`, 0) === 0 &&
availableCasts($skill`BCZ: Craft a Pheromone Cocktail`, 0) === 0 &&
availableCasts($skill`BCZ: Create Blood Thinner`, 0) === 0,
BloodCubicZirconia.availableCasts($skill`BCZ: Prepare Spinal Tapas`, 0) === 0 &&
BloodCubicZirconia.availableCasts($skill`BCZ: Craft a Pheromone Cocktail`, 0) === 0 &&
BloodCubicZirconia.availableCasts($skill`BCZ: Create Blood Thinner`, 0) === 0,
do: () => {
equip($item`blood cubic zirconia`);
$skills`BCZ: Prepare Spinal Tapas, BCZ: Craft a Pheromone Cocktail, BCZ: Create Blood Thinner`.forEach(
(sk) => castDownTo(sk, 0),
(sk) => {
const casts = BloodCubicZirconia.availableCasts(sk, 0);
for (let index = 0; index < casts; index++) {
BloodCubicZirconia.cast(sk, BloodCubicZirconia.availableCasts(sk, 0));
}
},
);
},
tracking: "Other",
},
{
name: "Do Pizza",
ready: () => args.cs || args.smol || args.sea,
completed: () =>
have($item`Deep Dish of Legend`) &&
have($item`Calzone of Legend`) &&
have($item`Pizza of Legend`),
do: () => {
retrieveItem($item`Deep Dish of Legend`);
retrieveItem($item`Calzone of Legend`);
retrieveItem($item`Pizza of Legend`);
},
tracking: "Other",
},
{
name: "Smuggle Pearls",
ready: () =>
(mallPrice($item`unblemished pearl`) <= 75_000 || have($item`unblemished pearl`, 5)) &&
EternityCodpiece.have() &&
args.sea,
completed: () =>
EternityCodpiece.currentGems().join(",") ===
$items`unblemished pearl, unblemished pearl, unblemished pearl, unblemished pearl, unblemished pearl`.join(
",",
),
do: () => {
retrieveItem($item`unblemished pearl`, 5);
equip($item`unblemished pearl`, $slot`codpiece1`);
equip($item`unblemished pearl`, $slot`codpiece2`);
equip($item`unblemished pearl`, $slot`codpiece3`);
equip($item`unblemished pearl`, $slot`codpiece4`);
equip($item`unblemished pearl`, $slot`codpiece5`);
},
tracking: "Other",
},
{
name: "Do the Ascension",
ready: () =>
Expand All @@ -65,6 +119,8 @@ export function AscendQuest(): Quest {
? $path`Z is for Zootomist`
: args.ih8u
? $path`11 Things I Hate About U`
: args.sea
? $path`11,037 Leagues Under the Sea`
: undefined;
const lifestyle = args.casual ? 1 : 2;

Expand All @@ -90,8 +146,9 @@ export function AscendQuest(): Quest {
});
cliExecute("refresh all");
visitUrl("main.php");
if (args.smol || args.robot) {
if (args.smol || args.robot || args.sea) {
while (handlingChoice()) runChoice(1);
runChoice(1);
}
},
},
Expand Down
11 changes: 6 additions & 5 deletions src/tasks/3 runleg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {
import { $item, $skill, clamp, get, have } from "libram";

import { args } from "../args";

import { preRunQuests } from "./repeatableTasks";
import { Quest } from "../structure";

import { preRunQuests, seaPearls } from "./repeatableTasks";
import { shouldWeOverdrink } from "./utils";

const runType = () =>
Expand All @@ -33,6 +33,8 @@ const runType = () =>
? args.robotscript
: args.ih8u
? args.ih8uscript
: args.sea
? args.seascript
: "autoscend";

export function howManySausagesCouldIEat() {
Expand Down Expand Up @@ -86,9 +88,7 @@ function doIh8uDrinks(): void {
while (
canDrinkMore() &&
(have($item`mini kiwitini`) ||
(have($item`mini kiwi`) &&
(have($item`bottle of vodka`) ||
have($item`bottle of gin`))))
(have($item`mini kiwi`) && (have($item`bottle of vodka`) || have($item`bottle of gin`))))
) {
if (!have($item`mini kiwitini`)) retrieveItem($item`mini kiwitini`);
useSkill($skill`The Ode to Booze`);
Expand Down Expand Up @@ -117,6 +117,7 @@ export function RunQuests(): Quest {
completed: () => get("kingLiberated"),
tasks: [
...preRunQuests(),
...seaPearls(),
{
name: "Run",
completed: () => (get("kingLiberated") && args.cs) || step("questL13Final") > 11,
Expand Down
Loading