Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bank=peripheral.wrap("top")
- sMax=80 --Max Energy in %
- sMin=50 --Min Energy in %
- blocks=4 --Block Count
- uu=true
- maxStorage=bank.getMaxEnergyStored()*blocks
- function calculator()
- maxEnergy = maxStorage / 100 * sMax
- minEnergy = maxStorage / 100 * sMin
- end
- while true do
- calculator()
- storage=bank.getEnergyStored()*blocks
- term.clear()
- term.setCursorPos(1,1)
- percent=storage*100/maxStorage
- if percent == 100 then
- elseif percent < 10 then
- percent=string.sub(percent,1,1)
- else
- percent=string.sub(percent,1,2)
- end
- print(percent.."%")
- print(storage.." RF")
- if storage > maxEnergy and uu == false then
- uu=true
- elseif storage < minEnergy and uu == true then
- uu=false
- end
- rs.setOutput("front",uu)
- print(uu)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement