Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- round = 1
- max = 5
- function pickUp()
- for i = 0, 5 do turtle.suck(99) end
- for i = 0, 5 do turtle.suckUp(99) end
- for i = 0, 5 do turtle.suckDown(99) end
- end
- while (round < max) do
- for rot = 0, 3 do
- -- First, up
- success, data = turtle.detectUp()
- if success then
- if string.match(data["name"], "ore") then
- turtle.digUp()
- sleep(1)
- pickUp()
- end
- end
- -- Next, down
- success, data = turtle.detectUp()
- if success then
- if string.match(data["name"], "ore") then
- turtle.digUp()
- sleep(1)
- pickUp()
- end
- end
- -- Last, forward
- success, data = turtle.detectUp()
- if success then
- if string.match(data["name"], "ore") then
- turtle.digUp()
- sleep(1)
- pickUp()
- end
- end
- -- Move forward
- turtle.forward()
- end
- round = round + 1
- turtle.turnLeft()
- print("Round", round, "done")
- end
- print("Done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement