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:38, 27 January 2026 by Texyc (talk | contribs) (Created page with "local p = {} function p.run(frame) -- Get the code passed as the first parameter local code = frame.args[1] or "" -- Load the string as a Lua chunk -- 'load' is preferred in newer Lua versions, 'loadstring' in 5.1 local func, err = loadstring(code) if not func then return "Lua Error: " .. err end -- Execute it return func() end return p")
(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 ""
    
    -- Load the string as a Lua chunk
    -- 'load' is preferred in newer Lua versions, 'loadstring' in 5.1
    local func, err = loadstring(code)
    
    if not func then
        return "Lua Error: " .. err
    end
    
    -- Execute it
    return func()
end

return p