Posted 16 April 2012 - 11:01 AM
I'm trying to write a program to redstone.setOutput("back", true) if in game time is between 6:30pm and 5:30am and redstone.setOutput("back", false) if between 5:30am and 6:30pm. I have searched google and browsed through pretty much all the code i could find related to my program type. My time is based on 24hour as i couldn't figure out how to differentiate between am and pm, any help is greatly appreciated.
Spoiler
while true do
shell.run("clear")
local nTime = os.time()
print( "Time: "..textutils.formatTime(nTime, true))
if os.time() == 5.0 then
redstone.setOuput("back", false)
elseif os.time() == 18.0 then
redstone.setOutput("back", true)
end
sleep(1)
end