Module:Skills: Difference between revisions

1,417 bytes added ,  23 January 2021
Added getFiremakingTable
(getSkillName)
(Added getFiremakingTable)
Line 264: Line 264:
       result = result..Icons.Icon({matItem.name, type='item', qty=mat.qty, notext=true})
       result = result..Icons.Icon({matItem.name, type='item', qty=mat.qty, notext=true})
     end
     end
  end
  result = result..'\r\n|}'
  return result
end
function p.getFiremakingTable(frame)
  local result = '{| class="wikitable sortable stickyHeader"'
  result = result..'\r\n|-class="headerRow-0"'
  result = result..'\r\n!colspan="2"|Logs!!Name!!'..Icons.Icon({'Firemaking', type='skill', notext=true})..' Level'
  result = result..'!!XP!!Burn Time!!XP/s!!Bonfire Bonus!!Bonfire Time'
  for i, logData in Shared.skpairs(SkillData.Firemaking) do
    result = result..'\r\n|-'
    local name = Shared.titleCase(logData.type..' Logs')
    result = result..'\r\n|data-sort-value="'..name..'"|'..Icons.Icon({name, type='item', size='50', notext=true})
    result = result..'||'..name
    result = result..'||style ="text-align: right;"|'..logData.level
    result = result..'||style ="text-align: right;"|'..logData.xp
    local burnTime = logData.interval / 1000
    local XPS = logData.xp / burnTime
    result = result..'||style ="text-align: right;" data-sort-value="'..burnTime..'"|'..Shared.timeString(burnTime, true)
    result = result..'||style ="text-align: right;" data-sort-value="'..XPS..'"|'..Shared.round(XPS, 2, 2)
    result = result..'||style ="text-align: right;" data-sort-value="'..logData.bonfireBonus..'"|'..logData.bonfireBonus..'%'
    result = result..'||style ="text-align: right;" data-sort-value="'..logData.bonfireInterval..'"|'..Shared.timeString(logData.bonfireInterval / 1000, true)
   end
   end