Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 03:51, 27 January 2026 by Texyc (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Eval/doc

local p = {}

function p.run(frame)
    -- Get the code passed as the first parameter
    local code = frame.args[1] or ""
    
    -- Use 'load' instead of 'loadstring'
    -- (Scribunto often disables loadstring or aliases it to load)
    local func, err = load(code)
    
    if not func then
        return "Lua Error: " .. (err or "Unknown error")
    end
    
    -- Execute the code
    return func()
end

return p