jonassvensson4

Untitled

Aug 17th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. -- ### DATOR 1
  2.  
  3. rednet.open("top")
  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(8, "won")
  15. end
  16. if message == "tree on" then
  17.     rednet.send(8, "ton")
  18. end
  19. if message == "rubber on" then
  20.     rednet.send(8, "ron")
  21. end
  22.  
  23. -- OFF
  24. if message == "wheat off" then
  25.     rednet.send(8, "woff")
  26. end
  27. if message == "tree off" then
  28.     rednet.send(8, "toff")
  29. end
  30. if message == "rubber off" then
  31.     rednet.send(8, "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. if message == "won1" then
  66.     rs.setOutput("SIDA", true)
  67.         rednet.send(8, "won1")
  68. end
  69. if message == "ton1" then
  70.     rs.setOutput("SIDA", true)
  71.         rednet.send(8, "ton1")
  72. end
  73. if message == "ron1" then
  74.     rs.setOutput("SIDA", true)
  75.         rednet.send(8, "ron1")
  76. end
Advertisement
Add Comment
Please, Sign In to add comment