Advertisement
lachiu

test

Jan 15th, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. local xChest = -135
  2. local yChest = 85
  3. local zChest = 74
  4.  
  5. -- N
  6. -- z
  7.  
  8. -- Wx xE
  9.  
  10. -- z
  11. -- S
  12.  
  13. -- chest pos: x: -135 y: 85 z: 74
  14. -- OldPos x: -143 y: 87 z: 81
  15. -- NewPos x: -143 y: 87 z: 82
  16.  
  17. local xOld, yOld, zOld = gps.locate(5)
  18. print("x: " .. xOld .. " y: " .. yOld .. " z: " .. zOld)
  19. turtle.forward()
  20. local xNew, yNew, zNew = gps.locate(5)
  21. print("x: " .. xNew .. " y: " .. yNew .. " z: " .. zNew)
  22. turtle.back()
  23.  
  24. -- X-axis
  25. print(xChest - xOld)
  26. if (xChest - xOld) > 0 then
  27. for i = 1,(xChest - xOld), 1 do
  28. turtle.back()
  29. end
  30. end
  31.  
  32. if (xChest - xOld) < 0 then
  33. for i = 1,((xChest - xOld)*(-1)), 1 do
  34. turtle.forward()
  35. end
  36. end
  37.  
  38. --> 0 forward
  39. --< 0 backwards
  40. -- 0 nothing
  41. -- Y-axis
  42. print(yChest - yOld)
  43. if (yChest - yOld) > 0 then
  44. for i = 1,(yChest-yOld), 1 do
  45. turtle.up()
  46. end
  47. end
  48.  
  49. if (yChest - yOld) < 0 then
  50. for i = 1,((yChest-yOld)*(-1)), 1 do
  51. turtle.down()
  52. end
  53. end
  54.  
  55. -- > 0 up
  56. -- < 0 down
  57. -- 0 nothing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement