Advertisement
Guest User

startup

a guest
May 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. --*PROGRAM BY TERCY*--
  2.  
  3.  
  4. --*Set Monitor*--
  5. monitor = "monitor_12"
  6. Mon = peripheral.wrap(monitor)
  7.  
  8. --*Set EnergyCell*--
  9. energyCell = "tile_thermalexpansion_cell_hardened_name_0"
  10. Cell = peripheral.wrap(energyCell)
  11.  
  12. --*Functions*--
  13. function title(color, tit)
  14.  Mon.setTextScale(1)
  15.     w,h = Mon.getSize()
  16.  Mon.clear()
  17.     Mon.setCursorPos(1,1)
  18.     Mon.setBackgroundColor(color)
  19.     Mon.clearLine()
  20.     Mon.write("<")
  21.     Mon.setCursorPos(w,1)
  22.     Mon.write(">")
  23.     Mon.setCursorPos(w/2.1,1)
  24.     Mon.write(tit)
  25.     Mon.setCursorPos(1,2)
  26.     Mon.setBackgroundColor(colors.black)
  27. end
  28.  
  29. function writeEnergy()
  30.     Mon.setCursorPos(w/3.3,3)
  31.  energy = Cell.getEnergyStored()
  32.  Mon.write(energy.."/"..maxEnergy.." RF")
  33.  sleep(0.2)
  34. end
  35.  
  36.  
  37. --*Body*--
  38. maxEnergy = Cell.getMaxEnergyStored()
  39. while true do
  40.   title(colors.blue, "ENERGY")
  41.   writeEnergy()
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement