Advertisement
dyl421421

Red Control Client

Feb 19th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. local pullEventBackup = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3. --[[
  4. Some rights reserved (CC-BY-NC-SA).
  5. More info about it can be fount here: http://crteativecommons.org
  6. Coded by jesusthekiller - github.com/jesusthekiller
  7. ]]
  8. --CONFIG--
  9. local password = "pass" --password?
  10. local serverID = 1337 --server ID, shows up on server screen :P/>/>
  11. local modemSide = "back" --side of modem
  12. --END OF CONFIG, DO NOT EDIT BELOW THIS LINE--
  13. local function clear()
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. print("ID of this computer: " .. os.computerID())
  17. end
  18. local function printLoginMessage()
  19. print([[
  20. Password:
  21.  
  22. -----------
  23. ]])
  24. end
  25. while true do
  26. clear()
  27. printLoginMessage()
  28. term.setCursorPos(21,3)
  29. if read("x") == password then
  30. clear()
  31. print("Redstone request has been sent.")
  32. rednet.open(modemSide)
  33. rednet.send(serverID, "doOpen")
  34. rednet.close(modemSide)
  35. sleep(2)
  36. clear()
  37. printLoginMessage()
  38. else
  39. clear()
  40. print("Wrong Password!")
  41. sleep(2)
  42. printLoginMessage()
  43. end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement