Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local p = peripheral.wrap("left")
- p.activate()
- function waitForMagnet()
- while true do
- local x,y,z = p.getDistanceToTarget()
- if x,y,z == 0,-0.5,0 then
- break
- end
- sleep(.2)
- end
- end
- for x = 1,5 do
- for z = 1,3 do
- p.setTarget(x,0,z-2)
- waitForMagnet()
- p.toggle()
- while not p.isGrabbing() do end
- p.setTarget(x,3,z-2)
- waitForMagnet()
- p.toggle()
- while not p.isGrabbing() do end
- end
- end
- p.deactivate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement