Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- OUTDATED! Go here http://pastebin.com/W9yH2c10 for the updated version.
- --This is ready to use out of the box! Just change "<password>" to your password and set your side and your off. This program should be easy enough to modify to suit your needs, thus the "API" part, as it sits it is a VERY simple looking and functioning program. Have fun with it!
- local side = "<side>" --Change this to that side in which your door is on.
- local password = "<password>" --This would be your password.
- local sleepTime = 5 --Change this to how long you want the door to stay open.
- local debug = "1243" --This is for breaking the program and changing the password or side in which your door is on.
- local oldPull = os.pullEvent --This disables CTRL+T.
- os.pullEvent = os.pullEventRaw --This disables CTRL+T.
- while true do
- term.clear()
- term.setCursorPos(1,1) --Set this to a value in which you wish the cursor to appear (1,1 places the cursor top left of the screen).
- write("Password:")
- input = read("*") --This makes it so instead of seeing your password, all you see is "*".
- if input == debug then
- term.clear()
- term.setCursorPos(1,1) --Set this to a value in which you wish the cursor to appear.
- print("Entering debug mode...") --You may change this line or remove it (if you remove it also remove the three (3) lines below it).
- sleep(sleepTime)
- term.clear()
- term.setCursorPos(1,1) --Set this to a value in which you wish the cursor to appear.
- break
- elseif input == password then
- term.clear()
- term.setCursorPos(1,1) --Set this to a value in which you wish the cursor to appear.
- print("Password correct!") --You may change this to the message you would like displayed if the password is correct, you can also remove it.
- rs.setOutput(side, true)
- sleep(sleepTime)
- rs.setOutput(side, false)
- else
- term.clear()
- term.setCursorPos(1,1) --Set this to a value in which you wish the cursor to appear.
- print("Password incorrect...") --You may change this to the message you would like to see if the password is incorrect, you can also remove it and the line below it.
- sleep(sleepTime)
- end
- end
- os.pullEvent = oldPull --This disables CTRL+T.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement