Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Basic side determintation for wrapping
- function getDeviceSide(deviceType)
- deviceType = deviceType:lower()
- for i, side in pairs(rs.getSides()) do
- if (peripheral.isPresent(side)) then
- if (string.lower(peripheral.getType(side)) == deviceType) then
- return side;
- end
- end
- end
- return nil;
- end
- --Peripheral wrapping
- function wrapThis(thing, f)
- local wrapped = nil
- while wrapped == nil and f <= 100 do
- wrapped = peripheral.wrap(thing.."_"..f)
- f = f + 1
- end
- if wrapped == nil then
- side = getDeviceSide(thing)
- if side ~= nil then
- return peripheral.wrap(side)
- else
- return nil
- end
- else
- return wrapped
- end
- end
- --Finding turbine
- local turbine = wrapThis("BigReactors-Turbine", 0)
- if turbine == nil then
- sleep(5)
- finished = true
- os.reboot()
- end
- --Redstone emitor
- while true do
- if turbine.getActive() then
- rs.setOutput("right", true)
- else
- rs.setOutput("right", false)
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment