Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local galymove = require("galymoveAPI")
- -- Parse command-line arguments
- local args = { ... }
- if #args < 1 then
- print("Usage: move <direction> [steps]")
- return
- end
- local direction = args[1]
- local steps = tonumber(args[2]) or 1
- -- Load the position from file
- galymove.loadPositionFromFile()
- -- Move the turtle
- galymove.move(direction, steps)
- -- Save the position to file
- galymove.savePositionToFile()
- -- Retrieve and print the current position
- local currentPosition = galymove.getPosition()
- print("Current Position: x = " .. currentPosition.x .. ", y = " .. currentPosition.y .. ", z = " .. currentPosition.z)
Advertisement
Add Comment
Please, Sign In to add comment