CryptekCoding

OC|Client

Jun 16th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. --[ Calls in and requires API and/or components ]--
  2. local component = require("component")
  3. local event = require("event")
  4. local sides = require("sides")
  5. local term = require("term")
  6.  
  7.  
  8. --[ Changes the component.modem.bleh to m.bleh and etc. ]--
  9. m = component.modem
  10. rs = component.redstone
  11. gpu = component.gpu
  12.  
  13. m.open(95) --[ Opens Modem port 95]--
  14.  
  15. while true do
  16.     term.clear() --[Clears the screen]--
  17.     term.setCursor(1,1) --[Sets the cursor on the screen at X,Y]--
  18.     print("Password") --[Prints the word Password]--
  19.     local pswd = io.read() --[Reads user input and saves to local variable pswd]--
  20.     term.clear() --[Clears the screen]--
  21.     term.setCursor(1,1) --[Resets the cursor to desired position]--
  22.    
  23.     if password == "Admin" then
  24.             break
  25.     else
  26.             m.send("3e216927-dc61-4f3e-bad7-d8dd389fa6", 95, pswd)
  27.     local evt,me,who,port,_,message = event.pull('modem_message')
  28.     if who == "3e216927-dc61-4f3e-bad7-d8dd389fa6" and (port == 95) and message == "valid" then
  29.            print("Access Granted")
  30.                         rs.setOutput(sides.left, 15)
  31.                         os.sleep(5)
  32.                         rs.setOutput(sides.left, 0)
  33.  
  34.     end
  35.   end                      
  36. end
Add Comment
Please, Sign In to add comment