libram 0.3.2 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Clan.js +268 -485
- package/dist/Copier.js +11 -48
- package/dist/Dungeon.js +77 -157
- package/dist/Kmail.d.ts +13 -7
- package/dist/Kmail.js +92 -233
- package/dist/Path.js +68 -120
- package/dist/ascend.js +153 -172
- package/dist/combat.d.ts +86 -1
- package/dist/combat.js +295 -387
- package/dist/console.js +13 -36
- package/dist/diet/index.d.ts +31 -0
- package/dist/diet/index.js +333 -0
- package/dist/diet/knapsack.d.ts +7 -0
- package/dist/diet/knapsack.js +106 -0
- package/dist/dungeons/Dreadsylvania.d.ts +4 -0
- package/dist/dungeons/Dreadsylvania.js +14 -0
- package/dist/dungeons/Dungeon.d.ts +28 -0
- package/dist/dungeons/Dungeon.js +99 -0
- package/dist/dungeons/Hobopolis.d.ts +4 -0
- package/dist/dungeons/Hobopolis.js +14 -0
- package/dist/dungeons/SlimeTube.d.ts +4 -0
- package/dist/dungeons/SlimeTube.js +14 -0
- package/dist/freerun.d.ts +23 -0
- package/dist/freerun.js +92 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +21 -263
- package/dist/lib.d.ts +43 -0
- package/dist/lib.js +296 -405
- package/dist/logger.js +23 -63
- package/dist/maximize.d.ts +29 -12
- package/dist/maximize.js +318 -421
- package/dist/modifier.d.ts +13 -0
- package/dist/modifier.js +35 -0
- package/dist/modifierTypes.d.ts +16 -0
- package/dist/modifierTypes.js +9 -0
- package/dist/mood.js +220 -531
- package/dist/property.d.ts +2 -0
- package/dist/property.js +96 -242
- package/dist/propertyTypes.d.ts +9 -0
- package/dist/propertyTypes.js +1 -0
- package/dist/propertyTyping.d.ts +2 -9
- package/dist/propertyTyping.js +42 -53
- package/dist/resources/2007/CandyHearts.d.ts +9 -0
- package/dist/resources/2007/CandyHearts.js +24 -0
- package/dist/resources/2008/DivineFavors.d.ts +9 -0
- package/dist/resources/2008/DivineFavors.js +27 -0
- package/dist/resources/2009/Bandersnatch.js +37 -112
- package/dist/resources/2009/LoveSongs.d.ts +9 -0
- package/dist/resources/2009/LoveSongs.js +24 -0
- package/dist/resources/2009/SpookyPutty.js +20 -46
- package/dist/resources/2010/Brickos.d.ts +9 -0
- package/dist/resources/2010/Brickos.js +21 -0
- package/dist/resources/2010/CrownOfThrones.d.ts +18 -0
- package/dist/resources/2010/CrownOfThrones.js +550 -0
- package/dist/resources/2011/Gygaxian.d.ts +9 -0
- package/dist/resources/2011/Gygaxian.js +24 -0
- package/dist/resources/2011/ObtuseAngel.js +21 -63
- package/dist/resources/2012/RainDoh.js +14 -40
- package/dist/resources/2012/Resolutions.d.ts +9 -0
- package/dist/resources/2012/Resolutions.js +28 -0
- package/dist/resources/2013/Florist.d.ts +61 -0
- package/dist/resources/2013/Florist.js +149 -0
- package/dist/resources/2013/PulledTaffy.d.ts +9 -0
- package/dist/resources/2013/PulledTaffy.js +33 -0
- package/dist/resources/2014/WinterGarden.js +15 -43
- package/dist/resources/2015/ChateauMantegna.js +52 -86
- package/dist/resources/2015/MayoClinic.d.ts +13 -0
- package/dist/resources/2015/MayoClinic.js +36 -0
- package/dist/resources/2016/SourceTerminal.d.ts +1 -0
- package/dist/resources/2016/SourceTerminal.js +114 -237
- package/dist/resources/2016/Witchess.js +33 -59
- package/dist/resources/2017/TunnelOfLove.js +62 -111
- package/dist/resources/2018/SongBoom.js +32 -68
- package/dist/resources/2019/BeachComb.d.ts +2 -0
- package/dist/resources/2019/BeachComb.js +26 -0
- package/dist/resources/2019/Snapper.d.ts +28 -0
- package/dist/resources/2019/Snapper.js +70 -0
- package/dist/resources/2020/Guzzlr.js +79 -163
- package/dist/resources/LibramSummon.d.ts +12 -0
- package/dist/resources/LibramSummon.js +66 -0
- package/dist/resources/index.d.ts +18 -11
- package/dist/resources/index.js +19 -85
- package/dist/resources/putty-likes.js +15 -30
- package/dist/ring-buffer.d.ts +24 -0
- package/dist/ring-buffer.js +135 -0
- package/dist/since.d.ts +1 -0
- package/dist/since.js +56 -112
- package/dist/template-string.js +40 -132
- package/dist/utils.d.ts +14 -0
- package/dist/utils.js +50 -114
- package/package.json +5 -3
- package/dist/libram-example-briefcase.js +0 -16073
- package/dist/libram-example-clan.js +0 -8898
- package/dist/libram-example-consult.js +0 -6179
- package/dist/libram-example-item.js +0 -3248
- package/dist/libram-example-kmail.js +0 -2065
- package/dist/libram-example-lib.js +0 -7608
- package/dist/libram-example-props.js +0 -4770
- package/dist/libram-example-resources.js +0 -12226
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { getClanName, myId, toItem, visitUrl, xpath } from "kolmafia";
|
|
2
|
+
import { $items } from "../template-string";
|
|
3
|
+
import { Clan } from "../Clan";
|
|
4
|
+
import { getPlayerFromIdOrName } from "../lib";
|
|
5
|
+
import { countedMapToArray } from "../utils";
|
|
6
|
+
/**
|
|
7
|
+
* Distributes loot from given dungeon
|
|
8
|
+
* @param dungeon The dungeon to distribute loot from
|
|
9
|
+
* @param idOrName The player you're trying to distribute to, either as a username or a player ID. Defaults to self.
|
|
10
|
+
* @param loot The loot you're looking to distribute, specific to this dungeon
|
|
11
|
+
* @param distributeAllOfAGivenItem For items that you can get multiple of in a dungeon. When true, this will give everything of that ilk to your chosen player.
|
|
12
|
+
*/
|
|
13
|
+
export function distribute(dungeon, idOrName = myId(), loot = dungeon.loot, distributeAllOfAGivenItem = true) {
|
|
14
|
+
const player = getPlayerFromIdOrName(idOrName);
|
|
15
|
+
const lootList = loot instanceof Map
|
|
16
|
+
? countedMapToArray(loot)
|
|
17
|
+
: Array.isArray(loot)
|
|
18
|
+
? loot
|
|
19
|
+
: [loot];
|
|
20
|
+
const badLoot = lootList.find((lootItem) => !dungeon.loot.includes(lootItem));
|
|
21
|
+
if (badLoot) {
|
|
22
|
+
throw new Error(`${badLoot} is not a valid piece of dungeon loot`);
|
|
23
|
+
}
|
|
24
|
+
const pageText = visitUrl("clan_basement.php");
|
|
25
|
+
if (!pageText.match(new RegExp(player.name, "i"))) {
|
|
26
|
+
throw new Error(`${player.name} cannot be distributed loot from ${getClanName()}`);
|
|
27
|
+
}
|
|
28
|
+
const itemNames = xpath(pageText, "//tr/td[2]/b/text()");
|
|
29
|
+
const whichLoots = xpath(pageText, '//form[@action="clan_basement.php"]//input[@type="hidden"][@name="whichloot"]/@value');
|
|
30
|
+
itemNames.forEach((itemName, index) => {
|
|
31
|
+
if (lootList.includes(toItem(itemName))) {
|
|
32
|
+
visitUrl(`clan_basement.php?whichloot=${whichLoots[index]}&recipient=${player.id}`);
|
|
33
|
+
if (!distributeAllOfAGivenItem)
|
|
34
|
+
lootList.splice(lootList.indexOf(toItem(itemName)));
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function close(dungeon) {
|
|
39
|
+
visitUrl(`clan_basement.php?action=${dungeon.closeAction}&confirm=true`, true);
|
|
40
|
+
const pageText = visitUrl("clan_basement.php");
|
|
41
|
+
return pageText.includes(dungeon.closedImage);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Opens clan dungeon and, if relevant, pays meat to do so
|
|
45
|
+
* @param dungeon The Dungeon to open
|
|
46
|
+
* @param paymentPolicy "None", "All", or "Difference". Difference pays into the stash the exact amount needed to open the dungeon.
|
|
47
|
+
*/
|
|
48
|
+
export function open(dungeon, paymentPolicy = "Difference") {
|
|
49
|
+
const pageText = visitUrl("clan_basement.php");
|
|
50
|
+
if (pageText.includes(dungeon.openImage))
|
|
51
|
+
return true;
|
|
52
|
+
const clan = Clan.get();
|
|
53
|
+
if (paymentPolicy === "All") {
|
|
54
|
+
clan.putMeatInCoffer(dungeon.openCost);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const stashMeat = clan.getMeatInCoffer();
|
|
58
|
+
const payDifference = dungeon.openCost - stashMeat;
|
|
59
|
+
if (payDifference > 0) {
|
|
60
|
+
if (paymentPolicy === "None")
|
|
61
|
+
return false;
|
|
62
|
+
clan.putMeatInCoffer(payDifference);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
visitUrl(`clan_basement.php?action=${dungeon.openAction}`, true);
|
|
66
|
+
return visitUrl("clan_basement.php").includes(dungeon.openImage);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates dungeon object for managing clan dungeons
|
|
70
|
+
* @param name Name of the dungeon in question
|
|
71
|
+
* @param loot Distributable loot dropped by bosses in dungeon
|
|
72
|
+
* @param openAction String action used in form submission to open dungeon
|
|
73
|
+
* @param closeAction String action used in form submission to close dungeon
|
|
74
|
+
* @param openCost Meat cost of opening dungeon
|
|
75
|
+
* @param openImage Image text to search clan_basement.php for to check if dungeon is open
|
|
76
|
+
* @param closedImage Image text to search clan_basement.php for to check if dungeon is closed
|
|
77
|
+
*/
|
|
78
|
+
function createDungeon(name, loot, openAction, closeAction, openCost, openImage, closedImage) {
|
|
79
|
+
return {
|
|
80
|
+
name: name,
|
|
81
|
+
loot: loot,
|
|
82
|
+
openAction: openAction,
|
|
83
|
+
closeAction: closeAction,
|
|
84
|
+
openCost: openCost,
|
|
85
|
+
openImage: openImage,
|
|
86
|
+
closedImage: closedImage,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export const Dreadsylvania = createDungeon("Dreadsylvania", $items `Great Wolf's headband, Great Wolf's right paw, Great Wolf's left paw, Great Wolf's lice, Great Wolf's rocket launcher, Great Wolf's beastly trousers, Drapes-You-Regally, Warms-Your-Tush, Covers-Your-Head, Protects-Your-Junk, Quiets-Your-Steps, Helps-You-Sleep, Mayor Ghost's khakis, Mayor Ghost's cloak, Mayor Ghost's toupee, Mayor Ghost's scissors, Mayor Ghost's sash, Mayor Ghost's gavel, zombie mariachi hat, zombie accordion, zombie mariachi pants, HOA regulation book, HOA zombie eyes, HOA citation pad, Unkillable Skeleton's skullcap, Unkillable Skeleton's shinguards, Unkillable Skeleton's breastplate, Unkillable Skeleton's shield, Unkillable Skeleton's sawsword, Unkillable Skeleton's restless leg, skull capacitor, Thunkula's drinking cap, Drunkula's silky pants, Drunkula's cape, Drunkula's ring of haze, Drunkula's wineglass, Drunkula's bell, bottle of Bloodweiser, bottle of Bloodweiser, bottle of Bloodweiser, bottle of Bloodweiser, electric Kool-Aid, electric Kool-Aid, electric Kool-Aid, electric Kool-Aid, ghost pepper, ghost pepper, ghost pepper, ghost pepper, Gets-You-Drunk, Gets-You-Drunk, Gets-You-Drunk, Gets-You-Drunk, wriggling severed nose, wriggling severed nose, wriggling severed nose, wriggling severed nose, Hunger™ Sauce, Hunger™ Sauce, Hunger™ Sauce, Hunger™ Sauce`, "translatemap", "foldmap", 1000000, "dvmap.gif", "foldmap.gif");
|
|
90
|
+
export const Hobopolis = createDungeon("Hobopolis", $items `Ol' Scratch's ash can, Ol' Scratch's ol' britches, Ol' Scratch's stovepipe hat, Ol' Scratch's infernal pitchfork, Ol' Scratch's manacles, Ol' Scratch's stove door, Frosty's carrot, Frosty's nailbat, Frosty's old silk hat, Frosty's arm, Frosty's iceball, Frosty's snowball sack, Oscus's dumpster waders, Oscus's pelt, Wand of Oscus, Oscus's flypaper pants, Oscus's garbage can lid, Oscus's neverending soda, Zombo's grievous greaves, Zombo's shield, Zombo's skullcap, Zombo's empty eye, Zombo's shoulder blade, Zombo's skull ring, Chester's bag of candy, Chester's cutoffs, Chester's moustache, Chester's Aquarius medallion, Chester's muscle shirt, Chester's sunglasses, Hodgman's bow tie, Hodgman's porkpie hat, Hodgman's lobsterskin pants, Hodgman's almanac, Hodgman's lucky sock, Hodgman's metal detector, Hodgman's varcolac paw, Hodgman's harmonica, Hodgman's garbage sticker, Hodgman's cane, Hodgman's whackin' stick, Hodgman's disgusting technicolor overcoat, Hodgman's imaginary hamster`, "cleansewer", "floodsewer", 1000000, "opengrate.gif", "sewergrate.gif");
|
|
91
|
+
export const SlimeTube = createDungeon("The Slime Tube", $items `slime-soaked brain, slime-soaked hypophysis, slime-soaked sweat gland, squirming Slime larva, caustic slime nodule, caustic slime nodule, hardened slime belt, hardened slime hat, hardened slime pants`, "cleanspot", "sealtube", 250000, "slimehole.gif", "greasespot.gif");
|
|
92
|
+
export function findLoot(dungeon) {
|
|
93
|
+
const returnValue = new Map();
|
|
94
|
+
const pageText = visitUrl("clan_basement.php");
|
|
95
|
+
for (const lootItem of dungeon.loot) {
|
|
96
|
+
returnValue.set(lootItem, pageText.match(new RegExp(lootItem.name, "g"))?.length ?? 0);
|
|
97
|
+
}
|
|
98
|
+
return returnValue;
|
|
99
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function close(): boolean;
|
|
2
|
+
export declare function open(paymentPolicy?: "None" | "All" | "Difference"): boolean;
|
|
3
|
+
export declare function distribute(idOrName?: number | string, loot?: Item | Item[] | Map<Item, number>, distributeAllOfAGivenItem?: boolean): void;
|
|
4
|
+
export declare function findLoot(): Map<Item, number>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { myId } from "kolmafia";
|
|
2
|
+
import { close as closeDungeon, distribute as distributeDungeon, findLoot as findLootDungeon, Hobopolis, open as openDungeon, } from "./Dungeon";
|
|
3
|
+
export function close() {
|
|
4
|
+
return closeDungeon(Hobopolis);
|
|
5
|
+
}
|
|
6
|
+
export function open(paymentPolicy = "Difference") {
|
|
7
|
+
return openDungeon(Hobopolis, paymentPolicy);
|
|
8
|
+
}
|
|
9
|
+
export function distribute(idOrName = myId(), loot = Hobopolis.loot, distributeAllOfAGivenItem = true) {
|
|
10
|
+
distributeDungeon(Hobopolis, idOrName, loot, distributeAllOfAGivenItem);
|
|
11
|
+
}
|
|
12
|
+
export function findLoot() {
|
|
13
|
+
return findLootDungeon(Hobopolis);
|
|
14
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function close(): boolean;
|
|
2
|
+
export declare function open(paymentPolicy?: "None" | "All" | "Difference"): boolean;
|
|
3
|
+
export declare function distribute(idOrName?: number | string, loot?: Item | Item[] | Map<Item, number>, distributeAllOfAGivenItem?: boolean): void;
|
|
4
|
+
export declare function findLoot(): Map<Item, number>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { myId } from "kolmafia";
|
|
2
|
+
import { close as closeDungeon, distribute as distributeDungeon, findLoot as findLootDungeon, open as openDungeon, SlimeTube, } from "./Dungeon";
|
|
3
|
+
export function close() {
|
|
4
|
+
return closeDungeon(SlimeTube);
|
|
5
|
+
}
|
|
6
|
+
export function open(paymentPolicy = "Difference") {
|
|
7
|
+
return openDungeon(SlimeTube, paymentPolicy);
|
|
8
|
+
}
|
|
9
|
+
export function distribute(idOrName = myId(), loot = SlimeTube.loot, distributeAllOfAGivenItem = true) {
|
|
10
|
+
distributeDungeon(SlimeTube, idOrName, loot, distributeAllOfAGivenItem);
|
|
11
|
+
}
|
|
12
|
+
export function findLoot() {
|
|
13
|
+
return findLootDungeon(SlimeTube);
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Macro } from "./combat";
|
|
2
|
+
import { Requirement } from "./maximize";
|
|
3
|
+
export declare type AdventureOptions = {
|
|
4
|
+
equipmentRequirements?: () => Requirement;
|
|
5
|
+
preparation?: () => boolean;
|
|
6
|
+
location?: () => Location;
|
|
7
|
+
macro?: () => Macro;
|
|
8
|
+
familiar?: () => Familiar;
|
|
9
|
+
available?: () => boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare type FreeRunOptions = {
|
|
12
|
+
equipmentRequirements?: () => Requirement;
|
|
13
|
+
preparation?: () => boolean;
|
|
14
|
+
familiar?: () => Familiar;
|
|
15
|
+
};
|
|
16
|
+
export declare class FreeRun {
|
|
17
|
+
name: string;
|
|
18
|
+
available: () => boolean;
|
|
19
|
+
macro: Macro;
|
|
20
|
+
options?: FreeRunOptions;
|
|
21
|
+
constructor(name: string, available: () => boolean, macro: Macro, options?: FreeRunOptions);
|
|
22
|
+
}
|
|
23
|
+
export declare function findFreeRun(useFamiliar?: boolean, buyStuff?: boolean): FreeRun | undefined;
|
package/dist/freerun.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { cliExecute, mallPrice, restoreMp, retrieveItem, visitUrl, } from "kolmafia";
|
|
2
|
+
import { Macro } from "./combat";
|
|
3
|
+
import { ensureEffect, getFoldGroup, getSongCount, getSongLimit, have, } from "./lib";
|
|
4
|
+
import { Requirement } from "./maximize";
|
|
5
|
+
import { get } from "./property";
|
|
6
|
+
import { Bandersnatch } from "./resources";
|
|
7
|
+
import { $effect, $familiar, $item, $items, $skill } from "./template-string";
|
|
8
|
+
export class FreeRun {
|
|
9
|
+
constructor(name, available, macro, options) {
|
|
10
|
+
this.name = name;
|
|
11
|
+
this.available = available;
|
|
12
|
+
this.macro = macro;
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const freeRuns = [
|
|
17
|
+
new FreeRun("Bander", () => have($familiar `Frumious Bandersnatch`) &&
|
|
18
|
+
(have($effect `Ode to Booze`) || getSongCount() < getSongLimit()) &&
|
|
19
|
+
Bandersnatch.getRemainingRunaways() > 0, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).step("runaway"), {
|
|
20
|
+
equipmentRequirements: () => new Requirement(["Familiar Weight"], {}),
|
|
21
|
+
preparation: () => {
|
|
22
|
+
ensureEffect($effect `Ode to Booze`);
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
familiar: () => $familiar `Frumious Bandersnatch`,
|
|
26
|
+
}),
|
|
27
|
+
new FreeRun("Boots", () => have($familiar `Pair of Stomping Boots`) &&
|
|
28
|
+
Bandersnatch.getRemainingRunaways() > 0, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).step("runaway"), {
|
|
29
|
+
equipmentRequirements: () => new Requirement(["Familiar Weight"], {}),
|
|
30
|
+
familiar: () => $familiar `Pair of Stomping Boots`,
|
|
31
|
+
}),
|
|
32
|
+
new FreeRun("Snokebomb", () => get("_snokebombUsed") < 3 && have($skill `Snokebomb`), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill($skill `Snokebomb`), {
|
|
33
|
+
preparation: () => restoreMp(50),
|
|
34
|
+
}),
|
|
35
|
+
new FreeRun("Hatred", () => get("_feelHatredUsed") < 3 && have($skill `Emotionally Chipped`), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill($skill `Feel Hatred`)),
|
|
36
|
+
new FreeRun("KGB", () => have($item `Kremlin's Greatest Briefcase`) &&
|
|
37
|
+
get("_kgbTranquilizerDartUses") < 3, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill($skill `KGB tranquilizer dart`), {
|
|
38
|
+
equipmentRequirements: () => new Requirement([], {
|
|
39
|
+
forceEquip: $items `Kremlin's Greatest Briefcase`,
|
|
40
|
+
}),
|
|
41
|
+
}),
|
|
42
|
+
new FreeRun("Latte", () => have($item `latte lovers member's mug`) && !get("_latteBanishUsed"), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill("Throw Latte on Opponent"), {
|
|
43
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `latte lovers member's mug` }),
|
|
44
|
+
}),
|
|
45
|
+
new FreeRun("Docbag", () => have($item `Lil' Doctor™ bag`) && get("_reflexHammerUsed") < 3, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill($skill `Reflex Hammer`), {
|
|
46
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `Lil' Doctor™ bag` }),
|
|
47
|
+
}),
|
|
48
|
+
new FreeRun("Middle Finger", () => have($item `mafia middle finger ring`) &&
|
|
49
|
+
!get("_mafiaMiddleFingerRingUsed"), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill($skill `Show them your ring`), {
|
|
50
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `mafia middle finger ring` }),
|
|
51
|
+
}),
|
|
52
|
+
new FreeRun("VMask", () => have($item `V for Vivala mask`) && !get("_vmaskBanisherUsed"), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill($skill `Creepy Grin`), {
|
|
53
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `V for Vivala mask` }),
|
|
54
|
+
preparation: () => restoreMp(30),
|
|
55
|
+
}),
|
|
56
|
+
new FreeRun("Stinkeye", () => getFoldGroup($item `stinky cheese diaper`).some((item) => have(item)) &&
|
|
57
|
+
!get("_stinkyCheeseBanisherUsed"), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill("Give Your Opponent the Stinkeye"), {
|
|
58
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `stinky cheese eye` }),
|
|
59
|
+
preparation: () => {
|
|
60
|
+
if (!have($item `stinky cheese eye`))
|
|
61
|
+
cliExecute(`fold stinky cheese eye`);
|
|
62
|
+
return have($item `stinky cheese eye`);
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
65
|
+
new FreeRun("Navel Ring", () => have($item `navel ring of navel gazing`) && get("_navelRunaways") < 3, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).step("runaway"), {
|
|
66
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `navel ring of navel gazing` }),
|
|
67
|
+
}),
|
|
68
|
+
new FreeRun("GAP", () => have($item `Greatest American Pants`) && get("_navelRunaways") < 3, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).step("runaway"), {
|
|
69
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `Greatest American Pants` }),
|
|
70
|
+
}),
|
|
71
|
+
new FreeRun("Scrapbook", () => {
|
|
72
|
+
visitUrl("desc_item.php?whichitem=463063785");
|
|
73
|
+
return have($item `familiar scrapbook`) && get("scrapbookCharges") >= 100;
|
|
74
|
+
}, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).skill("Show Your Boring Familiar Pictures"), {
|
|
75
|
+
equipmentRequirements: () => new Requirement([], { forceEquip: $items `familiar scrapbook` }),
|
|
76
|
+
}),
|
|
77
|
+
new FreeRun("Parasol", () => have($item `peppermint parasol`) &&
|
|
78
|
+
get("parasolUsed") < 9 &&
|
|
79
|
+
get("_navelRunaways") < 3, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).item($item `peppermint parasol`)),
|
|
80
|
+
];
|
|
81
|
+
function cheapestRunSource() {
|
|
82
|
+
return $items `Louder Than Bomb, divine champagne popper, tennis ball`.sort((a, b) => mallPrice(a) - mallPrice(b))[0];
|
|
83
|
+
}
|
|
84
|
+
function cheapestItemRun() {
|
|
85
|
+
const cheapestRun = cheapestRunSource();
|
|
86
|
+
return new FreeRun("Cheap Combat Item", () => retrieveItem(cheapestRun), Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`).item(cheapestRunSource()), {
|
|
87
|
+
preparation: () => retrieveItem(cheapestRun),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
export function findFreeRun(useFamiliar = true, buyStuff = true) {
|
|
91
|
+
return (freeRuns.find((run) => run.available() && (useFamiliar || run?.options?.familiar)) ?? (buyStuff ? cheapestItemRun() : undefined));
|
|
92
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./ascend";
|
|
2
2
|
export * from "./Clan";
|
|
3
3
|
export * from "./combat";
|
|
4
|
-
export * from "./Dungeon";
|
|
5
4
|
export * from "./lib";
|
|
6
5
|
export * from "./maximize";
|
|
7
6
|
export * from "./mood";
|
|
@@ -13,4 +12,10 @@ export * from "./Path";
|
|
|
13
12
|
export { default as logger, LogLevel } from "./logger";
|
|
14
13
|
export * as console from "./console";
|
|
15
14
|
export * as property from "./property";
|
|
15
|
+
export * from "./utils";
|
|
16
16
|
export { get, PropertiesManager, set, setProperties, withProperties, withProperty, withChoices, withChoice, } from "./property";
|
|
17
|
+
export { get as getModifier } from "./modifier";
|
|
18
|
+
export * from "./freerun";
|
|
19
|
+
export * as Dreadsylvania from "./dungeons/Dreadsylvania";
|
|
20
|
+
export * as Hobopolis from "./dungeons/Hobopolis";
|
|
21
|
+
export * as SlimeTube from "./dungeons/SlimeTube";
|
package/dist/index.js
CHANGED
|
@@ -1,263 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
withChoice: true,
|
|
23
|
-
property: true
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "Kmail", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _Kmail.default;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "logger", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function get() {
|
|
34
|
-
return _logger.default;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "LogLevel", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function get() {
|
|
40
|
-
return _logger.LogLevel;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(exports, "get", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function get() {
|
|
46
|
-
return _property.get;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(exports, "PropertiesManager", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function get() {
|
|
52
|
-
return _property.PropertiesManager;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(exports, "set", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function get() {
|
|
58
|
-
return _property.set;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, "setProperties", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function get() {
|
|
64
|
-
return _property.setProperties;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(exports, "withProperties", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function get() {
|
|
70
|
-
return _property.withProperties;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(exports, "withProperty", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function get() {
|
|
76
|
-
return _property.withProperty;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, "withChoices", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function get() {
|
|
82
|
-
return _property.withChoices;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "withChoice", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function get() {
|
|
88
|
-
return _property.withChoice;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
exports.property = exports.console = void 0;
|
|
92
|
-
|
|
93
|
-
var _ascend = require("./ascend");
|
|
94
|
-
|
|
95
|
-
Object.keys(_ascend).forEach(function (key) {
|
|
96
|
-
if (key === "default" || key === "__esModule") return;
|
|
97
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
98
|
-
if (key in exports && exports[key] === _ascend[key]) return;
|
|
99
|
-
Object.defineProperty(exports, key, {
|
|
100
|
-
enumerable: true,
|
|
101
|
-
get: function get() {
|
|
102
|
-
return _ascend[key];
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
var _Clan = require("./Clan");
|
|
108
|
-
|
|
109
|
-
Object.keys(_Clan).forEach(function (key) {
|
|
110
|
-
if (key === "default" || key === "__esModule") return;
|
|
111
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
112
|
-
if (key in exports && exports[key] === _Clan[key]) return;
|
|
113
|
-
Object.defineProperty(exports, key, {
|
|
114
|
-
enumerable: true,
|
|
115
|
-
get: function get() {
|
|
116
|
-
return _Clan[key];
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
var _combat = require("./combat");
|
|
122
|
-
|
|
123
|
-
Object.keys(_combat).forEach(function (key) {
|
|
124
|
-
if (key === "default" || key === "__esModule") return;
|
|
125
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
126
|
-
if (key in exports && exports[key] === _combat[key]) return;
|
|
127
|
-
Object.defineProperty(exports, key, {
|
|
128
|
-
enumerable: true,
|
|
129
|
-
get: function get() {
|
|
130
|
-
return _combat[key];
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
var _Dungeon = require("./Dungeon");
|
|
136
|
-
|
|
137
|
-
Object.keys(_Dungeon).forEach(function (key) {
|
|
138
|
-
if (key === "default" || key === "__esModule") return;
|
|
139
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
140
|
-
if (key in exports && exports[key] === _Dungeon[key]) return;
|
|
141
|
-
Object.defineProperty(exports, key, {
|
|
142
|
-
enumerable: true,
|
|
143
|
-
get: function get() {
|
|
144
|
-
return _Dungeon[key];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
var _lib = require("./lib");
|
|
150
|
-
|
|
151
|
-
Object.keys(_lib).forEach(function (key) {
|
|
152
|
-
if (key === "default" || key === "__esModule") return;
|
|
153
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
154
|
-
if (key in exports && exports[key] === _lib[key]) return;
|
|
155
|
-
Object.defineProperty(exports, key, {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
get: function get() {
|
|
158
|
-
return _lib[key];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
var _maximize = require("./maximize");
|
|
164
|
-
|
|
165
|
-
Object.keys(_maximize).forEach(function (key) {
|
|
166
|
-
if (key === "default" || key === "__esModule") return;
|
|
167
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
168
|
-
if (key in exports && exports[key] === _maximize[key]) return;
|
|
169
|
-
Object.defineProperty(exports, key, {
|
|
170
|
-
enumerable: true,
|
|
171
|
-
get: function get() {
|
|
172
|
-
return _maximize[key];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
var _mood = require("./mood");
|
|
178
|
-
|
|
179
|
-
Object.keys(_mood).forEach(function (key) {
|
|
180
|
-
if (key === "default" || key === "__esModule") return;
|
|
181
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
182
|
-
if (key in exports && exports[key] === _mood[key]) return;
|
|
183
|
-
Object.defineProperty(exports, key, {
|
|
184
|
-
enumerable: true,
|
|
185
|
-
get: function get() {
|
|
186
|
-
return _mood[key];
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
var _resources = require("./resources");
|
|
192
|
-
|
|
193
|
-
Object.keys(_resources).forEach(function (key) {
|
|
194
|
-
if (key === "default" || key === "__esModule") return;
|
|
195
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
196
|
-
if (key in exports && exports[key] === _resources[key]) return;
|
|
197
|
-
Object.defineProperty(exports, key, {
|
|
198
|
-
enumerable: true,
|
|
199
|
-
get: function get() {
|
|
200
|
-
return _resources[key];
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
var _since = require("./since");
|
|
206
|
-
|
|
207
|
-
Object.keys(_since).forEach(function (key) {
|
|
208
|
-
if (key === "default" || key === "__esModule") return;
|
|
209
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
210
|
-
if (key in exports && exports[key] === _since[key]) return;
|
|
211
|
-
Object.defineProperty(exports, key, {
|
|
212
|
-
enumerable: true,
|
|
213
|
-
get: function get() {
|
|
214
|
-
return _since[key];
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
var _templateString = require("./template-string");
|
|
220
|
-
|
|
221
|
-
Object.keys(_templateString).forEach(function (key) {
|
|
222
|
-
if (key === "default" || key === "__esModule") return;
|
|
223
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
224
|
-
if (key in exports && exports[key] === _templateString[key]) return;
|
|
225
|
-
Object.defineProperty(exports, key, {
|
|
226
|
-
enumerable: true,
|
|
227
|
-
get: function get() {
|
|
228
|
-
return _templateString[key];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
var _Kmail = _interopRequireDefault(require("./Kmail"));
|
|
234
|
-
|
|
235
|
-
var _Path = require("./Path");
|
|
236
|
-
|
|
237
|
-
Object.keys(_Path).forEach(function (key) {
|
|
238
|
-
if (key === "default" || key === "__esModule") return;
|
|
239
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
240
|
-
if (key in exports && exports[key] === _Path[key]) return;
|
|
241
|
-
Object.defineProperty(exports, key, {
|
|
242
|
-
enumerable: true,
|
|
243
|
-
get: function get() {
|
|
244
|
-
return _Path[key];
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
var _logger = _interopRequireWildcard(require("./logger"));
|
|
250
|
-
|
|
251
|
-
var _console = _interopRequireWildcard(require("./console"));
|
|
252
|
-
|
|
253
|
-
exports.console = _console;
|
|
254
|
-
|
|
255
|
-
var _property = _interopRequireWildcard(require("./property"));
|
|
256
|
-
|
|
257
|
-
exports.property = _property;
|
|
258
|
-
|
|
259
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
260
|
-
|
|
261
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
262
|
-
|
|
263
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
export * from "./ascend";
|
|
2
|
+
export * from "./Clan";
|
|
3
|
+
export * from "./combat";
|
|
4
|
+
export * from "./lib";
|
|
5
|
+
export * from "./maximize";
|
|
6
|
+
export * from "./mood";
|
|
7
|
+
export * from "./resources";
|
|
8
|
+
export * from "./since";
|
|
9
|
+
export * from "./template-string";
|
|
10
|
+
export { default as Kmail } from "./Kmail";
|
|
11
|
+
export * from "./Path";
|
|
12
|
+
export { default as logger } from "./logger";
|
|
13
|
+
export * as console from "./console";
|
|
14
|
+
export * as property from "./property";
|
|
15
|
+
export * from "./utils";
|
|
16
|
+
export { get, PropertiesManager, set, setProperties, withProperties, withProperty, withChoices, withChoice, } from "./property";
|
|
17
|
+
export { get as getModifier } from "./modifier";
|
|
18
|
+
export * from "./freerun";
|
|
19
|
+
export * as Dreadsylvania from "./dungeons/Dreadsylvania";
|
|
20
|
+
export * as Hobopolis from "./dungeons/Hobopolis";
|
|
21
|
+
export * as SlimeTube from "./dungeons/SlimeTube";
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @module GeneralLibrary */
|
|
2
|
+
import "core-js/modules/es.object.entries";
|
|
1
3
|
/**
|
|
2
4
|
* Returns the current maximum Accordion Thief songs the player can have in their head
|
|
3
5
|
*
|
|
@@ -222,3 +224,44 @@ export declare type Player = {
|
|
|
222
224
|
* @returns Object containing id and name of player
|
|
223
225
|
*/
|
|
224
226
|
export declare function getPlayerFromIdOrName(idOrName: number | string): Player;
|
|
227
|
+
/**
|
|
228
|
+
* Return the step as a number for a given quest property.
|
|
229
|
+
*
|
|
230
|
+
* @param questName Name of quest property to check.
|
|
231
|
+
*/
|
|
232
|
+
export declare function questStep(questName: string): number;
|
|
233
|
+
export declare class EnsureError extends Error {
|
|
234
|
+
constructor(cause: Item | Familiar | Effect);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Tries to get an effect using the default method
|
|
238
|
+
* @param ef effect to try to get
|
|
239
|
+
* @param turns turns to aim for; default of 1
|
|
240
|
+
*/
|
|
241
|
+
export declare function ensureEffect(ef: Effect, turns?: number): void;
|
|
242
|
+
/**
|
|
243
|
+
* Returns the average value--based on mallprice and autosell--of a collection of items
|
|
244
|
+
* @param items items whose value you care about
|
|
245
|
+
*/
|
|
246
|
+
export declare function getSaleValue(...items: Item[]): number;
|
|
247
|
+
export declare const Environment: {
|
|
248
|
+
readonly Outdoor: "outdoor";
|
|
249
|
+
readonly Indoor: "indoor";
|
|
250
|
+
readonly Underground: "underground";
|
|
251
|
+
readonly Underwater: "underwater";
|
|
252
|
+
};
|
|
253
|
+
export declare type EnvironmentType = typeof Environment[keyof typeof Environment];
|
|
254
|
+
/**
|
|
255
|
+
* Returns the weight-coefficient of any leprechaunning that this familiar may find itself doing
|
|
256
|
+
* Assumes the familiar is nude and thus fails for hatrack & pantsrack
|
|
257
|
+
* For the Mutant Cactus Bud, returns the efficacy-multiplier instead
|
|
258
|
+
* @param familiar The familiar whose leprechaun multiplier you're interested in
|
|
259
|
+
*/
|
|
260
|
+
export declare function findLeprechaunMultiplier(familiar: Familiar): number;
|
|
261
|
+
/**
|
|
262
|
+
* Returns the weight-coefficient of any baby gravy fairying that this familiar may find itself doing
|
|
263
|
+
* Assumes the familiar is nude and thus fails for hatrack & pantsrack
|
|
264
|
+
* For the Mutant Fire Ant, returns the efficacy-multiplier instead
|
|
265
|
+
* @param familiar The familiar whose fairy multiplier you're interested in
|
|
266
|
+
*/
|
|
267
|
+
export declare function findFairyMultiplier(familiar: Familiar): number;
|