Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local glass = peripheral.wrap("back")
- local version = 1.1
- local pass = "derpy"
- local isRunning = false
- local keepRunning = true
- local lastAction = "None"
- local lastCommand = "None"
- local byWho = "No one"
- local pTable = {}
- local nTable = {"313","315","316","100","99","317","318","283"}
- function boot()
- for x=1,#nTable do
- pTable[x] = peripheral.wrap("computer_"..nTable[x])
- end
- for x=1,#pTable do
- pTable[x].turnOn()
- end
- end
- function os.pullEvent()
- local event, p1, p2, p3, p4, p5 = os.pullEventRaw()
- if event == "terminate" then
- if isRunning == false then
- isRunning = true
- shell.run("clear")
- print("Incorrect Attempts will return you to main screen.")
- write("Enter Password: ")
- temp = read("*")
- if temp ~= pass then
- isRunning = false
- --continue program
- else
- if shell.getRunningProgram() == "startup" then
- keepRunning = false
- isRunning = false
- else
- isRunning = false
- shell.exit()
- end
- end
- end
- end
- return event, p1, p2, p3, p4, p5
- end
- rednet.open("right")
- boot()
- while keepRunning do
- shell.run("clear")
- print("~BlueTech~")
- print("~Running Mainframe Control v"..version.."~")
- print("~Terminate to access computer~")
- print("")
- print("Last Action: "..lastAction)
- print("Last Command Receive: "..lastCommand)
- print("Issued by: "..byWho)
- event, com, pl = os.pullEvent()
- if event == "chat_command" then
- lastCommand = com
- byWho = pl
- lastAction = "Invalid Command"
- if com == "doors" then
- lastAction = "Doors temporarily opened"
- rednet.broadcast("dToggle")
- os.startTimer(5)
- end
- if com == "lights" then
- lastAction = "Lights toggled"
- rednet.broadcast("toggle")
- end
- if com == "blinds" then
- lastAction = "Blinds toggled"
- rednet.broadcast("bToggle")
- end
- end
- if event == "timer" then
- rednet.broadcast("dToggle")
- end
- end
- shell.run("clear")
- print("~Welcome~") --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement