Module:Skills/Gathering: Difference between revisions

_buildAstrologyConstellationTable: Remove time column, which has been relocated to Astrology/Training
m (oops forgot to divide by a number)
(_buildAstrologyConstellationTable: Remove time column, which has been relocated to Astrology/Training)
Line 703: Line 703:
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Constellation!!'..Icons.Icon({"Astrology", type='skill', notext='true'})..' Level'
result = result..'\r\n!colspan="2"|Constellation!!'..Icons.Icon({"Astrology", type='skill', notext='true'})..' Level'
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers!!XP/s!!Time to next constellation'
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers'
   
    function SecondsToClock(seconds)
        local seconds = tonumber(seconds)
     
        if seconds <= 0 then
            return "00:00:00";
        else
            hours = string.format("%02.f", math.floor(seconds/3600));
            mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)));
            secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60));
            return hours..":"..mins..":"..secs
        end
    end


for i, cons in ipairs(SkillData.Astrology.Constellations) do
for i, cons in ipairs(SkillData.Astrology.Constellations) do
local xpByThreshold = {0, 1154, 3316, 8893, 23861, 64109, 172409, 463885, 1248441, 3360264, 3425226}
local name = cons.name
local name = cons.name
result = result..'\r\n|-'
result = result..'\r\n|-'
Line 746: Line 732:
end
end
result = result..'||'..table.concat(uMods, '<br/>')
result = result..'||'..table.concat(uMods, '<br/>')
        local xpPs = string.format("%.2f",cons.provides.xp/3)
        result = result..'||'..xpPs
mw.logObject(xpPs)
        local time = SecondsToClock(xpByThreshold[i] / xpPs)
        mw.log(time)
        result = result..'||'..time
       
end
end
result = result..'\r\n|}'
result = result..'\r\n|}'