libram: your book of magic for JavaScript

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Hi folks!

libram is a JavaScript library that intends to provide comprehensive support for automating KoLmafia. It is installable via yarn add libram or npm install libram etc. It is fully and extensively typed for TypeScript users.

It acts as a general toolbelt for dozens of things you might want to achieve in a script. The idea of libram is to universally cover bits of code that aren't big enough to merit their own library but you still find yourself writing again and again for different scripts.

Libram was actually started way back in 2020 but I never made a post here! It has since become a very mature library with many contributors.

Repo: https://github.com/loathers/libram
Docs: https://loathers.github.io/libram/

Examples of cool code you can write with libram

You can get an ash-like syntax for fetching items, effects, skills etc

JavaScript:
import { print, itemAmount } from "kolmafia";
import { $item } from "libram";

const lemon = $item`lemon`;

print(`You have ${itemAmount(lemon)} lemons!`);

Oh hey this is a smart way to work out a quest for your autumnaton

JavaScript:
import { AutumnAton } from "libram";

AutumnAton.sendTo((locations) => chooseBestLocation(locations));

And many more features that can be found at https://loathers.github.io/libram/
 
Top