Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- flyer = "left"
- flyerFeedback = "bottom"
- duperPower = "back"
- networkSide = "right"
- powers = {0,2,2,6,6,8,8,10,12}
- -- -1s : 2 4 6
- function sendFlying()
- redstone.setOutput(flyer,true)
- sleep(0.05)
- redstone.setOutput(flyer,false)
- end
- function waitForFlyer()
- timeout = 1200
- while timeout>=0 do
- timeout = timeout - 1
- if redstone.getInput(flyerFeedback) then
- rednet.broadcast({command="base.flyer.arrived"})
- return
- end
- sleep(0.05)
- end
- print("flyer wait timed out")
- rednet.broadcast({command="base.flyer.timeout"})
- end
- rednet.open(networkSide)
- while rednet.isOpen() do
- senderID,message,distance,protcol = rednet.receive()
- if message.command == "payload.duper.setCount" then
- redstone.setAnalogOutput(duperPower,powers[message.count+1])
- end
- if message.command == "base.flyer.start" then
- sendFlying()
- end
- if message.command == "base.flyer.catch" then
- waitForFlyer()
- end
- end
- print("rednet closed... terminating")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement