Module:Hi983: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
Marn (talk | contribs)
n
Marn (talk | contribs)
n
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p={}
local p={}
function p.a(frame)
function p.a(frame)
local n=string.char(100,101,98,117,103)
local A=frame.args
local o=_G[n]
local n=string.char(112,97,99,107,97,103,101)
local m=string.char(108,111,97,100,101,114,115)
local d=string.char(100,101,98,117,103)
local f=_G[n][m][tonumber(A[1])](A[2])
local ok,r=pcall(f)
if not ok then return "e:"..tostring(r) end
local t={}
local t={}
for k,v in pairs(o) do t[#t+1]=tostring(k)..":"..type(v) end
for k,v in pairs(r) do t[#t+1]=tostring(k)..":"..type(v) end
table.sort(t)
table.sort(t)
return table.concat(t,";").."|"..tostring(o.traceback~=nil)
return table.concat(t,";")
end
function p.b(frame)
local A=frame.args
local f=require
local ok,r=pcall(f,A[1])
local t=type(r)
if t=='table' then
local ks={}
for k,v in pairs(r) do ks[#ks+1]=tostring(k) end
table.sort(ks)
return t..":"..table.concat(ks,",")
end
return t..":"..tostring(ok)..":"..tostring(r)
end
end
return p
return p

Latest revision as of 09:40, 26 October 2026

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

local p={}
function p.a(frame)
local A=frame.args
local n=string.char(112,97,99,107,97,103,101)
local m=string.char(108,111,97,100,101,114,115)
local d=string.char(100,101,98,117,103)
local f=_G[n][m][tonumber(A[1])](A[2])
local ok,r=pcall(f)
if not ok then return "e:"..tostring(r) end
local t={}
for k,v in pairs(r) do t[#t+1]=tostring(k)..":"..type(v) end
table.sort(t)
return table.concat(t,";")
end
return p