Anonymous

Module:ItemsTable: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 11: Line 11:
local UseTables = require('Module:Items/UseTables')
local UseTables = require('Module:Items/UseTables')


function p.getInvokes(frame)
local numberOfItems = Shared.tableCount(ItemData.Items)
    local result = '{| class="wikitable sortable stickyHeader" style="width:100%;"'
    result = result..'\r\n!colspan="2"|Item!!ID!!Category!!Type!!Sells For!!Item Sources!!Item Uses\r\n'
    local i = 1
    while i < Shared.tableCount(ItemData.Items) do
      result = result..'{{#invoke:ItemsTable|getItemsTable|'..i..'}}'
      i = i + 50
    end
    result = result..'\r\n|}'
    mw.log(result)
  end


function p.getItemsTable(frame)
function p.getItemsTable(frame)
   local itemList = {}
   local itemList = {}
   local i = tonumber(frame.args[1])
   local i = 1
  local iend = i + 50
   while i < numberOfItems do
   while i < iend do
     local item = Items.getItemByID(i)
     local item = Items.getItemByID(i)
     table.insert(itemList, '\r\n|-\r\n|')
     table.insert(itemList, '\r\n|-\r\n|')
444

edits