Module:ItemData: Difference between revisionsGive feedback
Created page with "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 end --{{#invoke:ItemData|get_cost|ITEM_NAME}}-- p.get_cost = function(frame) local item_name = frame.args[1] local item = get_json_item(item_name) return item["Cost"] end --{{#invoke:ItemData|get_type|ITEM_NAME}}-- p.get_type = function(frame) local..." |
mNo edit summary |
||
| Line 1: | Line 1: | ||
local p = {}; | local p = {}; | ||
local data = mw. | local data = mw.loadJsonData("Data:ItemData.json") | ||
-- returns the table of a specific item | -- returns the table of a specific item | ||