Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = {...}
- forward = tArgs[1] - 1
- across = tArgs[2]
- direction = tArgs[3]
- function move()
- while not turtle.forward() do
- turtle.attack()
- turtle.dig()
- end
- end
- function dig()
- if turtle.detectDown() then
- turtle.digDown()
- turtle.placeDown()
- end
- end
- function changeDirection()
- if(direction == "right") then
- direction = "left"
- else
- direction = "right"
- end
- end
- function mineForward(length)
- for x = 0, length do
- dig()
- if(x < tonumber(length)) then
- move()
- end
- end
- end
- function turn()
- if(direction == "right") then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- function nextRow()
- turn()
- mineForward(1)
- turn()
- changeDirection()
- end
- function unload()
- for i = 2, 16 do
- turtle.select(i)
- turtle.dropUp()
- end
- turtle.select(1)
- end
- function goHome()
- for i = 1, forward do
- move()
- end
- turtle.turnRight()
- for i = 1, forward do
- move()
- end
- turtle.turnRight()
- end
- function main()
- for y = 1, across do
- mineForward(forward)
- if(y < tonumber(across)) then
- nextRow()
- else
- turn()
- turn()
- end
- end
- end
- while true do
- main()
- goHome()
- unload()
- print("1.5 hours remaining")
- sleep(1800)
- print("1 hour remaining")
- sleep(1800)
- print("Half an hour remaining")
- sleep(1700)
- for x = 1, 10 do
- print(x.. " seconds until harvest")
- sleep(1)
- end
- end
Add Comment
Please, Sign In to add comment