Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Title: FloodGate
- --Version: Ver. 1.1
- --Last Revised: 2/15/2012
- --Author: MattTheIdler
- pass = "password"
- debug = "debug"
- outside = "back"
- hint = "Hint"
- function menu()
- while true do
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Main Menu"
- print "\n1. Open Gate"
- print "2. Close Gate"
- print "3. Exit"
- event, param = os.pullEvent()
- if event == "char" and param1 == "1" then open() end
- if event == "char" and param1 == "2" then close() end
- if event == "char" and param1 == "3" then break end
- end
- end
- function correct()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Correct Password."
- print "\nAccessing Main Menu..."
- sleep(1)
- menu()
- end
- function password()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "FloodGate 1.1"
- write ("\nPassword: ")
- user = io.read()
- end
- function open()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Flooding..."
- sleep(1)
- rs.setOutput(outside, true)
- print "\nDone."
- sleep(1)
- menu()
- end
- function close()
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Closing..."
- sleep(1)
- rs.setOutput(outside, false)
- print "\nDone."
- sleep(1)
- menu()
- end
- password()
- if user == debug then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Accessing OS..."
- sleep(1)
- shell.run"shell"
- end
- if user == pass then
- correct()
- end
- if user == "hint" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Hint:"
- print (hint)
- sleep(2)
- password()
- end
- if not(user == pass) or (user == debug) or (user == "hint") then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint "Incorrect Password."
- sleep(1)
- password()
- end
Advertisement
Add Comment
Please, Sign In to add comment