heres the code if you need it
function infiniteLoop()
while true do
local time = os.time()
time = textutils.formatTime(time, false)
print(time)
sleep(0.8)
end
end
infiniteLoop()
function infiniteLoop()
while true do
local time = os.time()
time = textutils.formatTime(time, false)
print(time)
sleep(0.8)
end
end
infiniteLoop()
Hi there, I am making a Clock (Minecraft in game time not real life) for my server and i have a way to find the time and printing it but i want it to replace what it wrote instead of writing more and more, i hope this makes sense.
heres the code if you need itfunction infiniteLoop() while true do local time = os.time() time = textutils.formatTime(time, false) print(time) sleep(0.8) end end infiniteLoop()
function infiniteLoop()
while true do
local time = os.time()
time = textutils.formatTime(time, false)
term.clear()
term.setCursorPos(1,1)
print(time)
sleep(0.8)
end
end
infiniteLoop()
There you go!MOHAHAHAHAHAHA! :)/>/>add "term.clear" to clear the screen
Edit: ninja'd xD
Hello
i am new to computer craft and i dont know why this code is not working for me.
i wrote that into a program called "clock" and got my monitor on the right, so i use th command:"monitor right clock" and then this error comes on the monitor: "textutils:30: attempt to compare function with number"
plz help me :D/>
function infiniteLoop()
while true do
local time = os.time()
time = textutils.formatTime(time, false)
term.clear()
term.setCursorPos(1,1)
print(time)
sleep(0.8)
end
end
infiniteLoop()