Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local server = changeme
  2. rednet.open("back")
  3.  
  4. while true do
  5.   textutils.slowPrint("please log in")
  6.   textutils.slowPrint("Username:")
  7.   local user = read()
  8.   textutils.slowPrint("Password:")
  9.   local pass = read()
  10.   rednet.send(server, user.."n"..pass)
  11.   textutils.slowPrint("waiting for server")
  12.  
  13.   local id, access
  14.   repeat
  15.     id, access = rednet.receive()
  16.   until id == server
  17.   if access == "granted" then
  18.     textutils.slowPrint("access granted for 10 seconds")
  19.     redstone.setOutput("left", true)
  20.     sleep(10)
  21.     redstone.setOutput("left", false)
  22.     term.clear()
  23.     term.setCursorPos(1, 1)
  24.   else
  25.     textutils.slowPrint("access denied")
  26.     sleep(2)
  27.     term.clear()
  28.     term.setCursorPos(1, 1)
  29.   end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement