systox

NetClient

Mar 26th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. local Passwort_Justin = "2706"
  2.  
  3. function test()
  4. while true do
  5. if rs.testBundledInput("back",colors.yellow) == true then
  6. rs.setBundledOutput("back",colors.white)
  7. print("Recieve")
  8. rednet.open("top")
  9. sleep(1)
  10. benutzer()
  11. break
  12. else
  13. print("Not Connected")
  14. sleep(1)
  15. end
  16. end
  17. end
  18.  
  19. function benutzer()
  20. write("User: ")
  21. if io.read() == "Justin" then
  22. passwort(Passwort_Justin,"Justin")
  23. else
  24. print("Error(1)")
  25. end
  26. end
  27.  
  28. function Auswahl(user)
  29. local input = io.read()
  30. if input == "Holz" then
  31. textutils.slowPrint("Holz wird bestellt ...")
  32. write("wird geliefert an ")
  33. print(user)
  34. rednet.broadcast("Holz",user)
  35. end
  36. end
  37.  
  38. function passwort(pw,user)
  39. write("Passwort: ")
  40. if io.read() == pw then
  41. term.clear()
  42. term.setCursorPos(1,1)
  43. write("Willkommen ")
  44. print(user)
  45. Auswahl(user)
  46. else
  47. print("Falsches Passwort!")
  48. end
  49. end
  50.  
  51. write("Webadresse: ")
  52. local input = io.read()
  53. if input == "www.root.de" then
  54. redstone.setBundledOutput("back",colors.green)
  55. write("Pinging: ")
  56. print("www.root.de")
  57. sleep(2)
  58. test()
  59. elseif input == "www.internet.de" then
  60. redstone.setBundledOutput("back",colors.red)
  61. print("Pinging: ")
  62. write("www.Internet.de")
  63. sleep(6)
  64. test()
  65. end
Add Comment
Please, Sign In to add comment