Advertisement
Guest User

TB_Power

a guest
May 29th, 2015
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.98 KB | None | 0 0
  1. while true do
  2.   local rsignal = redstone.getInput("left")
  3.   local turbine1 = peripheral.wrap("BigReactors-Turbine_0")
  4.   local mon = peripheral.wrap("monitor_0")
  5.   mon.setTextScale(0.5)
  6.   local spin = turbine1.getRotorSpeed()
  7.   mon.clear()
  8.   mon.setCursorPos(1,1)
  9.   mon.write("Turbine 1 spin rate is: "..spin)
  10.  
  11.   if rsignal == true then
  12.     mon.setCursorPos(1,2)
  13.     mon.write("Redstone is currently on")
  14.     while true do
  15.       if spin < 1750 then
  16.         turbine1.setInductorEngaged(false)
  17.         mon.setCursorPos(1,3)
  18.         mon.write("Coils spinning up to speed")
  19.         sleep(2)
  20.       else
  21.         turbine1.setInductorEngaged(true)
  22.         mon.setCursorPos(1,3)
  23.         mon.write("Coils up to speed and engaged")
  24.         break
  25.       end
  26.     end
  27.   else
  28.     mon.setCursorPos(1,2)
  29.     mon.write("Redstone is currently off")
  30.     turbine1.setInductorEngaged(false)
  31.     mon.setCursorPos(1,3)
  32.     mon.write("No power needed - coils disengaged")
  33.   end
  34.   sleep(2)
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement