Advertisement
sirtussin

client

Feb 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. myip = os.computerID()
  2. print(myip)
  3. print("lights on, lights off, hello")
  4.  
  5. hal = 119
  6.  
  7. light1 = 110
  8. light2 = 135
  9. light3 = 136
  10. light4 = 137
  11. light5 = 138
  12. light6 = 139
  13. light7 = 140
  14. light8 = 141
  15. light9 = 142
  16. light10 = 143
  17. light11 = 144
  18. light12 = 145
  19. light13 = 146
  20. light14 = 147
  21. light15 = 148
  22. light16 = 149
  23. light17 = 150
  24. light18 = 151
  25. light19 = 152
  26. light20 = 153
  27. light21 = 154
  28. light22 = 155
  29. light23 = 156
  30. light24 = 157
  31. light25 = 158
  32.  
  33.  
  34.  
  35. rednet.open("bottom")
  36.  
  37. function turnlightson()
  38. rednet.send(light1, "lights on")
  39. rednet.send(light2, "lights on")
  40. rednet.send(light3, "lights on")
  41. rednet.send(light4, "lights on")
  42. rednet.send(light5, "lights on")
  43. rednet.send(light6, "lights on")
  44. rednet.send(light7, "lights on")
  45. rednet.send(light8, "lights on")
  46. rednet.send(light9, "lights on")
  47. rednet.send(light10, "lights on")
  48. rednet.send(light11, "lights on")
  49. rednet.send(light12, "lights on")
  50. rednet.send(light13, "lights on")
  51. rednet.send(light14, "lights on")
  52. rednet.send(light15, "lights on")
  53. rednet.send(light16, "lights on")
  54. rednet.send(light17, "lights on")
  55. rednet.send(light18, "lights on")
  56. rednet.send(light19, "lights on")
  57. rednet.send(light20, "lights on")
  58. rednet.send(light21, "lights on")
  59. rednet.send(light22, "lights on")
  60. rednet.send(light23, "lights on")
  61. rednet.send(light24, "lights on")
  62. rednet.send(light25, "lights on")
  63. end
  64.  
  65. function turnlightsoff()
  66. rednet.send(light1, "lights off")
  67. rednet.send(light2, "lights off")
  68. rednet.send(light3, "lights off")
  69. rednet.send(light4, "lights off")
  70. rednet.send(light5, "lights off")
  71. rednet.send(light6, "lights off")
  72. rednet.send(light7, "lights off")
  73. rednet.send(light8, "lights off")
  74. rednet.send(light9, "lights off")
  75. rednet.send(light10, "lights off")
  76. rednet.send(light11, "lights off")
  77. rednet.send(light12, "lights off")
  78. rednet.send(light13, "lights off")
  79. rednet.send(light14, "lights off")
  80. rednet.send(light15, "lights off")
  81. rednet.send(light16, "lights off")
  82. rednet.send(light17, "lights off")
  83. rednet.send(light18, "lights off")
  84. rednet.send(light19, "lights off")
  85. rednet.send(light20, "lights off")
  86. rednet.send(light21, "lights off")
  87. rednet.send(light22, "lights off")
  88. rednet.send(light23, "lights off")
  89. rednet.send(light24, "lights off")
  90. rednet.send(light25, "lights off")
  91. end
  92.  
  93. while true do
  94. input = read()
  95.   if input == "lights" or "lights on" or  "lightson" then
  96.   turnlightson()
  97.   rednet.send(hal, input)
  98.   elseif input == "lights off" or "lightsoff" then
  99.   turnlightsoff()
  100.   rednet.send(hal, input)
  101.   else
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement