打开/关闭搜索
搜索
打开/关闭菜单
331
1.7K
131
11.8K
星露谷物语扩展百科
导航
首页
最近更改
随机页面
交流群
互通站
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁模块:Object”︁的源代码
来自星露谷物语扩展百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Object
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:已验证邮箱用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local Helper = require("Module:Helper") local FishPondData = Helper.LazyLoad('Module:Object/Data') local p = {} -- =p.getFieldsById{ args = { "137"} } -- mw.logObject(p.getFieldsById{ args = { "137"} }) function p.getFieldsById(frame) local id = frame.args[1] local item = FishPondData[id] if not item then return "Error: ID not found." end return { Name = item.Name, Type = item.Type, Category = item.Category, Price = item.Price, ContextTags = item.ContextTags } end -- =p.getFirstFishTagById{ args = { "137"} } -- mw.logObject(p.getFirstFishTagById{ args = { "137"} }) function p.getFirstFishTagById(frame) local id = frame.args[1] local item = FishPondData[id] if not item or not item.ContextTags then return "" end for _, tag in ipairs(item.ContextTags) do if tag:match("^fish_") and tag ~= "fish_has_roe" and tag ~= "fish_pond" then return tag end end return "" end function p.getIdByName(frame) local name = mw.ustring.lower(frame.args[1]) for id, item in pairs(FishPondData) do if mw.ustring.lower(item.Name) == name then mw.logObject(id) -- !!! return id end end return "Error: Name not found." end -- =p.getFieldsByName{ args = { "Smallmouth Bass"} } -- mw.logObject(p.getFieldsByName{ args = { "Smallmouth Bass"} }) function p.getFieldsByName(frame) local id = p.getIdByName({ args = { frame.args[1] } }) local name = mw.ustring.lower(frame.args[1]) if id then return p.getFieldsById({ args = { id } }) end return "Error: Name not found." end -- mw.logObject(p.getPriceById{ args = { "137"} }) function p.getPriceById(frame) return p.getFieldsById({ args = { frame.args[1] } })["Price"] end -- mw.logObject(p.getPriceByName{ args = { "Smallmouth Bass"} }) function p.getPriceByName(frame) local id = p.getIdByName({ args = { frame.args[1] } }) return p.getPriceById({ args = { id } }) end return p
该页面嵌入的页面:
模块:Documentation
(
查看源代码
)
模块:Documentation/styles.css
(
查看源代码
)
模块:Object/doc
(
查看源代码
)
模块:ProcessArgs
(
查看源代码
)
模块:STConversion
(
查看源代码
)
模块:Static
(
查看源代码
)
模块:TSLoader
(
查看源代码
)
返回
模块:Object
。
查看“︁模块:Object”︁的源代码
来自星露谷物语扩展百科