Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top") --connects to the monitor on top of the computer
- sec = 0 --declare variables
- min = 0
- uur = 0
- mon.setTextScale(1.5) --set the text scale of the monitor to a 1.5 magnification
- term.redirect(mon) --redirect the output ot the monitors
- while true do --main loop
- term.clear() --clear the screen
- term.setCursorPos(1,1) --set the cursor to the left upper corner
- if sec==60 then --if 60 seconds have past add 1 to minutes and set seconds to 0
- min = min + 1 --adds 1 to minutes
- sec = 0
- end --ends if
- sec = sec + 1 --counts the seconds
- if min==60 then --if 60 minutes have past add 1 to uur(hours) and set minutes to 0
- uur = uur + 1 --adds 1 to uur(hours)
- min = 0
- end
- --prints everything
- print("time is: ")
- print(sec.." seconds")
- print(min.." minutes")
- print(uur.." hours")
- sleep(1) --sleeps for 1 second
- end
Add Comment
Please, Sign In to add comment