Advertisement
nayoshi12

Untitled

Nov 4th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. edit--Peripherals
  2. reactor = peripheral.wrap("back")
  3. monitor = peripheral.wrap("monitor_4")
  4. glowstone = peripheral.wrap("thermalexpansion_light_0","thermalexpansion_light_1")
  5. --Constant variables
  6. totalEnergy = 1000000
  7. totalFuelCapacity = reactor.getFuelAmountMax()
  8.  
  9.  
  10.  
  11. --Now we are going to create the bar graph
  12.  
  13.  
  14.  
  15.     justWrite(1,1,"Reactor Program")
  16.     resetFont()
  17. while true do
  18.    
  19.  
  20.  
  21.     currentFuel = reactor.getFuelAmount()
  22.     currentEnergy = reactor.getEnergyStored()
  23.  de = barGraphPreInit(currentEnergy,totalEnergy)
  24.     RFProducedLastTick = math.floor(reactor.getEnergyProducedLastTick())
  25.     FuelConsumedLastTick = math.floor(reactor.getFuelConsumedLastTick())
  26.     barGraphInit("Energy Stored",1,2,currentEnergy)
  27.     barGraphInit("Fuel Stored",1,3,currentFuel)
  28.     barGraphInit("RF Produced",1,4,RFProducedLastTick)
  29.     barGraphInit("Fuel Consumed",1,5,FuelConsumedLastTick)
  30.  print(de)
  31.  if de == 0 then
  32.  glowstone.setColor(0x000000)
  33.  elseif de == 1 then
  34.  glowstone.setColor(0xbbf144)
  35.  elseif de == 5 then
  36.  glowstone.setColor(0xffff00)
  37.  elseif de == 10 then
  38.  glowstone.setColor(0xff0000)
  39.  end
  40.     sleep(1)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement