jonassvensson4

Untitled

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