jonassvensson4

Untitled

Aug 17th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.76 KB | None | 0 0
  1. -- ### DATOR 1
  2.  
  3. rednet.open("SIDA")
  4.  
  5. -- COMMAND LIST
  6. print("Type 'wheat on/off' to enable/disable wheat farm")
  7. print("Type 'tree on/off' to enable/disable tree farm")
  8. print("Type 'rubber on/off' to enable/disable rubber farm")
  9.  
  10. -- ON
  11. While ( true ) do
  12.     local input = read()
  13. if message == "wheat on" then
  14.     rednet.send(ID, "won")
  15. end
  16. if message == "tree on" then
  17.     rednet.send(ID, "ton")
  18. end
  19. if message == "rubber on" then
  20.     rednet.send(ID, "ron")
  21. end
  22.  
  23. -- OFF
  24. if message == "wheat off" then
  25.     rednet.send(ID, "woff")
  26. end
  27. if message == "tree off" then
  28.     rednet.send(ID, "toff")
  29. end
  30. if message == "rubber off" then
  31.     rednet.send(ID, "roff")
  32. end
  33.  
  34. -- ENABLED/DISABLED LIST
  35. message = rednet.receive()
  36.  
  37. -- ON
  38. if message == "won1" then
  39.     print("Wheat farm [enabled]")
  40. end
  41. if message == "ton1" then
  42.     print("Tree farm [enabled]")
  43. end
  44. if message == "ron1" then
  45.     print("Rubber farm [enabled]")
  46. end
  47.  
  48. -- OFF
  49. if message == "woff1" then
  50.     print("Wheat farm [disabled]")
  51. end
  52. if message == "toff1" then
  53.     print("Tree farm [disabled]")
  54. end
  55. if message == "roff1" then
  56.     print("Rubber farm [disabled]")
  57. end
  58.  
  59. -- ### DATOR 2
  60. rednet.open("SIDA")
  61.  
  62. message = rednet.receive()
  63.  
  64. -- ON
  65. while ( true ) do
  66.     local input = read()
  67. if message == "won" then
  68.     rs.setOutput("SIDA", true)
  69.         rednet.send(ID, "won1")
  70. end
  71. if message == "ton" then
  72.     rs.setOutput("SIDA", true)
  73.         rednet.send(ID, "ton1")
  74. end
  75. if message == "ron" then
  76.     rs.setOutput("SIDA", true)
  77.         rednet.send(ID, "ron1")
  78. end
  79.  
  80.  
  81. -- OFF
  82. if message == "woff1" then
  83.     rs.setOutput("SIDA", false)
  84.         rednet.send(ID, "woff1")
  85. end
  86. if message == "toff1" then
  87.     rs.setOutput("SIDA", false)
  88.         rednet.send(ID, "toff1")
  89. end
  90. if message == "roff1" then
  91.     rs.setOutput("SIDA", false)
  92.         rednet.send(ID, "roff1")
  93. end
Advertisement
Add Comment
Please, Sign In to add comment