Anonymous

Module:ItemsTable: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 4: Line 4:
local p = {}
local p = {}


local Shared = require('Module:Shared')
local ItemData = mw.loadData('Module:Items/data')
local Items = require('Module:Items')
local Items = require('Module:Items')
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')
local SourceTables = require('Module:Items/SourceTables')
local SourceTables = require('Module:Items/SourceTables')
local UseTables = require('Module:Items/UseTables')
local UseTables = require('Module:Items/UseTables')
function p.getInvokes(frame)
    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 + 100
    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 = tonumber(frame.args[1])
   local iend = i + 100
   local iend = i + 50
   while i < iend do
   while i < iend do
     local item = Items.getItemByID(i)
     local item = Items.getItemByID(i)
444

edits