Module:Having: Difference between revisions
No edit summary |
No edit summary |
||
| (10 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local function ugh(x) | local function ugh(x) if x == true then return x else return nil,x.error end end | ||
function p. | function p.museum_register(frame) | ||
local aa = frame:getParent().args | local aa = frame:getParent().args | ||
for e in aa[1]:gmatch"[^,]+" do | for e in aa[1]:gmatch"[^,]+" do | ||
| Line 9: | Line 9: | ||
obj['Emoji'] = mw.text.trim(e) | obj['Emoji'] = mw.text.trim(e) | ||
obj['Given by'] = aa[4] | obj['Given by'] = aa[4] | ||
assert(ugh(mw.smw.subobject(obj))) end end | assert(ugh(mw.smw.subobject(obj, nil))) end end | ||
return p | return p | ||
Latest revision as of 11:24, 21 October 2025
Documentation for this module may be created at Module:Having/doc
local p = {}
local function ugh(x) if x == true then return x else return nil,x.error end end
function p.museum_register(frame)
local aa = frame:getParent().args
for e in aa[1]:gmatch"[^,]+" do
local obj = {}
obj['Had by'] = 'The Having Game/Museum'
obj['Object type'] = (aa.type or 'object')..' title'
obj['Emoji'] = mw.text.trim(e)
obj['Given by'] = aa[4]
assert(ugh(mw.smw.subobject(obj, nil))) end end
return p