Posted 16 February 2014 - 12:26 AM
Hello everyone I am trying to create a boot screen for my servers so while they are booting if I want them to receive an os upgrade I can do so easily or if I don't do anything within the allotted amount of time it will boot as normal. But when I load this I get what you would expect but the timer gets stuck on 9. Any help would be greatly appreciated.
term.clear()
term.setCursorPos(1,1)
print("RSW Enterprise Edition Mail Server v1.0")
sleep(2)
seconds = 10
wait = 63
i = seconds
while true do
while i <= seconds and i > 0 do
i = i - 1
term.clear()
term.setCursorPos(1,1)
print("What would you like to do?")
print("[1] Update Server OS")
print("[2] Shutdown")
print("[3] or wait "..i.." seconds to load current os")
write("> ")
local input = read()
if input == "2" then
os.shutdown()
elseif input == "1" then
shell.run("receivefile")
sleep (1)
end
if i == 0 then
i = seconds
shell.run("\mailserver", "6", "back")
end
sleep(wait)
end
end