Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local distance = tonumber(args[1])
- local counteddist = 0
- local function digmove()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- end
- local function countdist()
- counteddist = counteddist + 1
- print(counteddist)
- end
- local function returnback()
- if distance == counteddist then
- print("I'm done mining")
- print("I should be returning home")
- turtle.turnRight()
- turtle.turnRight()
- for i = 1, counteddist do
- turtle.forward()
- end
- print("Am i home yet?")
- end
- end
- --Main Script
- for i = 1, distance do
- digmove()
- countdist()
- returnback()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement