Home
Random
Log in
Settings
Search
Editing
Module:Sandbox/Sylphoid
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {}; local data = mw.loadJsonData("Data:ItemData.json") -- returns the table of a specific item function get_json_item(name) for i,v in pairs(data) do if (v["Name"] == name) then return v end end return nil end --{{#invoke:Sandbox/Sylphoid|get_prop|ITEM_NAME|PROPERTY}}-- --check Data:ItemData.json for properties p.get_prop = function(frame) local shopTableValues = {} local item_name = frame.args[1] local property = frame.args[2] local item = get_json_item(item_name) if(item == nil) then return "Item Not Found" end if(type(item[property]) == "table") then for i,v in pairs(item[property]) do local shopTableValues = table.insert(shopTableValues, v) --local tableValues = get_json_item(item) end return table.concat(shopTableValues, ", ") end return item[property] --return tableValues[property] end return p
Summary:
Please note that all contributions to Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Deadlock:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:Sandbox/Sylphoid/doc
(
edit
)