Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Energycells 1-5
- con = {
- peripheral.wrap("cofh_thermalexpansion_energycell_17")
- peripheral.wrap("cofh_thermalexpansion_energycell_18")
- peripheral.wrap("cofh_thermalexpansion_energycell_19")
- peripheral.wrap("cofh_thermalexpansion_energycell_20")
- peripheral.wrap("cofh_thermalexpansion_energycell_21")
- }
- -- Monitor
- local mon = peripheral.wrap('right')
- -- Reading the Amount of Energy
- function getEnergy(Str)
- return con[Str].getEnergyStored("unknown")
- end
- -- Reading Max Energy
- function getMaxEnergy(Str)
- return con[Str].getMaxEnergyStored("unknown")
- end
- -- Giving out a Percentage
- function percent(minVal, maxVal)
- return math.floor((minVal/maxVal)*100)
- end
- -- Displaying the Amount of Energy and the Percentage of Energy on an monitor
- while true do
- for i = 1, 5 do
- mon.setCursorPos((i*2)-1, 1)
- mon.write("Energycell "..i..": "..getEnergy(i).." Redstone Flux "..percent(getEnergy(i), getMaxEnergy(i)).."%")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement