Posted 06 August 2013 - 03:37 AM
I want to have a clock that auto updates on my screen during my login program without it interfering with the typing. Here is my code-
functions program
startup program
functions program
function terminal()
term.clear()
term.setCursorPos(1,1)
end
function cursor(x, y)
term.setCursorPos(x, y)
end
function gui()
cursor(38, 1)
write("Computer ID: " ..os.computerID())
cursor(40, 19)
write("LogTech V1.0")
end
function time()
time = os.time()
time = textutils.formatTime(time, false)
write("The time is "..time)
end
startup program
shell.run("functions")
terminal()
gui()
cursor(1, 19)
time() --Here is where i tried to output the time
cursor(1, 1)
write("Enter Username: ")
os.pullEvent = os.pullEventRaw
username = read()
if username == "Brad" then
cursor(1, 2)
write("Enter Password " ..username.. ": ")
password = read('*')
if password == "butters" then
terminal()
print("Welcome " ..username)
else
terminal()
print("Wrong password/username combination")
os.reboot()
end
elseif username == "Ryan" then
cursor(1, 2)
write("Enter Password " ..username.. ": ")
password = read('*')
if password == "titties" then
terminal()
print("Welcome " ..username)
else
terminal()
print("Wrong password/username combination")
os.reboot()
end
else
print("Unrecognized Username")
sleep(2)
os.reboot()
end