Create a label and write to the label's Caption property
To get the time, use os.time() and os.difftime()
Code:
local trainer_start_time = os.time()
function UDF1_CETimer1Timer(sender)
local current_time = os.time()
local time_since_on = os.difftime(current_time, trainer_start_time)
local seconds = time_since_on % 60
local minutes = (time_since_on // 60) % 60
local hours = (time_since_on // 60 // 60) % 24
local days = time_since_on // 60 // 60 // 24
local t = {}
if days > 0 then
t[#t+1] = ('%d days '):format(days)
end
if days > 0 or hours > 0 then
t[#t+1] = ('%02d:'):format(hours)
end
t[#t+1] = ('%02d:%02d'):format(minutes, seconds)
UDF1.CELabel1.Caption = table.concat(t,'')
end
_________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum