Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.wrap("right")
- local peripheralList = peripheral.getNames()
- local Bat1Max = 1
- local Bat1Amount = 1
- for index = 1,#peripheralList do
- if string.find(peripheralList[Index],"cofh_thermalexpansion_energycell_2") then
- Bat1 = peripheral.wrap(peripheralList[Index])
- Bat1Max = Bat1.getMaxEnergyStored("unknown")
- print("Energycell on wired modem: ",peripheralList[Index]," connected")
- end
- end
- while true do
- if peripheral.isPresent("cofh_thermalexpansion_energycell_2") then
- Bat1Amount = Bat1.getEnergyStored("unknown")
- end
- if Bat1Amount < 48000000 then
- rs.setOutput("front",true)
- else
- rs.setOutput("front",false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement