Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("loginutils")
- os.loadAPI("textutils2")
- loginutils.setPW("developer")
- local loginpw = "developer"
- function loginmask()
- os.pullEvent = loginutils.secureMode
- textutils2.clear()
- textutils2.writeCenterX("---------------",3)
- textutils2.writeCenterX("-Please Login:-",4)
- textutils2.writeCenterX("---------------",5)
- print("")
- local pw = loginutils.read("")
- if pw ~= loginpw then
- print("Wrong password.")
- loginutils.sleep(2)
- os.reboot()
- end
- textutils2.clear()
- textutils2.writeCenterX("Willkommen.", 4)
- textutils2.writeCenterX("anghenOS 0.1", 5)
- loginutils.sleep(2)
- textutils2.clear()
- end
- function commandHandler()
- write(">")
- cmd = loginutils.read()
- local args = {}
- local count = 1
- for i in string.gmatch(cmd, "%S+") do
- args[count] = i
- count = count+1
- end
- if args[0] == "devmode" then
- loginutils.restore()
- error("Devmode activated")
- elseif args[0] == "status" then
- modem = peripheral.wrap("bottom")
- devices = modem.getNamesRemote()
- for x = 1, #devices do
- print(peripheral.getType(devices[x]).." at "..devices[x])
- end
- end
- end
- loginmask()
- local ended = false
- while ended == false do
- commandHandler()
- end
- loginutils.restore()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement