Module:Skills: Difference between revisions

Added getMiningTable
(Fixed sorting on growth times)
(Added getMiningTable)
Line 113: Line 113:


   return p._getFarmingTable(category)
   return p._getFarmingTable(category)
end
function p.getMiningTable(frame)
  local result = '{|class="wikitable sortable stickyHeader"'
  result = result..'\r\n|- class="headerRow-0"'
  result = result..'\r\n!colspan=2|Ore!!'..Icons.Icon({'Mining', type='skill', notext=true})..' Level'
  result = result..'!!XP!!Respawn Time!!Ore Value'
  local mineData = Shared.clone(SkillData.Mining)
  table.sort(mineData, function(a, b) return a.level < b.level end)
  for i, oreData in Shared.skpairs(mineData) do
    local ore = Items.getItemByID(oreData.ore)
    result = result..'\r\n|-\r\n|'..Icons.Icon({ore.name, type='item', size='50', notext=true})..'||'..ore.name
    result = result..'||'..oreData.level..'||'..ore.miningXP
    result = result..'||data-sort-interval="'..oreData.respawnInterval.."'|"
    result = result..Shared.timeString(oreData.respawnInterval / 1000, true)
    result = result..'||data-sort-value="'..ore.sellsFor..'"|'..Icons.GP(ore.sellsFor)
  end
  result = result..'\r\n|}'
  return result
end
end


return p
return p