Module:Equipment/Recommended: Difference between revisions

Amend slot links
m (allow prayer icon)
(Amend slot links)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
-- Adapted from: https://oldschool.runescape.wiki/w/Module:Recommended Equipment
-- Adapted from: https://oldschool.runescape.wiki/w/Module:Recommended_equipment
-- Released under: https://creativecommons.org/licenses/by-nc-sa/3.0/  
-- Released under: https://creativecommons.org/licenses/by-nc-sa/3.0/  


Line 5: Line 5:


local Params = require('Module:Shared/Paramtest')
local Params = require('Module:Shared/Paramtest')
local Shared = require('Module:Shared')
local Icons = require("Module:Icons")
local Icons = require("Module:Icons")


local slots = {
local slots = {
{ placement = 1, name = 'helm', icon = 'Slot_head', txt = 'Helmet', link = 'Equipment#Helmets' },
{ placement = 1, name = 'helm', icon = 'Slot_head', txt = 'Helmet', link = 'Helmets' },
{ placement = 2, name = 'body', icon = 'Slot_chest', txt = 'Platebody', link = 'Equipment#Platebodies' },
{ placement = 2, name = 'body', icon = 'Slot_chest', txt = 'Platebody', link = 'Platebodies' },
{ placement = 3, name = 'legs', icon = 'Slot_legs', txt = 'Platelegs', link = 'Equipment#Platelegs' },
{ placement = 3, name = 'legs', icon = 'Slot_legs', txt = 'Platelegs', link = 'Platelegs' },
{ placement = 4, name = 'boots', icon = 'Slot_feet', txt = 'Boots', link = 'Equipment#Boots' },
{ placement = 4, name = 'boots', icon = 'Slot_feet', txt = 'Boots', link = 'Boots' },
{ placement = 5, name = 'gloves', icon = 'Slot_hands', txt = 'Gloves', link = 'Equipment#Gloves' },
{ placement = 5, name = 'gloves', icon = 'Slot_hands', txt = 'Gloves', link = 'Gloves' },
{ placement = 6, name = 'cape', icon = 'Slot_back', txt = 'Cape', link = 'Equipment#Capes' },
{ placement = 6, name = 'cape', icon = 'Slot_back', txt = 'Cape', link = 'Capes' },
{ placement = 7, name = 'neck', icon = 'Slot_neck', txt = 'Amulet', link = 'Equipment#Amulets' },
{ placement = 7, name = 'neck', icon = 'Slot_neck', txt = 'Amulet', link = 'Amulets' },
{ placement = 8, name = 'ring', icon = 'Slot_ring', txt = 'Ring', link = 'Equipment#Rings' },
{ placement = 8, name = 'ring', icon = 'Slot_ring', txt = 'Ring', link = 'Rings' },
{ placement = 9, name = 'gem', icon = 'Slot_gem', txt = 'Gem', link = 'Gems (Equipment)' },
{ placement = 9, name = 'weapon', icon = 'Slot_weapon', txt = 'Weapon', link = 'Equipment#Weapons' },
{ placement = 10, name = 'weapon', icon = 'Slot_weapon', txt = 'Weapon', link = 'Weapons' },
{ placement = 10, name = 'shield', icon = 'Slot_shield', txt = 'Offhand', link = 'Equipment#Offhand' },
{ placement = 11, name = 'shield', icon = 'Slot_shield', txt = 'Offhand', link = 'Shields' },
{ placement = 11, name = 'ammo', icon = 'Slot_ammo', txt = 'Quiver', link = 'Equipment#Ammunition' },
{ placement = 12, name = 'ammo', icon = 'Slot_ammo', txt = 'Quiver', link = 'Ammunition' },
{ placement = 12, name = 'passive', icon = 'Slot_passive', txt = 'Passive', link = 'Combat Passive Slot', hasStats = false },
{ placement = 13, name = 'passive', icon = 'Slot_passive', txt = 'Passive', link = 'Combat Passive Slot', hasStats = false },
{ placement = 13, name = 'familiar1', icon = 'Slot_summon', txt = 'Familiar Left', link = 'Summoning' },
{ placement = 14, name = 'consumable', icon = 'Slot_consumable', txt = 'Consumable', link = 'Consumables' },
{ placement = 14, name = 'familiar2', icon = 'Slot_summon', txt = 'Familiar Right', link = 'Summoning' },
{ placement = 15, name = 'familiar1', icon = 'Slot_summon', txt = 'Familiar Left', link = 'Summoning' },
{ placement = 15, name = 'prayer', icon = 'Slot_prayer', txt = 'Prayers', link = 'Prayer', icontype = "prayer" },
{ placement = 16, name = 'familiar2', icon = 'Slot_summon', txt = 'Familiar Right', link = 'Summoning' },
{ placement = 17, name = 'prayer1', icon = 'Slot_prayer', txt = 'Prayer1', link = 'Prayer', icontype = 'prayer' },
{ placement = 18, name = 'prayer2', icon = 'Slot_prayer', txt = 'Prayer2', link = 'Prayer', icontype = 'prayer' },
{ placement = 99, name = 'notes', icon = '', txt = 'Notes', link = '', hasStats = false }
{ placement = 99, name = 'notes', icon = '', txt = 'Notes', link = '', hasStats = false }
Line 69: Line 73:
else
else
-- Otherwise treat as an item icon
-- Otherwise treat as an item icon
icontype = data.icontype or 'item'
local icontype = slot.icontype or 'item'
itemIcon = Icons.Icon({v, img=v, type=icontype})
itemIcon = Icons.Icon({v, img=v, type=icontype})
end
end
Line 119: Line 123:
if showDR and greatest_row_size > 1 then
if showDR and greatest_row_size > 1 then
-- showDR option is only compatible if a single column of equipment is to be displayed
-- showDR option is only compatible if a single column of equipment is to be displayed
return 'ERROR: showDR option is incompatible with more than one item per slot'
return Shared.printError('showDR option is incompatible with more than one item per slot')
end
end
Line 238: Line 242:
familiar22 = 'Octopus',
familiar22 = 'Octopus',
familiar13 = 'Crow',
familiar13 = 'Crow',
familiar23 = 'Bear'
familiar23 = 'Bear',
}} )
}} )
end
end


return p
return p