Advertisement
Guest User

nrg

a guest
Oct 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. local mon = peripheral.wrap("monitor_0")
  2. local bat = peripheral.wrap("Induction Matrix_0")
  3. local pre = 0
  4. mon.setBackgroundColor(colors.blue)
  5. mon.setTextColor(colors.white)
  6. mon.clear()
  7.  
  8. while true do
  9.   local n = bat.getEnergy()
  10.   mon.setCursorPos(25,10)
  11.   mon.write(tostring(math.floor(n)).."          ")
  12.   mon.setCursorPos(25,11)
  13.   mon.write(tostring(math.floor((n/bat.getMaxEnergy())*100)).."   ")
  14.   local dif = (n - pre) / 20
  15.   mon.setCursorPos(25,12)
  16.   mon.write(tostring(math.floor(n-pre)).."  "..tostring(math.floor(dif)).."          ")  
  17.   pre = n
  18.   sleep(1)
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement