Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cell1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
- cell2 = peripheral.wrap("cofh_thermalexpansion_energycell_1")
- function off()
- percent()
- redstone.setOutput("back", false)
- if cellpercent < 150 then
- print(tonumber(cellpercent).."%")
- sleep(20)
- percent()
- end
- end
- function on()
- percent()
- while cellpercent < 195 do
- print(tonumber(cellpercent).."%")
- redstone.setOutput("back", false)
- sleep(20)
- percent()
- end
- redstone.setOutput("back", true)
- end
- function poke()
- cell1Stored = cell1.getEnergyStored("cofh_thermalexpansion_energycell_0")
- cell1Full = cell1.getMaxEnergyStored("cofh_thermalexpansion_energycell_0")
- cell2Stored = cell2.getEnergyStored("cofh_thermalexpansion_energycell_1")
- cell2Full = cell2.getMaxEnergyStored("cofh_thermalexpansion_energycell_1")
- cell1Percent = math.floor(100*cell1Stored/cell1Full)
- cell2Percent = math.floor(100*cell2Stored/cell2Full)
- end
- function percent()
- poke()
- cellpercent = cell1Percent + cell2Percent
- end
- while true do
- on()
- --off()
- --percent()
- print("sleeping...")
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment