Module:Price: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
local gemwname = params.default_to(args.gemwname,name) | local gemwname = params.default_to(args.gemwname,name) | ||
local smwname = params.default_to(args.smwname,name) | local smwname = params.default_to(args.smwname,name) | ||
-- Check precached Module:GEPrices/data | -- Check precached Module:GEPrices/data |
Revision as of 18:35, 3 April 2024
Documentation for this module may be created at Module:Price/doc
local p = {}
local geprices_data = mw.loadJsonData('Module:GEPrices/data.json')
function p.main( frame )
local args = frame:getParent().args
-- Params and defaults
local name,geprice = params.defaults{
{args.name or args.Name, ''},
{args.geprice or args.geprice, ''}
}
local itemvalue = ''
local gemwname = params.default_to(args.gemwname,name)
local smwname = params.default_to(args.smwname,name)
-- Check precached Module:GEPrices/data
if gemw and geprice == '' then
local cached_price = geprices_data[gemwname]
if type(cached_price) == 'number' and cached_price > 0 then
geprice = cached_price
end
end
end
return p