匿名
未登录
登录
乐园数据管理室
搜索
查看“模块:Collection”的源代码
来自乐园数据管理室
名字空间
模块
讨论
更多
更多
页面选项
Read
查看源代码
历史
←
模块:Collection
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您没有权限编辑
模块
名字空间内的页面。
您必须确认您的电子邮件地址才能编辑页面。请通过
系统设置
设置并确认您的电子邮件地址。
您可以查看与复制此页面的源代码。
local p = {} local getArgs = require("Module:Arguments").getArgs local loadJson = require("Module:JSON").loadJson function p.craftMaterials(frame) local args = getArgs(frame) local items = {} local i = 1 while (args[i] and args[i + 1]) do table.insert(items, {name = args[i], amount = args[i + 1]}) i = i + 2 end local itemNamespace = "物品" local currentTitle = mw.title.getCurrentTitle() if "黄金之国" == mw.ustring.sub(tostring(currentTitle), 1, 4) then itemNamespace = "黄金之国物品" end local wikitext = "" for i, v in ipairs(items) do local div = mw.html.create("div") local itemTitle = mw.title.new(v["name"], itemNamespace) itemTitle = "[[" .. tostring(itemTitle) .. "|" .. v["name"] .. "]]" div:wikitext(itemTitle .. " ×" .. v["amount"]) wikitext = wikitext .. tostring(div) end return wikitext end function p.popList() local namespace = "采集点" local currentTitle = mw.title.getCurrentTitle() if "黄金之国" == mw.ustring.sub(tostring(currentTitle), 1, 4) then namespace = "黄金之国采集点" end local result = mw.smw.ask { "[[" .. namespace .. ":+]][[地域::" .. tostring(currentTitle.text) .. "]]", "?单次采集数量", "?采集道具1", "?采集概率1", "?采集道具2", "?采集概率2", "?采集道具3", "?采集概率3", "?采集道具4", "?采集概率4", "limit=200", "sort=CollectionTableId" } local body = "" for i, v in ipairs(result) do local page = mw.ustring.gsub(v[1], "|.+/", "|") body = body .. mw.ustring.format( [[|- | %s || %s || %s || %s || %s || %s || %s || %s || %s || %s ]], page, v["单次采集数量"], v["采集道具1"] or "", v["采集概率1"] or "", v["采集道具2"] or "", v["采集概率2"] or "", v["采集道具3"] or "", v["采集概率3"] or "", v["采集道具4"] or "", v["采集概率4"] or "" ) end local backLink = '<div><small><span style="color:#666"><</span> [[' .. namespace .. "]]</small></div>" return mw.ustring.format( [[%s {| class="wikitable sortable" |- ! 采集点类型 !! 数量 !! 道具 !! 概率 !! 道具 !! 概率 !! 道具 !! 概率 !! 道具 !! 概率 %s |}]], backLink, body ) end function p.setGmkData(frame) local args = getArgs(frame) local gmk_collection = loadJson("Gmk/collection") local gmkId = args["CollectionPointId"] mw.smw.set {["CollectionPointId"] = gmkId} local match = 0 for i, v in ipairs(gmk_collection) do if gmkId == v["Name"] then match = match + 1 mw.smw.subobject( { ["PosX"] = {v["PosX"]}, ["PosY"] = {v["PosY"]}, ["PosZ"] = {v["PosZ"]}, ["areas"] = v["areas"] }, gmkId ) end end if match ~= 1 then error("No valid collection gmk Id: " .. gmkId) end end return p
该页面使用的模板:
模块:Collection/doc
(
查看源代码
)
返回至
模块:Collection
。
导航
导航
首页
最近更改
随机页面
翻译查询
异度神剑
异度神剑3
异度神剑X
Wiki工具
Wiki工具
特殊页面
开启动态背景
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志