smigger22

Door Lock - Pocket

Feb 9th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. x, y = term.getSize()
  3. doorID = 3192
  4.  
  5. function centered(str, height)
  6.     term.setCursorPos(x / 2 - #str / 2, height)
  7.     term.write(str)
  8. end
  9.  
  10. function indented(str, indent, height)
  11.     term.setCursorPos(indent, height)
  12.     term.write(str)
  13. end
  14.  
  15. function left(str, height)
  16.     term.setCursorPos(1, height)
  17.     term.write(str)
  18. end
  19.  
  20. function right(str, height)
  21.     term.setCursorPos(x - #str, height)
  22. end
  23.  
  24. function clearLine(colour, height)
  25.     term.setCursorPos(1, height)
  26.     term.setBackgroundColour(colours[colour])
  27.     term.clearLine()
  28. end
  29.  
  30. while true do
  31.     rednet.open("back")
  32.     term.setBackgroundColour(colours.cyan)
  33.     term.clear()
  34.     term.setTextColour(colours.lightBlue)
  35.     clearLine("blue", 1)
  36.     clearLine("blue", 2)
  37.     clearLine("blue", 3)
  38.     indented("EpicCo", 2, 2)
  39.     term.setBackgroundColour(colours.cyan)
  40.     indented("Username: ", 2, 6)
  41.     indented("Password: ", 2, 8)
  42.     term.setCursorPos(12, 6)
  43.     usernameAuth = read()
  44.     term.setCursorPos(12, 8)
  45.     passwordAuth = read("*")
  46.     rednet.send(doorID, {username = usernameAuth, password = passwordAuth})
  47. end
Advertisement
Add Comment
Please, Sign In to add comment