Module:Inventory slot/Aliases: Difference between revisions

adding every single patterned banner to the alias list by slightly changing the logic. It will take a little longer to process, but that is only a fraction of a second per page, rather than per call of grid
Lets reduce repetition further.
Line 40: Line 40:
['Stone Button'] = '[Button]Stone Button',
['Stone Button'] = '[Button]Stone Button',
['Wooden Button'] = '[Button]Wooden Button',
['Wooden Button'] = '[Button]Wooden Button',
--- Discs ---
}
['13 Disc'] = '[&bMusic Disc]13 Disc[&7C418 - 13]',
 
['cat Disc'] = '[&bMusic Disc]cat Disc[&7C418 - cat]',
-- Discs --
['blocks Disc'] = '[&bMusic Disc]blocks Disc[&7C418 - blocks]',
local discs = { '13', 'cat', 'blocks', 'chirp', 'far', 'mall', 'mellohi', 'stal', 'strad', 'ward', '11', 'wait' }
['chirp Disc'] = '[&bMusic Disc]chirp Disc[&7C418 - chirp]',
for _, disc in ipairs( discs ) do
['far Disc'] = '[&bMusic Disc]far Disc[&7C418 - far]',
local name = disc .. ' Disc'
['mall Disc'] = '[&bMusic Disc]mall Disc[&7C418 - mall]',
aliases[name] = '[&bMusic Disc]' .. name .. '[&7C418 - ' .. disc .. ']'
['mellohi Disc'] = '[&bMusic Disc]mellohi Disc[&7C418 - mellohi]',
end
['stal Disc'] = '[&bMusic Disc]stal Disc[&7C418 - stal]',
['strad Disc'] = '[&bMusic Disc]strad Disc[&7C418 - strad]',
['ward Disc'] = '[&bMusic Disc]ward Disc[&7C418 - ward]',
['11 Disc'] = '[&bMusic Disc]11 Disc[&7C418 - 11]',
['wait Disc'] = '[&bMusic Disc]wait Disc[&7C418 - wait]',


