Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- maxEnergy = 51200000*120
- mon = peripheral.wrap("right")
- os.loadAPI('/gui')
- powerBar = gui.createButton("powerBar")
- powerBar:draw ( 5,8,30,colors.white,colors.green,true,colors.black,colors.white )
- while true do
- rednet.open("bottom")
- id, curE = rednet.receive()
- totalEnergy = tonumber(curE) * 120
- rawPer = totalEnergy/maxEnergy
- pPercent = math.floor((rawPer*100)+0.5)
- powerBar:update( pPercent )
- print(pPercent)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment