Anonymous

Module:ItemsTable: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 10: Line 10:
local SourceTables = require('Module:Items/SourceTables')
local SourceTables = require('Module:Items/SourceTables')
local UseTables = require('Module:Items/UseTables')
local UseTables = require('Module:Items/UseTables')
local itemCount = Shared.tableCount(ItemData.Items)


function p.getInvokes(frame)
function p.getInvokes(frame)
Line 26: Line 28:
   local itemList = {}
   local itemList = {}
   local i = tonumber(frame.args[1])
   local i = tonumber(frame.args[1])
   local iend = i + 50
   for i = 1, itemCount do
   while i < iend do
    table.insert(p._getItemsTable(i))
   end
  return table.concat(itemList)
end
 
function p._getItemsTable(i)
    local itemList = {}
     local item = Items.getItemByID(i)
     local item = Items.getItemByID(i)
     table.insert(itemList, '\r\n|-\r\n|')
     table.insert(itemList, '\r\n|-\r\n|')
Line 40: Line 48:
     table.insert(itemList, Icons.GP(item.sellsFor))
     table.insert(itemList, Icons.GP(item.sellsFor))
     i = i + 1
     i = i + 1
  end
    return table.concat(itemList)
  return table.concat(itemList)
end
end


return p
return p
444

edits