kriNon

Untitled

Dec 29th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. local totalCap = 0
  2. local totalStore = 0
  3. local percent = 0
  4. local mfsu
  5.  
  6. os.startTimer(1)
  7.  
  8. while true do
  9. totalCap = peripheral.call("back", getEUCapacity())
  10. totalStore = peripheral.call("back", getEUStored())
  11.  
  12. -- Calculate a percentage
  13. percent = math.ceil(totalStore / totalCap) * 100
  14.  
  15. -- Analogue redstone output
  16. redstone.setAnalogOutput("right", (math.ceil(totalStore / totalCap) * 15))
  17.  
  18. os.pullEvent("timer")
  19. os.startTimer(1)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment