Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to deposit all items in the turtle's inventory
- local function depositItems()
- for slot = 1, 16 do
- turtle.select(slot)
- turtle.drop()
- end
- end
- -- Main program
- while true do
- print("Press Enter to start the cycle...")
- read() -- Wait for user input
- -- Move forward 16 blocks
- for i = 1, 16 do
- turtle.forward()
- end
- -- Turn left and move forward 3 blocks
- turtle.turnLeft()
- for i = 1, 3 do
- turtle.forward()
- end
- -- Open chest and deposit items
- turtle.select(1)
- turtle.drop()
- depositItems()
- -- Return to starting position
- turtle.turnLeft()
- turtle.turnLeft()
- for i = 1, 3 do
- turtle.forward()
- end
- turtle.turnRight()
- for i = 1, 16 do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- print("Cycle completed. Turtle is back at the starting position.")
- end
Advertisement
Add Comment
Please, Sign In to add comment