Posted 12 January 2013 - 07:31 AM
Needed for this program: Computer (Advanced is optional), Monitor (Advanced is optional)
What it does (you can change the "mon.write" to print) is it counts to 60 (variable s), then it adds 1 to the minutes (variable "m"), and when it reaches 60 minutes it counts 1 to the hours (variable h).
I made this simple program to use in my advanced Industrial Centrifuge/Electrolyzer room. If you have requests/tips, please send 'em in!
Greetings,
GamerNebulae (Ivo)
local s = 0
local m = 0
local h = 0
mon = peripheral.wrap("top")
while true do
s = s + 1
sleep(1)
if s > 59 then
s = 0
m = m + 1
end
if m > 59 then
m = 0
h = h + 1
end
mon.clear()
mon.setCursorPos(1,1)
mon.write("Time: "..h..":"..m..":"..s)
end
What it does (you can change the "mon.write" to print) is it counts to 60 (variable s), then it adds 1 to the minutes (variable "m"), and when it reaches 60 minutes it counts 1 to the hours (variable h).
I made this simple program to use in my advanced Industrial Centrifuge/Electrolyzer room. If you have requests/tips, please send 'em in!
Greetings,
GamerNebulae (Ivo)