Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_0")
- cell1 = peripheral.wrap("cofh_thermalexpansion_energycell_0")
- cell2 = peripheral.wrap("cofh_thermalexpansion_energycell_1")
- cell3 = peripheral.wrap("cofh_thermalexpansion_energycell_2")
- cell4 = peripheral.wrap("cofh_thermalexpansion_energycell_3")
- p = peripheral.wrap("back")
- -----------------------------------
- rf1 = cell1.getEnergyStored("left")
- rf2 = cell2.getEnergyStored("left")
- rf3 = cell3.getEnergyStored("left")
- rf4 = cell4.getEnergyStored("left")
- energyPercent = 25
- -----------------------------------
- function poweron()
- redstone.setOutput("back", true)
- end
- function poweroff()
- redstone.setOutput("back", false)
- end
- function pulse()
- redstone.setOutput("back", true)
- sleep(0.7)
- redstone.setOutput("back", false)
- end
- function info()
- mon.setCursorPos(8,4)
- mon.write("RF:" ..rf1)
- mon.setCursorPos(8,5)
- mon.write("RF:" ..rf2)
- mon.setCursorPos(8,6)
- mon.write("RF:" ..rf3)
- mon.setCursorPos(8,7)
- mon.write("RF:" ..rf4)
- end
- -----------------------------------
- function getEnergy()
- return cell1.getEnergyStored("left") end
- function getMaxEnergy()
- return cell1.getMaxEnergyStored("left") end
- function getEnergyPercent()
- return math.floor(getEnergy()/getMaxEnergy()*100) end
- -----------------------------------
- while true do
- mon.clear()
- mon.setTextColor(colors.white)
- mon.setCursorPos(2,2)
- mon.write("Energy cells")
- mon.setCursorPos(20,2)
- mon.write("Generator")
- mon.setCursorPos(2,4)
- mon.write("CELL1")
- mon.setCursorPos(2,5)
- mon.write("CELL2")
- mon.setCursorPos(2,6)
- mon.write("CELL3")
- mon.setCursorPos(2,7)
- mon.write("CELL4")
- -----------------------------------
- if getEnergyPercent() >= energyPercent then
- info()
- else
- info()
- end
- sleep(reCheckTimer)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement