Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --API for movement attempts in the directions a turtle can move.
- function forward()
- while not turtle.forward() do
- if turtle.detect() then
- if not turtle.dig() then
- return false
- end
- elseif not turtle.attack() then
- sleep(0.5)
- end
- end
- return true
- end
- function down()
- while not turtle.down() do
- if turtle.detectDown() then
- if not turtle.digDown() then
- return false
- end
- elseif not turtle.attackDown() then
- sleep(0.5)
- end
- end
- return true
- end
- function up()
- while not turtle.up() do
- if turtle.detectUp() then
- if not turtle.digUp() then
- return false
- end
- elseif not turtle.attackUp() then
- sleep(0.5)
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment