Advertisement
Guest User

startup

a guest
Feb 1st, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. -- By Sebastian Hofer
  2. -- Version: 1.0
  3.  
  4. reactor = peripheral.wrap("BigReactors-Reactor_0")
  5. mon = peripheral.wrap("monitor_0")
  6.  
  7. low = 1000000
  8. high = 9000000
  9.  
  10. term.clear()
  11. term.setCursorPos(1,1)
  12. write("Running...")
  13.  
  14. while true do
  15.  
  16.   if reactor.getEnergyStored() <= low then
  17.     reactor.setActive(true)
  18.   end
  19.  
  20.   if reactor.getEnergyStored() >= high then
  21.     reactor.setActive(false)
  22.   end
  23.  
  24.   mon.clear()
  25.  
  26.   mon.setCursorPos(1,1)
  27.   mon.setTextColor(colors.white)
  28.   mon.write("Active: ")
  29.   mon.setTextColor(colors.lime)
  30.   mon.write(reactor.getActive())
  31.    
  32.   mon.setCursorPos(1,2)
  33.   mon.setTextColor(colors.white)
  34.   mon.write("RF/T: ")  
  35.   mon.setTextColor(colors.lime)
  36.   mon.write(math.floor(reactor.getEnergyProducedLastTick()) .. "")
  37.  
  38.   mon.setCursorPos(1,3)
  39.   mon.setTextColor(colors.white)
  40.   mon.write("RF Stored: ")
  41.   mon.setTextColor(colors.lime)
  42.   mon.write(math.floor((reactor.getEnergyStored() / 10000000) * 1000) / 10 .. " %")
  43.  
  44.   mon.setCursorPos(1,4)
  45.   mon.setTextColor(colors.white)
  46.   mon.write("Fuel: ")
  47.   mon.setTextColor(colors.lime)
  48.  
  49.   fuel = reactor.getFuelAmount()
  50.   waste = reactor.getWasteAmount()
  51.   max = reactor.getFuelAmountMax()
  52.  
  53.   mon.write((math.floor(((fuel+waste) / max) * 1000) / 10) .. " %")
  54.  
  55.   mon.setCursorPos(1,5)
  56.   mon.setTextColor(colors.white)
  57.   mon.write("Heat: ")
  58.   mon.setTextColor(colors.lime)
  59.   mon.write(math.floor(reactor.getFuelTemperature()) .. "")
  60.   mon.setTextColor(colors.white)
  61.   mon.write(" / ")
  62.   mon.setTextColor(colors.lime)
  63.   mon.write(math.floor(reactor.getCasingTemperature()) .. "")
  64.  
  65.   sleep(5)
  66.  
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement