Guest User

RFMobile

a guest
Jan 12th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. while true do
  2.  
  3.   local mon = peripheral.wrap("top")
  4.   local cell = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_5")
  5.   glass = peripheral.wrap("left")
  6.  
  7.   Energy = cell.getEnergyStored()
  8.   Max = cell.getMaxEnergyStored()
  9.   Ratio = (Energy/Max)
  10.  
  11.   mon.clear()
  12.   glass.clear()
  13.  
  14.     if Energy >= 1000000 then
  15.     mon.setCursorPos(1,1)
  16.     mon.setTextColor(colors.white)
  17.     mon.write("EnergyStored:  ")
  18.     mon.setCursorPos(1,2)
  19.     mon.setTextColor(colors.yellow)
  20.     mon.write(math.ceil(Energy/1000000).."mRF/"..math.ceil(Max/1000000).."mRF")
  21.  
  22.     glass.addText(1,1,"EnergyStored:  "..math.ceil(Energy/1000000).."mRF/"..math.ceil(Max/1000000).."mRF")
  23.  
  24.     else
  25.     mon.setCursorPos(1,1)
  26.     mon.setTextColor(colors.white)
  27.     mon.write("EnergyStored:  ")
  28.     mon.setCursorPos(1,2)
  29.     mon.setTextColor(colors.yellow)
  30.     mon.write(math.ceil(Energy).."RF/"..math.ceil(Max/1000000).."mRF")
  31.  
  32.     glass.addText(1,1,"EnergyStored:  "..math.ceil(Energy).."RF/"..math.ceil(Max/1000000).."mRF")
  33.  
  34.     end
  35.  
  36.   mon.setCursorPos(1,3)
  37.   mon.setTextColor(colors.white)
  38.   mon.write("Percent Full:  ")
  39.   mon.setCursorPos(1,4)
  40.   mon.setTextColor(colors.red)
  41.   mon.write(math.ceil(Ratio*100))
  42.  
  43.   glass.addText(1,10,"Percent Full:  "..math.ceil(Ratio*100))
  44.   glass.sync()
  45.  
  46.   os.startTimer(0.5)
  47.   local event = os.pullEvent()
  48.     if event == "key" then
  49.       break
  50.     else
  51.       event = ""
  52.     end
  53.  
  54. end
Advertisement
Add Comment
Please, Sign In to add comment