Advertisement
Guest User

Simple Turbine Coil Controller

a guest
Feb 7th, 2015
1,564
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. local turbine = peripheral.wrap("back")
  2. if turbine.getConnected then
  3.   print("Connected to turbine!")
  4.   if redstone.getInput("bottom",true) then
  5.     print("Engaging coils!")
  6.     turbine.setInductorEngaged(true)
  7.   else
  8.     print("Disengaging coils!")
  9.     turbine.setInductorEngaged(false)
  10.   end
  11. else
  12.   print("Error, no turbine connected!")
  13. end
  14. while true do
  15.   local event = os.pullEvent("redstone")
  16.   if redstone.getInput("bottom",true) then
  17.     print("Engaging coils!")
  18.     turbine.setInductorEngaged(true)
  19.   else
  20.     print("Disengaging coils!")
  21.     turbine.setInductorEngaged(false)
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement