Advertisement
Guest User

cube

a guest
Dec 11th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local cube = peripheral.wrap("left")
  2. local monitor = peripheral.wrap("right")
  3.  
  4. local max = cube.getMaxEnergy()
  5. monitor.setTextScale(2.5)
  6. while true do
  7.  term.clear()
  8.  term.setCursorPos(1,1)
  9.     local current = cube.getEnergy()
  10.     print(current)
  11.     print(max)
  12.     local percentage = current/max*100
  13.     print(percentage)
  14.     local writeout = math.floor(percentage) .. "%"
  15.     print(writeout)
  16.     monitor.clear()
  17.     monitor.setCursorPos(1,1)
  18.     monitor.write(writeout)
  19.  sleep(3)
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement