Advertisement
Plazter

test turbine

Mar 25th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local function findPeripheral( t, e )
  2.   t = t:lower()
  3.   for _,s in pairs(rs.getSides()) do
  4.         if peripheral.getType(s) == t then
  5.           return peripheral.wrap(s)
  6.         end
  7.   end
  8.   error("No "..(e or t).." attached to the computer.", 0)
  9. end
  10.  
  11.  
  12. while true do
  13.   term.clear()
  14.   term.setCursorPos(1,1)
  15.    
  16.     if t.getRotorSpeed() > 1850 then
  17.       t.setInductorEngaged(true)
  18.       print("turned On the coils!")
  19.       sleep(10)
  20.     elseif t.getRotorSpeed() < 1830 then
  21.       t.setInductorEngaged(false)
  22.       print("Turned off the coils!")
  23.       sleep(2)
  24.   end
  25.  
  26. sleep(5)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement