Advertisement
soulgriever

Untitled

Oct 1st, 2022
649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. p = peripheral.wrap("right")  --EU Storage location, works on all variations of bat boxes
  2. m = peripheral.wrap("top")  --Monitor location
  3. m.setTextScale(2)
  4.  
  5. while true  do
  6.     x = p.getEUStored() --Takes initial measurement
  7.     sleep(5) --waits 5 seconds to take the measurement again
  8.     y = p.getEUStored() --Takes second measurement
  9.     z = y - x
  10.     s = z/5  --Devides by five to give an average across 5 seconds
  11.     t = s/20 --Assumes a tick of 20 to give you a per tick value
  12.     m.clear()
  13.     m.setCursorPos(1,1)
  14.     m.write(c.."EU/s")
  15.     m.setCursorPos(1,2)
  16.     m.write(t.."EU/t")
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement