Advertisement
Sanwi

Bow HUD with rangefinder

Mar 9th, 2015
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. // You need the FarHit module for the range finder to work
  2. // http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/mods-discussion/1405026-macro-keybind-mod-modules
  3. // To install a module, drag the .jar file into .minecraft/macros/modules
  4.  
  5. // You need to create a label for this to work.
  6.  
  7. // Go to Macro Mod keybind editor menu
  8. // Click the icon on the very top left corner of the screen, then "Gui Editor".
  9. // Double-click on "ingame" in the left menu. http://i.imgur.com/Cq2bL7p.png
  10. // On the bottom left, click "Button panel commands", then select "Adjust grid".
  11. // Click on the far left column in the grid, then change the grid settings to Rows: 22, Columns: 15, Column Width: 48.
  12. // This is for a 1440x900 monitor. You will need to tweak this to fit your monitor. FOV effects this greatly as well; it's calibrated for 90 FOV.
  13. // In button panel commands, select "Add label", then click 2 cells below the center cell.
  14. // Set Control Name to "archerprogress", leave label text and binding blank. Click on Foreground colour, and set the opacity to 0 (drag the slider to the bottom). Do the same for background colour.
  15. // Set text align to "top centre", and uncheck shadow.
  16. // Press OK, then click and drag the bottom of the cell to make it 3 cells high. http://i.imgur.com/qkDFLVN.png
  17.  
  18. // Bind this macro to the onjoingame event, and it will run in the background, only displaying the HUD when you have a bow selected.
  19.  
  20. do;
  21.  
  22. // Bow HUD
  23. if(%ITEM% = "bow");
  24.  
  25. // Get distance to target
  26. #dx = %FARHITX%-%XPOS%;
  27. #dy = %FARHITY%-%YPOS%;
  28. #dz = %FARHITZ%-%ZPOS%;
  29. #dsquare = (%#dx%*%#dx%)+(%#dy%*%#dy%)+(%#dz%*%#dz%);
  30. #targetdist = SQRT(%#dsquare%);
  31.  
  32. if(quickbow);
  33. if(%ITEM% = "bow");
  34. key(use);
  35. endif;
  36. endif;
  37.  
  38. // Zoom HUD
  39. if("%ALT%" = "True");
  40. setlabel(archerprogress,"");
  41. setlabel(distancetotarget,"%#targetdist%");
  42. setlabel(archersightszoom,"18 ^\n ^\n ^\n27 ^\n ^\n ^\n36 ^\n ^\n ^\n ^\n45 ^\n");
  43. // Non-zoom HUD
  44. else;
  45. setlabel(archersightszoom,"");
  46. setlabel(distancetotarget,"%#targetdist%");
  47. setlabel(archerprogress,"18 | ^ |\n27 | ^ |\n36 | ^ |");
  48. endif;
  49. else;
  50. setlabel(distancetotarget,"");
  51. setlabel(archerprogress,"");
  52. setlabel(archersightszoom,"");
  53. endif;
  54.  
  55. loop;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement