Shadows_Player

Untitled

Oct 10th, 2022
892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. while true do
  2.  m = peripheral.wrap("right")
  3.  turb = peripheral.wrap("BigReactors-Turbine_1")
  4.  spe = turb.getRotorSpeed()
  5.  
  6.   m.setCursorPos(1,1)
  7.   m.write("Speed of Turbine: ")
  8.  if spe>1800 then
  9.   m.setTextColor(colors.green)
  10.   m.setCursorPos(18,1)
  11.   m.write(math.floor(spe + 0.5))
  12.   m.setTextColor(colors.white)
  13.   turb.setFluidFlowRateMax(1000)
  14.   turb.setInductorEngaged(true)
  15.   m.setCursorPos(1,2)
  16.   m.setTextColor(colors.white)
  17.   m.write("Warning: Coils Unlocked")
  18.  end
  19.  if spe<900 then
  20.   m.setTextColor(colors.yellow)
  21.   m.setCursorPos(18,1)
  22.   m.write(math.floor(spe + 0.5))
  23.   m.setTextColor(colors.white)
  24.   turb.setFluidFlowRateMax(2000)
  25.   turb.setInductorEngaged(false)
  26.   m.setCursorPos(1,2)
  27.   m.setTextColor(colors.white)
  28.   m.write("Warning: Low Speed")
  29.  end
  30.  if spe>1900 then
  31.    m.setTextColor(colors.red)
  32.    m.setCursorPos(18,1)
  33.    m.write(math.floor(spe + 0.5))
  34.    m.setTextColor(colors.white)
  35.    turb.setFluidFlowRateMax(0)
  36.    turb.setInductorEngaged(true)
  37.    m.setCursorPos(1,2)
  38.    m.setTextColor(colors.white)
  39.    m.write("Warning: Overspeed")
  40.  end
  41.   m.setCursorPos(1,1)
  42.   sleep(0.5)
  43. end
  44.  
Tags: turbine
Advertisement
Add Comment
Please, Sign In to add comment