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