Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local turbine = peripheral.wrap("back")
- if turbine.getConnected then
- print("Connected to turbine!")
- if redstone.getInput("bottom",true) then
- print("[ON] Engaging coils!")
- turbine.setInductorEngaged(true)
- turbine.setActive(true)
- else
- print("[OFF] Disengaging coils!")
- turbine.setInductorEngaged(false)
- turbine.setActive(false)
- end
- else
- print("Error, no turbine connected!")
- end
- while true do
- local event = os.pullEvent("redstone")
- if redstone.getInput("bottom",true) then
- print("[ON] Engaging coils!")
- turbine.setInductorEngaged(true)
- turbine.setActive(true)
- else
- print("[OFF] Disengaging coils!")
- turbine.setInductorEngaged(false)
- turbine.setActive(false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement