Posted 29 July 2012 - 05:05 PM
I have been writing a code for a train schedules display, and I want the time to be displayed on the lower right hand corner, and have it update every 5 seconds. I also want the rest of the monitor to display the rest of the schedule, but so far, I can get the clock to display properly, but none of the other information I want to print will display. Does the os.time() command clear everything out? Code here:
So far I haven't gotten any of the advanced features in there yet, but I plan on doing a lot more.
-- screen functions
function newpage()
mon.setCursorPos(1,1)
mon.setTextScale(1)
mon.write("RailNet Train Schedules")
end
function time()
mon.setTextScale(2)
mon.setCursorPos(27,9)
mon.write(textutils.formatTime(os.time(),false))
end
-- end screen functions
rednet.open("bottom")
-- vars
mon = peripheral.wrap("top")
term.redirect(mon)
-- end vars
while true do
newpage()
time()
event, sender, msg = rednet.receive(5)
if msg == "station" then
os.reboot()
elseif msg == "nil" then
os.reboot()
end
end
So far I haven't gotten any of the advanced features in there yet, but I plan on doing a lot more.