npm version npm downloads license: MIT
Open‐source mixing calculator for Schedule 1.
# npm npm install @schedule1-tools/mixer # yarn yarn add @schedule1-tools/mixer # pnpm pnpm add @schedule1-tools/mixer
import { mixSubstances } from '@schedule1-tools/mixer'; /** * mixSubstances(product: Product, substances: Substance[]) * → computes cost, effects, profit, profitMargin, addiction */ const result = mixSubstances('OG Kush', ['Cuke', 'Flu Medicine', 'Gasoline']); // result → { // effects: ['Be','Se','Eu','To'], // cost: 12, // sellPrice: 64, // profit: 52, // profitMargin: 0.81, // addiction: 0.44 // }
import { mixFromHash } from '@schedule1-tools/mixer'; /** * mixFromHash(hash: string) * → decode & compute a mix from its shared hash form */ const result = mixFromHash('T0cgS3VzaDpBQkM'); // result → { // effects: ['Be','Se','Eu','To'], // cost: 12, // sellPrice: 64, // profit: 52, // profitMargin: 0.81, // addiction: 0.44 // }
import { decodeMixState, encodeMixState } from '@schedule1-tools/mixer'; /** * encodeMixState(state: MixState) → string * decodeMixState(hash: string) → MixState */ const encoded = encodeMixState({ product: 'OG Kush', substances: ['Cuke', 'Flu Medicine', 'Gasoline'], }); // encoded → 'T0cgS3VzaDpBQkM' const decoded = decodeMixState(encoded); // decoded → { product: 'OG Kush', substances: [...] }
import { migrateMixHash } from '@schedule1-tools/mixer'; /** * migrateMixHash(legacyHash: string): Promise<string|null> * → upgrade legacy LZ‐String hash to the new format */ const newHash = await migrateMixHash('OLD_BASE64_HASH_HERE'); // newHash → 'T0cgS3VzaDpBQkM' (or null if invalid)
In addition to the functions above, the package also exports data objects:
effects: All effect definitionsproducts: All product definitionssubstances: All substance definitionseffectRulesBySubstance: Transformation rules for each substance
import { effectRulesBySubstance, effects, products, substances } from '@schedule1-tools/mixer';
- Fork the repo
- Create a branch (
git checkout -b feat/my-feature) - Run tests & lint (
pnpm test && pnpm run format) - Open a PR against
main
Please read CONTRIBUTING.md (if present) for more details.
MIT © Schedule1 Tools
See LICENSE for details.
This is a fan‐made project and is not affiliated with, authorized, maintained, sponsored, or endorsed by the developers of Schedule I the game. All game‐related content (names, trademarks, etc.) belongs to its respective owners.