Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ----------------------------------------
- -- redstone integrator connection and usage
- -- ----------------------------------------
- redstoneIntegrators = {}
- found = false
- for _, name in pairs(peripheral.getNames()) do
- if peripheral.getType(name) == "redstoneIntegrator" then
- periph = peripheral.wrap(name)
- table.insert(redstoneIntegrators, periph)
- found = true
- end
- end
- if found == false then
- error("There must be at least one RedstoneIntegrator attached to this computer via wired modem!")
- end
- function toggleRedstone(side, enabled)
- for k,v in pairs(redstoneIntegrators) do
- v.setOutput(side, enabled)
- end
- end
Add Comment
Please, Sign In to add comment