本WIKI编辑权限开放,如遇Chrome浏览器登陆后无法编辑点这里 BWIKI反馈留言板
全站通知:
模块:Sandbox
刷
历
编
跳到导航
跳到搜索
此模块的文档可以在模块:Sandbox/doc创建
local data = mw.text.jsonDecode(mw.title.new("用户:176414130/test.json"):getContent())
local p = {}
function p.main( frame )
local t_list = {}
local bg = ''
local bgm = ''
local effect = ''
local chara1 = ''
local chara2 = ''
local side = ''
local name = ''
local text = ''
for k, v in ipairs(data) do
if v.showType == '1' then
bg = v.showId
elseif v.showType == '4' then
bgm = v.showId
elseif v.showType == '6' then
if chara1 == ''or (chara1 ~= '' and chara2~= '') then
chara1 = v.showId
else
chara2 = v.showId
end
side = v.whichSide
elseif v.showType == '7' then
name = p.convertI(v.talkName)
text = p.convertI(v.talkValue)
side = v.whichSide
end
effect = v.effectType
table.insert(t_list,"{{沙盒|belong="..p.convertI(v.belong)
.."|coverIcon="..p.convertI(v.coverIcon)
.."|effectType="..p.convertI(v.effectType)
.."|finishTo="..p.convertI(v.finishTo)
.."|relation="..p.convertI(v.relation)
.."|showId="..p.convertI(v.showId)
.."|showType="..p.convertI(v.showType)
.."|talkId="..p.convertI(v.talkId)
.."|talkName="..p.convertI(v.talkName)
.."|talkValue="..p.convertI(v.talkValue)
.."|time="..p.convertI(v.time)
.."|whichSide="..p.convertI(v.whichSide)
.."|背景="..bg
.."|BGM="..bgm
.."|效果="..effect
.."|角色1="..chara1
.."|角色2="..chara2
.."|选中="..side
.."|名称="..name
.."|台词="..text
.."|}}")
end
return frame:preprocess(table.concat(t_list))
end
function p.convertI(str)
return string.gsub(str, "|", "<nowiki>|</nowiki>").gsub(str, "#NAME", "{{UserName}}")
end
return p