Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- os.sleep(1)
- errorreport = false
- if errorreport==false then
- redstone.setOutput("top", true)
- term.setTextColor(8)
- local version = os.version()
- print("This is Computer #8")
- term.setTextColor(8)
- print("This computer's operating system is MarOS 1.4.7")
- function start()
- rednet.send(1, "auth")
- --i = 0
- --repeat
- local event, senderId, message, distance = os.pullEvent("rednet_message")
- --repeat
- if senderId==1 then
- userinfo = {}
- userinfo = message
- username = userinfo[1]
- authLevel = userinfo[2]
- --print(username)
- --print(authLevel)
- cont()
- --local event, senderId, message, distance = os.pullEvent("rednet_message")
- --if senderId==1 then
- --local authLevel = message
- --end
- end
- end
- --until authLevel==0 or authLevel==1 or authLevel==2 or authLevel==3 or authLevel==4 or authLevel==5 or i==10
- function cont()
- term.setTextColor(2)
- if version=="CraftOS 1.5" then
- print("This Terminal is out of date. Please contact your system administrator to resolve this issue.")
- os.run("logout")
- elseif version=="CraftOS 1.6" and authLevel==1 then
- shell.run("LevelOne", username)
- elseif version=="CraftOS 1.6" and authLevel==2 then
- shell.run("LevelTwo", username)
- elseif version=="CraftOS 1.6" and authLevel==3 then
- shell.run("LevelThree", username)
- elseif version=="CraftOS 1.6" and authLevel==4 then
- shell.run("LevelFour", username)
- elseif version=="CraftOS 1.6" and authLevel==5 then
- shell.run("LevelFive", username)
- elseif version=="CraftOS 1.6" and authLevel==0 then
- print("This Terminal is up to date.")
- print("Please press a key to select a command")
- term.setTextColor(1)
- print("1) Log in")
- print("2) Log out")
- print("3) Help")
- term.setTextColor(2)
- local event, key = os.pullEvent("key")
- if key == keys.one then
- local password = {}
- print("Please enter your password")
- local event, key = os.pullEvent("key")
- password[1] = key - 1
- local event, key = os.pullEvent("key")
- password[2] = key - 1
- local event, key = os.pullEvent("key")
- password[3] = key - 1
- local event, key = os.pullEvent("key")
- password[4] = key - 1
- term.setTextColor(2)
- print("Authenticating...")
- rednet.send(1, "password")
- os.sleep(.1)
- rednet.send(1, password)
- os.shutdown()
- elseif key==keys.two then
- rednet.broadcast("logout")
- print("System Shutdown Initiated")
- os.sleep(10)
- print("System Shutdown Complete")
- os.reboot()
- elseif key==keys.three then
- local event, key = os.pullEvent("key")
- if key==keys.t then
- shell.run("edit", "startup")
- else
- os.sleep(3)
- os.reboot()
- end
- else
- os.reboot()
- end
- else
- redstone.setOutput("top", false)
- rednet.open("back")
- rednet.broadcast("Help, I'm Broken!")
- rednet.close("back")
- end
- end
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement