Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --moving the computer in a strafe like fashion (as opposed to 'normal' movement)
- function strafe(direction)
- if direction == "right" then
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- elseif direction == "left" then
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- end
- end
- function move_to_position(sx,sy,sz,x,y,z)
- x_found = false
- y_found = false
- z_found = false
- //moving on y axis first
- if sy > y then
- turtle.down()
- elseif sy < y then
- turtle.up()
- elseif sy == y then
- y_found = true
- //moving on x axis second
- if y_found then
- if sx > x then
- strafe("left")
- elseif sx < x then
- strafe("right")
- elseif sx == x then
- x_found = true
- //moving on z axis third
- if x_found then
- if sz > z then
- turtle.forward()
- elseif sz < z then
- turtle.back()
- elseif sz == z then
- z_found = true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement