Posted 02 November 2014 - 11:34 AM
Hi
My first time posting here, so bear with me and try to keep things simple.
I have worked with a code for a while now, which is composed of 3 different that I have found online.
Consisting of a boot sequence, a secure login and a menu system … but the start and log in is working properly, but the menu I just get a "bios: 32: Too long without yielding"
Any ideas on what could be wrong ..
PS the code contains some notes that i have made for myself… and the print part in odd security login looks strange when i previewed my post, but its ok in mindcraft….
My first time posting here, so bear with me and try to keep things simple.
I have worked with a code for a while now, which is composed of 3 different that I have found online.
Consisting of a boot sequence, a secure login and a menu system … but the start and log in is working properly, but the menu I just get a "bios: 32: Too long without yielding"
Any ideas on what could be wrong ..
PS the code contains some notes that i have made for myself… and the print part in odd security login looks strange when i previewed my post, but its ok in mindcraft….
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos (1, 2)
-------Startup-------
print("")
print("--------------------------------------------------")
term.setCursorPos (16, 8)
print(" ---------------")
term.setCursorPos (16, 9)
print("| DoomOS Engine |")
term.setCursorPos (16, 10)
print(" ---------------")
term.setCursorPos (1,20)
print("--------------------------------------------------")
sleep(1)
term.setCursorPos (30,16)
print("Copyright Mort96 inc")
sleep(2)
term.setCursorPos (20, 14)
print("Loading.")
sleep(1)
term.setCursorPos (20, 14)
print("Loading..")
sleep(1)
term.setCursorPos (20, 14)
print("Loading...")
sleep (3)
term.clear()
-------odd security login-------
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
p = "stene"
r = "morten"
print("")
print("")
print("")
print("")
print("")
print(" odd Security v1.4.5 ")
print(" +-----------------------+ ")
print(" Username: ")
print(" Password: ")
print(" +-----------------------+ ")
term.setCursorPos(26,8)
print("Admin")
term.setCursorPos (29,16)
print("Copyright odd_kid inc")
term.setCursorPos(26,9)
pt = read("*")
if pt == (p) then
term.setCursorPos(1,11)
print("Logging in"); term.setCursorPos(11,11); textutils.slowPrint("...",1)
term.setCursorPos(1,12)
sleep(2)
print("Login succesful!")
sleep(1)
print("Welcome Morten!")
sleep(2)
term.clear()
term.setCursorPos(1,1)
print("Preparing DoomOS")
sleep(1)
term.setCursorPos(1,2)
print("Reading Files"); term.setCursorPos(14,2); textutils.slowPrint("...",1)
sleep(1)
term.setCursorPos(1,3)
print("Loading menu"); term.setCursorPos(13,3); textutils.slowPrint("...",1)
sleep(1)
term.setCursorPos(1,4)
print("Startup Succesful!")
sleep(2)
term.clear()
else
term.setCursorPos(1,11)
print("Logging in"); term.setCursorPos(11,11); textutils.slowPrint("...",1)
sleep(1)
term.setCursorPos(1,12)
print("Incorrect Password! This sesion will be terminated"); term.setCursorPos(1,14)
sleep(2)
print("3"); term.setCursorPos(1,14)
sleep(1)
print("2"); term.setCursorPos(1,14)
sleep(1)
print("1"); term.setCursorPos(1,14)
sleep(1)
os.shutdown()
end
-------Menyer-------
os.pullEvent = os.pullEventRaw
term.clear()
pos = 1
menu = true
while menu do
term.setCursorPos (1, 1)
print("Welcome to the Main Control Center")
print("")
print("Please select a task")
term.setCursorPos (1, 5)
print(" ----------------- ")
print("| Lights ON |")
print("| Lights OFF |")
print("| --------------- |")
print("| Maintenance door|")
print("| --------------- |")
print("| Shutdown |")
print(" ----------------- ")
if num == 200 then
pos = pos - 1
end
if num == 208 then
pos = pos + 1
end
if num == 28 then
menu = false
end
if pos > 4 then --------------------Endre
pos = 4 --------------------------Endre
elseif pos < 1 then
pos = 1
end
if pos == 1 then ------------------------Lys på
term.setCursorPos (19, 6)
print("<--")
end
if pos == 2 then ------------------------Lys av
term.setCursorPos (19, 7)
print("<--")
end
if pos == 3 then ------------------------Maintenance door
term.setCursorPos (19, 9)
print("<--")
end
if pos == 4 then ------------------------Shutdown
term.setCursorPos (19, 11)
print("<--")
if num == 28 then
os.shutdown()
end
end
end
type, num = os.pullEvent()
term.clear()