Scooby Wiki
Main site ↗

Lua scripts and game API

Use the dedicated Lua tab, Megabonk API, run HUD and pickup examples.

Run a script

  1. Open Lua → Scripts. Your scripts are stored in C:/Scooby/Megabonk/scripts.
  2. Select a script and click Run, or open it in Lua Editor.
  3. Use Console for output and errors, and the editor’s API docs for signatures and examples.
  4. Stop the script to remove its callbacks and cancel its remaining owned action batch.

Existing legacy scripts remain in their separate runtime at C:/scooby/UI/UI-scripts, under Lua → Existing scripts.

Megabonk API 1.1

Use megabonk.settings for the 36 stable feature IDs; megabonk.pickups() and megabonk.catalog() for content; and queued spawn, item, XP collection and unlock functions for actions. The canonical features, events, ui, widgets, imgui, render and engine APIs are also available.

megabonk.player() and megabonk.run() return copied player/run data for health, shield, level, XP, gold, counters and time. They return nil when a fresh active-run snapshot is unavailable.

ui.overlay('my_run_hud', function()
    local run = megabonk.run()
    if not run then return end
    render.text(24, 80, string.format('HP %d/%d | Gold %d',
        run.player.hp, run.player.max_hp, run.player.gold_int),
        {1, 1, 1, 1}, 16)
end)

Download the examples

Download the complete Megabonk Lua reference

Accepted actions are queued, not completed. Check megabonk.action_status() for progress. Stopping or reloading only cancels the script’s remaining work; already granted items and saved unlocks stay applied.

Search setup instructions, troubleshooting, and account help.

Type to search · Enter to open first result · Esc to close