thatparadox

TP Console

Mar 23rd, 2013
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.29 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. term.clear()
  4. term.setCursorPos(1,1)
  5.  
  6. rednet.open("left")
  7.  
  8. serv = 36
  9.  
  10. while true do
  11.    write("Select a floor: ")
  12.    x = read()
  13.    rednet.send(serv, x)
  14.    q, i = rednet.receive()
  15.    if i == "pass" then
  16.       write("Requires password: ")
  17.       b = read("*")
  18.       rednet.send(serv, b)
  19.       e, f = rednet.receive()
  20.       if f == "true" and e == serv then
  21.          rednet.send(serv, x)
  22.          z, y = rednet.receive()
  23.          if y == "error" then
  24.             print("Not a valid selection.")
  25.          elseif y == "correct" then
  26.             term.clear()
  27.             term.setCursorPos(1,1)
  28.             print("Teleporting!")
  29.          end
  30.       else
  31.          print("Password incorrect.")
  32.       end
  33.    elseif i == "breakpass" then
  34.       print ("Break command requires password: ")
  35.       g = read("*")
  36.       rednet.send(serv, g)
  37.       q, i = rednet.receive()
  38.       if i == "true" and q == serv then
  39.          break
  40.       else
  41.          print("Incorrect")
  42.       end
  43.    else
  44.       if i == "error" then
  45.          print("Not a valid selection.")
  46.       elseif i == "correct" then
  47.          term.clear()
  48.          term.setCursorPos(1,1)
  49.          print("teleporting!")
  50.       end
  51.    end
  52.    os.sleep(1)
  53.    term.clear()
  54.    term.setCursorPos(1,1)
  55. end
Advertisement
Add Comment
Please, Sign In to add comment