Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- local function turn(direction, inverted)
- if direction == "left" then
- if inverted then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- elseif direction == "right" then
- if inverted then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- end
- while true do
- local exists, details = turtle.inspect()
- if exists and details.name == args[1] then
- break
- end
- turtle.turnLeft()
- end
- for i=1, 16 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(1)
- turn(args[3], true)
- while true do
- local exists, details = turtle.inspect()
- if exists and details.name == args[2] then
- turtle.dig()
- turn(args[3], false)
- turtle.drop()
- turn(args[3], true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement