285
edits
ByteFoolish (talk | contribs) (getCraftingTable) |
ByteFoolish (talk | contribs) m (Get fletching data from Items directly) |
||
Line 196: | Line 196: | ||
local category = frame.args ~= nil and frame.args[1] or frame | local category = frame.args ~= nil and frame.args[1] or frame | ||
local data = nil | local data = nil | ||
if category == "Arrows" then data = | |||
elseif category == "Shortbows" then data = | if category == "Arrows" then data = | ||
elseif category == "Longbows" then data = | Items.getItems(function(item) return item.fletchingCategory == 0 end) | ||
elseif category == "Bolts" then data = | elseif category == "Shortbows" then data = | ||
elseif category == "Crossbows" then data = | Items.getItems(function(item) return item.fletchingCategory == 1 end) | ||
elseif category == "Javelins" then data = | elseif category == "Longbows" then data = | ||
Items.getItems(function(item) return item.fletchingCategory == 2 end) | |||
elseif category == "Bolts" then data = | |||
Items.getItems(function(item) return item.fletchingCategory == 3 end) | |||
elseif category == "Crossbows" then data = | |||
Items.getItems(function(item) return item.fletchingCategory == 4 end) | |||
elseif category == "Javelins" then data = | |||
Items.getItems(function(item) return item.fletchingCategory == 5 end) | |||
end | end | ||
Line 213: | Line 220: | ||
result = result..'\r\n!Quantity\r\n!Sells For\r\n!Ingredients' | result = result..'\r\n!Quantity\r\n!Sells For\r\n!Ingredients' | ||
table.sort(data, function(a, b) return (a.fletchingLevel == b.fletchingLevel and a.id < b.id) | |||
or a.fletchingLevel < b.fletchingLevel end) | |||
table.sort( | |||
for i, fletch in Shared.skpairs( | for i, fletch in Shared.skpairs(data) do | ||
result = result..'\r\n|-' | result = result..'\r\n|-' | ||
result = result..'\r\n| style="text-align: left;" | '..Icons.Icon({fletch.name, type='item', size='50', notext=true}) | result = result..'\r\n| style="text-align: left;" | '..Icons.Icon({fletch.name, type='item', size='50', notext=true}) |
edits