Advertisement
rjtwins

MC Computercraft Storage Cell To Monitor

Jul 22nd, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local cell = peripheral.wrap("right")
  2. local m = peripheral.wrap("monitor_2")
  3. local energy = 0
  4. local energyMax = 0
  5.  
  6. while true do
  7.     -- Getting and setting status vars.--
  8.     energy = cell.getEnergyStored()
  9.     energy = energy/1000000
  10.     energyMax = cell.getMaxEnergyStored
  11.     ebergyMax = energyMax/1000000
  12.     --Displaying status vars.--
  13.     m.clear()
  14.  
  15.     m.setCursorPos(1,1)
  16.     m.setTextColor(colors.cyan)
  17.     m.write("Energy Core Information")
  18.  
  19.     m.setCursorPos(1,2)
  20.     m.setTextColor(colors.white)
  21.     m.write("Energy Stored: ")
  22.     m.setCursorPos(20,2)
  23.     m.setTextColor(colors.red)
  24.     m.write(..energy " mRF")
  25.  
  26.     m.setCursorPos(1,3)
  27.     m.setTextColor(colors.white)
  28.     m.write("Storage Cap: ")
  29.     m.setCursorPos(20,3)
  30.     m.setTextColor(colors.red)
  31.     m.write(..energyMax "mRF")
  32.  
  33.     --Redo every 0.1 sec.--
  34.     os.sleep(0.1)
  35.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement