Module:Item Availability: Difference between revisions
m Eleiyas moved page Module:Lootbox Availability to Module:Item Availability without leaving a redirect |
No edit summary |
||
| 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:Drop Tables') | ||
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:Item 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='Drop Tables' } ) | ||
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 Drop Tables contain ' .. item .. lib.ternary(item:find('%."?$'), '', '.')) | ||
end | end | ||
else | else | ||
return args.noresult or ('No | return args.noresult or ('No Drop Tables contain ' .. item .. lib.ternary(item:find('%."?$'), '', '.')) | ||
end | end | ||
end | end | ||