Quick start
A working script in four steps.
Make a file
Create a .lua file in C:\xhook <game>\scripts\. Every file directly in that folder is one script, named after the file.
Draw something
callbacks.register("on_paint", function()
draw.text(20, 20, draw.color(255, 255, 255), "hello from lua")
end)Handlers attach through callbacks.register. A global function called on_paint never runs.
Turn it on
Open the menu, go to the Scripting tab and enable the script. Saving the file reloads it within a quarter second and keeps its menu values.
Read errors
A failing handler shows a popup and a line in the Output dock. It stays registered, so fix the file and save again.