Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _,side in pairs(rs.getSides()) do -- this uses the redstone.getSides() call to look at each side of the computer
- if peripheral.isPresent(side) then -- if we find a perhiperal...
- if peripheral.getType(side) == "monitor" then -- then we try to identify if it's one of the peripherals we're looking for
- mon = peripheral.wrap(side) -- if it's what we're looking for, we wrap it
- elseif peripheral.getType(side) == "tank" then
- fluidTank = peripheral.wrap(side)
- elseif peripheral.getType(side) == "modem" then
- if not peripheral.call(side,"isWireless") then -- eliminate wireless modems
- local mdm = peripheral.wrap(side) -- temporarily wrap the modem
- for e,f in pairs(mdm.getNamesRemote()) do -- look for attached peripherals
- if string.sub(f,1,4) == 'tank' then -- if we find a tank
- fluidTank = peripheral.wrap(f) -- wrap it
- elseif string.sub(f,1,7) == 'monitor' then
- mon = perihperal.wrap(f)
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment