Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curPos = {
- x = 0,
- y = 0,
- z = 0,
- rot = 0
- }
- function ReturnHome()
- if curPos.x > 0 then
- MoveDir(curPos.x, -90)
- elseif curPos.x < 0 then
- MoveDir(-curPos.x, 90)
- end
- if curPos.z > 0 then
- MoveDir(curPos.z, 180)
- elseif curPos.z < 0 then
- MoveDir(-curPos.z, 0)
- end
- if curPos.y > 0 then
- while curPos.y > 0 do
- MoveDown(curPos.y)
- end
- elseif curPos.y < 0 then
- MoveUp(-curPos.y)
- end
- end
- function MoveDir(num, dir)
- end
- function Rotate(dir)
- end
- function MoveUp(num)
- end
- function MoveDown(num)
- end
- function MoveForwards(num)
- counter = 0
- while (counter < num) do
- if (curPos.rot == 0) then
- if turtle.forward() then
- curPos.z = curPos.z + 1
- end
- elseif (curPos.rot == 90) then
- if turtle.forward() then
- curPos.x = curPos.x + 1
- end
- elseif (curPos.rot == -90) then
- if turtle.forward() then
- curPos.x = curPos.x - 1
- end
- elseif (curPos.rot == 180) then
- if turtle.forward() then
- curPos.z = curPos.z - 1
- end
- end
- counter = counter + 1
- end
- end
- MoveForwards(5)
- print(curPos.x .. ", " .. curPos.y .. ", " .. curPos.z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement