Advertisement
hlprimm

Swim to Coords

Jun 26th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. $${
  2. //This is a Macro mod script for Minecraft.
  3. //Credit to Sanwi for creating the swim hover script: http://pastebin.com/aiuESR4H
  4. //Ever wanted to swim across an ocean, but dreaded having to be at your keyboard the whole time?
  5. //Wish you could AFK the trip like you can on on rails?
  6. //Then this is for you.
  7. //USAGE: Assign this to whatever button you would like. Stand on shore - preferably a block on water level.
  8. //Activate script, and input the X and Z coordinates of your destination and press enter.
  9. //You will start swimming to the provided coordinates, constantly adjusting to the correct yaw (angle) so you won't get pushed off track.
  10. //PLEASE NOTE that this only can swim in a straight line, so
  11. //if there is any land in the way, it will not jump over it or navigate around it.
  12. //As you swim, it will report your current position and distance from your destination.
  13.  
  14. //todo: multiple waypoints (so you can swim around land).
  15. //speed pot timer.
  16. //fix bug where cancelling coord input makes you dash to 0,0.
  17.  
  18. if(!swimtocoords);
  19. set(swimtocoords);
  20. #y_anchor = %YPOS%;
  21.  
  22. PROMPT(&inputcoords,"$$?","Enter target destination coordinates: x and z",true,"%&inputcoords%");
  23. replace(&inputcoords,"\"","");
  24. #endcoords[] = split(" ","%&inputcoords%");
  25. #counter = 0;
  26.  
  27. do;
  28. if(KEY_SPACE);
  29. keydown(jump);
  30. #y_anchor = %YPOS%;
  31. elseif(KEY_LSHIFT);
  32. keyup(jump);
  33. #y_anchor = %YPOS%;
  34. elseif(#y_anchor > %YPOS%);
  35. keydown(jump);
  36. else;
  37. keyup(jump);
  38. endif;
  39.  
  40. CALCYAWTO(%#endcoords[0]%,%#endcoords[1]%,#yaw,#distance);
  41. inc(#yaw,180);
  42. looks(%#yaw%,+0,.1);
  43.  
  44. keydown(forward);
  45. #counter = %#counter% + 1;
  46.  
  47. if(#counter = 300);
  48. log("Your coordinates are: %XPOS%, %ZPOS% (%YPOS%) and your destination is %#distance% away");
  49. #counter = 0;
  50. endif;
  51.  
  52. while( (XPOS != %#endcoords[0]%) || ((ZPOS != %#endcoords[1]%) );
  53.  
  54. keyup(forward);
  55.  
  56.  
  57. else;
  58. unset(swimtocoords);
  59. if(!KEY_SPACE);
  60. keyup(jump);
  61. keyup(forward);
  62. endif;
  63. stop();
  64. endif;
  65.  
  66. stop();
  67.  
  68. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement