openloki
v0.1.0
Published
A lightweight plugin framework for building Tampermonkey userscript cheats
Readme
openloki
A lightweight TypeScript plugin framework for Tampermonkey userscripts. Provides lifecycle management, configuration schema, hotkey bindings, and a Svelte-based UI — you bring the game-specific runtime.
npm install openlokiMinimal example
import { Core, CoreBase, Logger } from 'openloki';
import { Feature, FeatureBase } from 'openloki';
import { Folder, FolderBase } from 'openloki';
import { props } from 'openloki';
Logger.setPrefix('MyMod');
@Core
class GameCore extends CoreBase {
onLoad() {
setInterval(() => this.tick(), 50);
setTimeout(() => this.ready(), 1000);
}
}
@Feature
class Fly extends FeatureBase<Fly> {
id = 'fly';
displayName = 'Fly';
defaultEnabled = true;
declare core: GameCore;
schema = { speed: props.number('Speed', { default: 5 }) };
onTick(ctx) { ctx.core.player.gravity = 0; }
}
@Folder
class MovementFolder extends FolderBase {
id = 'movement';
displayName = 'Movement';
features = [Fly];
}Architecture
| Decorator | Purpose |
|-----------|---------|
| @Core | Declares the game runtime (one per project) |
| @Feature| A plugin capability with lifecycle hooks |
| @Folder | Groups features in the default UI |
Features are registered automatically via @Feature. The framework
handles enable/disable, hotkey bindings, schema-based configuration,
and a default click-to-toggle UI.
License
MIT
