Advertisement
Guest User

controller

a guest
Sep 20th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. R = peripheral.wrap("BigReactors-Reactor_0")
  2. M = peripheral.wrap("top")
  3.  
  4. High = 8000000
  5. Low = 1000000
  6.  
  7.  
  8. while (true) do
  9.  
  10.   M.clear()
  11.   M.setTextScale(1.5)
  12.  
  13.  
  14.   M.setCursorPos(1,1)
  15.   M.setTextColor(colors.white)
  16.   M.write("Reactor Active: ")
  17.   M.setTextColor(colors.lime)
  18.   M.write(tostring(R.getActive()))
  19.  
  20.   M.setTextColor(colors.white)
  21.   M.setCursorPos(1,2)
  22.   M.write("Tempature: ")
  23.   M.setTextColor(colors.lightBlue)
  24.   M.write( math.floor(R.getFuelTemperature()).." C")
  25.  
  26.   M.setTextColor(colors.white)
  27.   M.setCursorPos(1,3)
  28.   M.write("Casing Temp: ")
  29.   M.setTextColor(colors.lightBlue)
  30.   M.write( math.floor(R.getCasingTemperature()).. " C")
  31.  
  32.   M.setTextColor(colors.white)
  33.   M.setCursorPos(1,4)
  34.   M.write("Energy Output: ")
  35.   M.setTextColor(colors.yellow)
  36.   M.write( math.floor(R.getEnergyProducedLastTick()).. " RF/t")
  37.  
  38.  
  39.   M.setTextColor(colors.white)
  40.   M.setCursorPos(1,5)
  41.   M.write("Energy Stored: ")
  42.   M.setTextColor(colors.yellow)
  43.   M.write( R.getEnergyStored().. " RF")
  44.  
  45.  
  46.   if R.getEnergyStored() < Low then
  47.     R.setActive(true)
  48.   end
  49.  
  50.   if R.getEnergyStored() > High then
  51.     R.setActive(false)
  52.   end
  53.  
  54.  
  55.   sleep(5)
  56.  
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement