Posted 29 May 2013 - 03:20 PM
Topic: Program reset? I have a program I've been working on that isn't quite complete, but I've run into a problem where, after line 17, where it asks "yes/no", the program resets itself and the "CraftOS 1.5" message appears back at the top of the screen. It's an advanced computer with an advanced monitor on the right of it.
l
l
local a = ""
local m = peripheral.wrap("right")
local p = ""
while p ~= "Maximus" do
--change Maximus to your password
term.write("Enter password: ")
p = read()
sleep(2)
print("Verifying, please wait...")
if p ~= "Maximus" then
sleep(3)
print("Incorrect, please retry")
end
end
sleep(3)
print("Correct, hello Maximus230x")
term.write("Initiate access sequence?(yes/no)")
a = read()
if a == yes then
print("please look at monitor")
m.setTextScale(5)
m.setBackgroundColor(colors.red)
m.setTextColor(colors.black)
m.write("Warning")
m.write("Nuclear testing ahead")
m.write("enter activation code")
elseif a == no then
print("Very well, accessing files...")
sleep(2)
print("You may now access terminal")
else
print("Invalid response, rebooting")
os.reboot()
end