Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local sOpenedModem = nil
- local function openModem()
- for n,sModem in ipairs( peripheral.getNames() ) do
- if peripheral.getType( sModem ) == "modem" then
- if not rednet.isOpen( sModem ) then
- rednet.open( sModem )
- sOpenedModem = sModem
- end
- return true
- end
- end
- print( "No modems found." )
- return false
- end
- if not openModem() then
- print("Failed!")
- end
- while true do
- command = rednet.receive()
- if command == "Reactor_ON" then
- redstone.setOutput("back", true)
- print("Reactor ON!")
- else if command == "Reactor_OFF" then
- redstone.setOutput("back", false)
- print("Reactor OFF!")
- end
- end
- rednet.close(sOpenedModem)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement