import { Effect } from "kolmafia"; import { Requirement } from "../../maximize.js"; export default class CommunityService { private choice; private stat; private property; private predictor; private maximizeRequirements; private timer; /** * Class to store properties of various CS tests. * * @param id The id the game HTML uses to identify the test; this is used primarily in runChoice. * @param stat The principle stat the test measures, often used as more easily memorable shorthand for the specific tests * @param property The name of the test as a string, often used as part of the string property "csServicesPerformed". * @param predictor A function that returns an estimate for the number of turns that the test will take given your character's current state. * @param maximizeRequirements A Requirement object, if applicable, that aligns with the things needed to maximize for this particular test. */ private constructor(); /** * @returns The id number of the test, used primarily in runChoice. */ get id(): number; /** * @returns The primary stat the test measures, used primarily as memorable shorthand in place of test names. */ get statName(): string; /** * @returns The name of the test, used primarily as part of the string property "csServicesPerformed" */ get name(): string; /** * @returns The predicted number of turns this test will take given your character's current state. */ get prediction(): number; /** * @returns A Requirement object, if applicable, that aligns with the things needed to maximize for this particular test. */ get requirement(): Requirement | null; /** * Start the time & turn counter for the Test in question. */ startTimer(): void; private static taskTimers; /** * Start the time & turn counter for the given task * * @param name The name of the task to start the counter of */ static startTimer(name: string): void; static logTask(name: string, action: () => number | void): void; /** * Checks the "csServicesPerformed" property to see whether mafia currently believes this test is complete. * * @returns Whether mafia currently believes this test is complete. */ isDone(): boolean; /** * Maximizes based on the Requirement associated with this particular test. */ maximize(): void; /** * Attempts to turn in the test to the Council of Loathing. * * @returns Whether mafia believes the test is complete at the end of this function. */ do(): boolean; /** * Wrapper function that prepares for a test and then completes it, adding time and turn details to the log. * * @param prepare A function that does all necessary preparations for this CS test, including choosing your outfit. Optionally returns the number of turns you expect to spend preparing for the test. * @param maxTurns We will run the test iff the predicted/actual turns is less than or equal to this parameter. * @returns "completed", "failed", or "already completed". */ run(prepare: () => void | number, maxTurns?: number): "completed" | "failed" | "already completed"; private _verifyIsDone; /** * Checks council.php to verify that a test is complete; more reliable than isDone, but requires an additional pagehit. * * @returns Whether council.php suggests that the test is complete. */ verifyIsDone(): boolean; private _actualCost; /** * Checks council.php for the number of turns this test will take; more reliable than prediction, but requires an additional pagehit. * * @returns The number of turns to complete this test according to council.php. */ actualCost(): number; /** * @param effects A spread array of Effects to consider * @returns The number of turns we expect to save if we start using those effects */ turnsSavedBy(...effects: Effect[]): number; /** * A log of the predicted turns, actual turns, and duration of each CS test performed. */ static log: { [index: string]: { predictedTurns: number; turnCost: number; seconds: number; type: "test" | "task"; }; }; /** * Prints turncount and time details of the test in question. * * @param colour The colour (or color) you'd like the log to be printed in. */ static printLog(colour?: string): void; static HP: CommunityService; static Muscle: CommunityService; static Mysticality: CommunityService; static Moxie: CommunityService; static FamiliarWeight: CommunityService; static WeaponDamage: CommunityService; static SpellDamage: CommunityService; static Noncombat: CommunityService; static BoozeDrop: CommunityService; static HotRes: CommunityService; static CoilWire: CommunityService; static donate: () => void; static path: import("kolmafia").Path; }