-- Damaged armor, tools and weapons --
-- Damaged armor, tools and weapons --
['Damaged Bow'] = '[Bow]Damaged Bow',
local damagedItems = {
['Damaged Carrot on a Stick'] = '[Carrot on a Stick]Damaged Carrot on a Stick',
'Bow',
['Damaged Chain Boots'] = '[Chain Boots]Damaged Chain Boots',
'Carrot on a Stick',
['Damaged Chain Chestplate'] = '[Chain Chestplate]Damaged Chain Chestplate',
'Chain Boots',
['Damaged Chain Helmet'] = '[Chain Helmet]Damaged Chain Helmet',
'Chain Chestplate',
['Damaged Chain Leggings'] = '[Chain Leggings]Damaged Chain Leggings',
'Chain Helmet',
['Damaged Diamond Axe'] = '[Diamond Axe]Damaged Diamond Axe',
'Chain Leggings',
['Damaged Diamond Boots'] = '[Diamond Boots]Damaged Diamond Boots',
'Diamond Axe',
['Damaged Diamond Chestplate'] = '[Diamond Chestplate]Damaged Diamond Chestplate',
'Diamond Boots',
['Damaged Diamond Helmet'] = '[Diamond Helmet]Damaged Diamond Helmet',
'Diamond Chestplate',
['Damaged Diamond Hoe'] = '[Diamond Hoe]Damaged Diamond Hoe',
'Diamond Helmet',
['Damaged Diamond Leggings'] = '[Diamond Leggings]Damaged Diamond Leggings',
'Diamond Hoe',
['Damaged Diamond Pickaxe'] = '[Diamond Pickaxe]Damaged Diamond Pickaxe',
'Diamond Leggings',
['Damaged Diamond Shovel'] = '[Diamond Shovel]Damaged Diamond Shovel',
'Diamond Pickaxe',
['Damaged Diamond Sword'] = '[Diamond Sword]Damaged Diamond Sword',
'Diamond Shovel',
['Damaged Fishing Rod'] = '[Fishing Rod]Damaged Fishing Rod',
'Diamond Sword',
['Damaged Flint and Steel'] = '[Flint and Steel]Damaged Flint and Steel',
'Fishing Rod',
['Damaged Golden Axe'] = '[Golden Axe]Damaged Golden Axe',
'Flint and Steel',
['Damaged Golden Boots'] = '[Golden Boots]Damaged Golden Boots',
'Golden Axe',
['Damaged Golden Chestplate'] = '[Golden Chestplate]Damaged Golden Chestplate',
'Golden Boots',
['Damaged Golden Helmet'] = '[Golden Helmet]Damaged Golden Helmet',
'Golden Chestplate',
['Damaged Golden Hoe'] = '[Golden Hoe]Damaged Golden Hoe',
'Golden Helmet',
['Damaged Golden Leggings'] = '[Golden Leggings]Damaged Golden Leggings',
'Golden Hoe',
['Damaged Golden Pickaxe'] = '[Golden Pickaxe]Damaged Golden Pickaxe',
'Golden Leggings',
['Damaged Golden Shovel'] = '[Golden Shovel]Damaged Golden Shovel',
'Golden Pickaxe',
['Damaged Golden Sword'] = '[Golden Sword]Damaged Golden Sword',
'Golden Shovel',
['Damaged Iron Axe'] = '[Iron Axe]Damaged Iron Axe',
'Golden Sword',
['Damaged Iron Boots'] = '[Iron Boots]Damaged Iron Boots',
'Iron Axe',
['Damaged Iron Chestplate'] = '[Iron Chestplate]Damaged Iron Chestplate',
'Iron Boots',
['Damaged Iron Helmet'] = '[Iron Helmet]Damaged Iron Helmet',
'Iron Chestplate',
['Damaged Iron Hoe'] = '[Iron Hoe]Damaged Iron Hoe',
'Iron Helmet',
['Damaged Iron Leggings'] = '[Iron Leggings]Damaged Iron Leggings',
'Iron Hoe',
['Damaged Iron Pickaxe'] = '[Iron Pickaxe]Damaged Iron Pickaxe',
'Iron Leggings',
['Damaged Iron Shovel'] = '[Iron Shovel]Damaged Iron Shovel',
'Iron Pickaxe',
['Damaged Iron Sword'] = '[Iron Sword]Damaged Iron Sword',
'Iron Shovel',
['Damaged Leather Boots'] = '[Leather Boots]Damaged Leather Boots',
'Iron Sword',
['Damaged Leather Tunic'] = '[Leather Tunic]Damaged Leather Tunic',
'Leather Boots',
['Damaged Leather Cap'] = '[Leather Cap]Damaged Leather Cap',
'Leather Tunic',
['Damaged Leather Pants'] = '[Leather Pants]Damaged Leather Pants',
'Leather Cap',
['Damaged Shears'] = '[Shears]Damaged Shears',
'Leather Pants',
['Damaged Stone Axe'] = '[Stone Axe]Damaged Stone Axe',
'Shears',
['Damaged Stone Hoe'] = '[Stone Hoe]Damaged Stone Hoe',
'Stone Axe',
['Damaged Stone Pickaxe'] = '[Stone Pickaxe]Damaged Stone Pickaxe',
'Stone Hoe',
['Damaged Stone Shovel'] = '[Stone Shovel]Damaged Stone Shovel',
'Stone Pickaxe',
['Damaged Stone Sword'] = '[Stone Sword]Damaged Stone Sword',
'Stone Shovel',
['Damaged Wooden Axe'] = '[Wooden Axe]Damaged Wooden Axe',
'Stone Sword',
['Damaged Wooden Hoe'] = '[Wooden Hoe]Damaged Wooden Hoe',
'Wooden Axe',
['Damaged Wooden Pickaxe'] = '[Wooden Pickaxe]Damaged Wooden Pickaxe',
'Wooden Hoe',
['Damaged Wooden Shovel'] = '[Wooden Shovel]Damaged Wooden Shovel',
'Wooden Pickaxe',
['Damaged Wooden Sword'] = '[Wooden Sword]Damaged Wooden Sword',
'Wooden Shovel',
'Wooden Sword'
}
}
for _, item in ipairs( damagedItems ) do
local name = 'Damaged ' .. item
aliases[name] = '[' .. item .. ']' .. name
end


-- Since there are currently 608 banners, batch process them --
-- Since there are currently 608 banners, batch process them --