chand1012

tekkit reactor code

Jul 18th, 2016
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2. function return_line()
  3.     local cX,cY = monitor.getCursorPos()
  4.     monitor.setCursorPos(1,cY+1)
  5. end
  6. ]]--
  7.  
  8. local reactor = peripheral.wrap("back")
  9. local monitor = peripheral.wrap("right")
  10. monitor.setCursorBlink(false)
  11. monitor.setTextScale(0.95)
  12. while true do
  13.     local redstone_on = redstone.getInput('front')
  14.  
  15.     if redstone_on == true then
  16.         reactor.setActive(true)
  17.     else
  18.         reactor.setActive(false)
  19.     end
  20.     local state
  21.     local waste = reactor.getWasteAmount()
  22.     local output = reactor.getEnergyProducedLastTick()
  23.     local fuel = reactor.getFuelAmount()
  24.     local fuel_temp = reactor.getFuelTemperature()
  25.     local casing_temp = reactor.getCasingTemperature()
  26.     local react = reactor.getFuelReactivity()
  27.     local on = reactor.getActive()
  28.     local energy = reactor.getEnergyStored()
  29.     if on == true then
  30.         state = "ON"
  31.     else
  32.         state = "OFF"
  33.     end
  34.     monitor.clear()
  35.     monitor.setCursorPos(1,1)
  36.     monitor.write("Reactor is " .. state .. ".")
  37.     local cX,cY = monitor.getCursorPos()
  38.     monitor.setCursorPos(1,cY+1)
  39.     monitor.write("Energy Stored in RF: " .. energy)
  40.     local cX,cY = monitor.getCursorPos()
  41.     monitor.setCursorPos(1,cY+1)
  42.     monitor.write("Power being producedin RF/tick: " .. output)
  43.     local cX,cY = monitor.getCursorPos()
  44.     monitor.setCursorPos(1,cY+1)
  45.     monitor.write("Amount of fuel in mB: " .. fuel)
  46.     local cX,cY = monitor.getCursorPos()
  47.     monitor.setCursorPos(1,cY+1)
  48.     monitor.write("Amount of waste in mB: " .. waste)
  49.     local cX,cY = monitor.getCursorPos()
  50.     monitor.setCursorPos(1,cY+1)
  51.     monitor.write("Fuel temp in C: " .. fuel_temp)
  52.     local cX,cY = monitor.getCursorPos()
  53.     monitor.setCursorPos(1,cY+1)
  54.     monitor.write("Casing temp in C: " .. casing_temp)
  55.     local cX,cY = monitor.getCursorPos()
  56.     monitor.setCursorPos(1,cY+1)
  57.     monitor.write("Reaction Level: " .. react)
  58.     local cX,cY = monitor.getCursorPos()
  59.     monitor.setCursorPos(1,cY+1)
  60.     sleep(1)
  61. end
RAW Paste Data