SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- ### DATOR 1 |
| 1 | + | |
| 2 | print("Reactor ON/OFF")
| |
| 3 | - | rednet.open("SIDA")
|
| 3 | + | print("Turbine ON/OFF")
|
| 4 | ||
| 5 | local reactor = peripheral.wrap("BigReactors-Reactor_0")
| |
| 6 | - | print("Type 'wheat on/off' to enable/disable wheat farm")
|
| 6 | + | local turbine = peripheral.wrap("BigReactors-Turbine_0")
|
| 7 | - | print("Type 'tree on/off' to enable/disable tree farm")
|
| 7 | + | |
| 8 | - | print("Type 'rubber on/off' to enable/disable rubber farm")
|
| 8 | + | -- Turn on |
| 9 | while true do | |
| 10 | - | local state_wheat = false |
| 10 | + | |
| 11 | - | local state_tree = false |
| 11 | + | |
| 12 | - | local state_rubber = false |
| 12 | + | if message == "reactor on" then |
| 13 | reactor.setActive(true) | |
| 14 | - | -- ON |
| 14 | + | print("Reactor is now turned on")
|
| 15 | - | while ( true ) do |
| 15 | + | elseif message == "turbine on" then |
| 16 | turbine.setActive(true) | |
| 17 | print("Turbine is now turned on")
| |
| 18 | - | if message == "wheat on" then |
| 18 | + | |
| 19 | - | state_wheat = true |
| 19 | + | -- Turn off |
| 20 | - | rednet.send(ID, "won") |
| 20 | + | if message == "reactor off" then |
| 21 | - | elseif message == "tree on" then |
| 21 | + | reactor.setActive(false) |
| 22 | - | state_tree = true |
| 22 | + | print("Reactor is now turned off")
|
| 23 | - | rednet.send(ID, "ton") |
| 23 | + | elseif message == "turbine off" then |
| 24 | - | elseif message == "rubber on" then |
| 24 | + | turbine.setActive(false) |
| 25 | - | state_rubber = true |
| 25 | + | print("Turbine is now turned off")
|
| 26 | - | rednet.send(ID, "ron") |
| 26 | + | |
| 27 | end |