Editing Module:Item Availability
Appearance
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local Parse = require('Module:Parser').getTemplateArgs | local Parse = require('Module:Parser').getTemplateArgs | ||
local Slib = require('Module: | local Slib = require('Module:Lootbox') | ||
local lib = require('Module:Feature') | local lib = require('Module:Feature') | ||
| Line 7: | Line 7: | ||
local args = require('Module:Arguments').getArgs(frame, { | local args = require('Module:Arguments').getArgs(frame, { | ||
parentOnly = false, | parentOnly = false, | ||
wrapper = {'Template: | wrapper = {'Template:Lootbox Availability'} | ||
}) | }) | ||
local item = args[1] or mw.title.getCurrentTitle().rootText | local item = args[1] or mw.title.getCurrentTitle().rootText | ||
| Line 15: | Line 15: | ||
if lib.isNotEmpty(args.pages) then | if lib.isNotEmpty(args.pages) then | ||
for page in string.gmatch(args.pages, '(.-)%$%$%$') do | for page in string.gmatch(args.pages, '(.-)%$%$%$') do | ||
local data = Parse(page, { only=' | local data = Parse(page, { only='Lootbox' } ) | ||
local _ret = {PAGENAME = page, rows = 0} | local _ret = {PAGENAME = page, rows = 0} | ||
if type(data[1]) == 'table' then | if type(data[1]) == 'table' then | ||
| Line 40: | Line 40: | ||
return p._main(args, frame) | return p._main(args, frame) | ||
else | else | ||
return args.noresult or ('No | return args.noresult or ('No lootbox contains ' .. item .. lib.ternary(item:find('%."?$'), '', '.')) | ||
end | end | ||
else | else | ||
return args.noresult or ('No | return args.noresult or ('No lootbox contains ' .. item .. lib.ternary(item:find('%."?$'), '', '.')) | ||
end | end | ||
end | end | ||