.
This commit is contained in:
parent
ccf01f50c2
commit
a5d3daf54b
@ -23,39 +23,32 @@ function Choice2()
|
|||||||
onKeyPressed(key,lightsMenu)
|
onKeyPressed(key,lightsMenu)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function LightsOn()
|
function Open()
|
||||||
redstone.setBundledOutput("top", colors.white)
|
rs.setOutput("left",true)
|
||||||
inLightsMenu = false
|
inLightsMenu = false
|
||||||
selectedItem = 1
|
selectedItem = 1
|
||||||
|
sleep(3)
|
||||||
|
os.reboot()
|
||||||
end
|
end
|
||||||
function LightsOff()
|
function Close()
|
||||||
redstone.setBundledOutput("top", 0)
|
rs.setOutput("left",false)
|
||||||
inLightsMenu = false
|
inLightsMenu = false
|
||||||
selectedItem = 1
|
selectedItem = 1
|
||||||
end
|
sleep(3)
|
||||||
function Reboot()
|
|
||||||
print("Rebooting...")
|
|
||||||
sleep(1)
|
|
||||||
os.reboot()
|
os.reboot()
|
||||||
end
|
end
|
||||||
function Exit()
|
function Exit()
|
||||||
os.shutdown()
|
|
||||||
end
|
|
||||||
function Edit()
|
|
||||||
inMainMenu = false
|
inMainMenu = false
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[Menu Definitions]]--
|
--[[Menu Definitions]]--
|
||||||
mainMenu = {
|
mainMenu = {
|
||||||
[1] = { text = "Who amI?",handler=Choice1 },
|
[1] = { text = "Door Control",handler=Choice2 },
|
||||||
[2] = { text = "Light Controls",handler=Choice2 },
|
[2] = { text = "Exit",handler=Exit }
|
||||||
[3] = { text = "Reboot",handler=Reboot },
|
|
||||||
[4] = { text = "Exit",handler=Exit },
|
|
||||||
[5] = { text = "Edit mode",handler=Edit }
|
|
||||||
}
|
}
|
||||||
lightsMenu={
|
lightsMenu={
|
||||||
[1]= { text="Lights On", handler=LightsOn},
|
[1]= { text="Open Door", handler=Open},
|
||||||
[2]= { text="Lights Off", handler=LightsOff}
|
[2]= { text="Close Door", handler=Close}
|
||||||
}
|
}
|
||||||
|
|
||||||
--[[Printing Methods]]--
|
--[[Printing Methods]]--
|
||||||
@ -99,4 +92,32 @@ function main()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function login()
|
||||||
|
os.pullEvent = os.pullEventRaw
|
||||||
|
term.clear()
|
||||||
|
term.setCursorPos(1,1)
|
||||||
|
print("2137_OS_v1.3 Login Screen")
|
||||||
|
print("UserName: ZareMate")
|
||||||
|
write("Password: ")
|
||||||
|
function pass()
|
||||||
|
t = io.read()
|
||||||
|
if t == "nigga" then
|
||||||
|
print ("Access Granted.")
|
||||||
|
sleep(2)
|
||||||
|
term.clear()
|
||||||
|
term.setCursorPos(1,1)
|
||||||
|
else
|
||||||
|
print ("Incorrect Login Details.")
|
||||||
|
sleep(1)
|
||||||
|
term.clear()
|
||||||
|
term.setCursorPos(1,1)
|
||||||
|
print("2137_OS_v1.3 Login Screen")
|
||||||
|
print("UserName: ZareMate")
|
||||||
|
write("Password: ")
|
||||||
|
pass()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
pass()
|
||||||
|
end
|
||||||
|
login()
|
||||||
main()
|
main()
|
||||||
Loading…
x
Reference in New Issue
Block a user