Module:Silent1/sandbox
Jump to navigation
Jump to search
local p = {} local data_module_names = { price = 'Module:MarketPrices/data' } local loaded_data_modules = {} function p.loadPrice (item, data_type) local module_name = data_module_names[data_type] if loaded_data_modules[module_name] == nil then loaded_data_modules[module_name] = mw.loadData(module_name) end return loaded_data_modules[module_name][item] end function p._price(frame) local args = frame:getParent().args local item = args[1] local multi = args[2] if multi == nil then multi = 1 end item = string.lower(item) return p.loadPrice (item, 'price') * multi end return p