Skip to content

Scripts

Scripts are JavaScript or Lua you run against the game right now. They’re good for poking around before you write something to keep.

In the Workbench, go to View > New script, type, and press Ctrl+Enter.

let frames = 0;
frame.onFrame(() => {
ui.window("Hello", () => ui.text("frames:", ++frames));
});

Anything it prints goes to the Console.

Switch to Lua in the script’s right-click menu runs it as Lua from then on.

frames = 0
frame.onFrame(function() frames = frames + 1 end)
timers.setInterval(function() print("frames:", frames) end, 1000)

In a script, the API is all globals in both languages, so there’s no require("wraith").

Each script runs in its own session. What it starts keeps going, so that window stays open after the script finishes.

Reset session stops everything it started and forgets its variables. Use it before running a changed script again, or you’ll get two of everything.

It’s the same API plugins get, so memory, hooks, ui and the rest are all there.

Names from the Addresses list and from tweaks that are on work too.

log.info(memory.at(addresses.get("player.health")).load("u32"));

Once you edit a script, it goes into the project as scripts/script.rws.js, or .rws.lua for Lua. Save the project to keep it. You can also Export one to a file of its own.

Made with ♥ by Asgard