#how i can improve this system

6 messages · Page 1 of 1 (latest)

lavish jewel
#
    local times = math.abs((os.time() - (Data["Quests"]["LastUpdateTime"] + RerrolCooldown)))
    local HRS = 0
    local MINS = 0
    repeat
        if times >= 3600 then
            times -= 3600
            HRS += 1
        end
        if times >= 60 then
            times -= 60
            MINS += 1
        end
    until times <= 59
    
    if times >= 10 and MINS >= 10 then
        QuestsFrame.Timer.Text = HRS .. ":" .. MINS .. ":" .. times
    elseif times <= 9 and MINS >= 10 then
        QuestsFrame.Timer.Text = HRS .. ":" .. MINS .. ":0" .. times
    elseif times >= 10 and MINS <= 9 then
        QuestsFrame.Timer.Text = HRS .. ":0" .. MINS .. ":" .. times
    elseif times <= 9 and MINS <= 9 then
        QuestsFrame.Timer.Text = HRS .. ":0" .. MINS .. ":0" .. times
    end
timber vigil
#

rerrol cooldown needs to be subtracted

#

idk the best i can think of rn is

#
HRS = math.floor(times / 3600)
times = times mod 3600

MINS = math.floor(times/60)
times = times mod 60
#

and get rid of the repeat