Toggle navigation
剑灵百科-剑灵wiki
模块
模块
讨论
查看历史
编辑源代码
操作
刷新
工具
页面信息
特殊页面
相关更改
链入页面
未登录
讨论
贡献
Toggle navigation
剑灵百科-剑灵wiki
编辑“
模块:图标
”
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
local p={} function p.expandSet(frame) local args = (frame == mw.getCurrentFrame() and frame.args) or frame local str = args['str'] or '' -- 待处理字符串 local pname = args['pname'] or '' -- 输出参数名称 if (str=='' or pname=='') then return '' end local paratable = {} local result = '' local strtable = mw.text.split(str, '、') local itemtable = {} local itemname, itemcount = '', 0 for i = 1, #strtable do itemtable = mw.text.split(strtable[i],'*') itemname = itemtable[1] paratable[#paratable+1] = itemname end local parastr = table.concat(paratable,'、') result = frame:callParserFunction{ name = '#set', args = { pname..'='..parastr,'+sep=、'} } mw.log(result) return result end function p.expandTemplate(frame) local args = (frame == mw.getCurrentFrame() and frame.args) or frame local str = args['str'] or '' -- 待处理字符串 if (str=='') then return '' end local ptype = args['ptype'] or '' -- 图标模板类型 local sep = args['sep'] or '' -- 输出的分隔符 local paratable = {} local resulttable = {} local result = '' local strtable = mw.text.split(str, '、') local itemtable = {} local itemname, itemcount = '', 0 for i = 1, #strtable do itemtable = mw.text.split(strtable[i],'*') itemname = itemtable[1] itemcount = itemtable[2] if (ptype=='') then resulttable[#resulttable+1] = frame:expandTemplate{ title = '图标', args = { itemname, itemcount} } else resulttable[#resulttable+1] = frame:expandTemplate{ title = '图标', args = { ptype, itemname, itemcount} } end end result = table.concat(resulttable,sep) mw.log(result) return result end function p.expandWeaponTemplate(frame) local args = (frame == mw.getCurrentFrame() and frame.args) or frame local str = args['str'] or '' -- 待处理字符串 if (str=='') then return '' end local sep = args['sep'] or '' -- 输出的分隔符 local paratable = {} local resulttable = {} local result = '' local strtable = mw.text.split(str, '、') local itemtable = {} local itemname, itemcount = '', 0 for i = 1, #strtable do itemtable = mw.text.split(strtable[i],'*') itemname = itemtable[1] itemcount = itemtable[2] resulttable[#resulttable+1] = frame:expandTemplate{ title = '武器图鉴/材料', args = { itemname, itemcount} } end result = table.concat(resulttable,sep) mw.log(result) return result end return p
摘要:
请注意,您对剑灵百科-剑灵wiki的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
bnswiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
模板:图标
(
编辑
)
模块:图标
(
编辑
)
模块:图标/doc
(
编辑
)