Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lua Timer
--[[ This program will attempt to make a timer Author: Ice Scripter How to use the program: use the "get_remaining_time" function and put your time that you would like to count down to in the "()" Default time is set to 1559148288 + 604800 ]]-- local countdown_time = 1559148288 + 604800 -- Time it counts down from -- local time_math -- Creating a nil variable for future use local function get_remaining_time(x) if x ~= nil then -- if x isn't nil it will replate time_math with x - os.time() -- time_math = x - os.time() else time_math = countdown_time - os.time() end print("Getting remaining time...") if countdown_time > os.time() then return math.floor (time_math /60 /60 /24 %7) .. ":" .. math.floor (time_math /60 /60 %24) .. ":".. math.floor (time_math /60 % 60) .. ":" .. math.floor (time_math %60) -- Returns this if time is still remaining. -- else return "Countdown complete." -- Returns this when the countdown is completed -- end end print(get_remaining_time().."\n") -- prints the time left -- print("Current time in seconds: ".. os.time().. "\nCount down time: "..countdown_time) -- Prints the current time and countdown time (in seconds) --
run
|
edit
|
history
|
help
2
Map generator
Area of Sector Calculator
PAID HACK PuBG
Monty Hall Problem Simulated
sh
test random skill id
Creating habits v3, Lua
Area and Circumference of a circle.
personal use
hack