daily pastebin goal
24%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /////////////////////////////////////////////
  2. // UO Steam Get Closest Enemy Macro
  3. // for Outlands
  4. //
  5. // This macro _gets_ your closest target. Make sure to
  6. // bind script 'AttackEnemy.txt' to another key.
  7. //
  8. // Recommendation:
  9. // ===============
  10. // [MOUSEDOWN] = 'getenemy.txt'
  11. // [MOUSEUP] = 'attackenemy.txt'
  12. //
  13. // IMPORTANT
  14. // =========
  15. // Customize the filter on what you want to target.
  16. // Blue PVM = 'murderer' 'enemy' 'criminal' 'gray' 'next'
  17. // Blue PVP = 'murderer' 'enemy' 'criminal' 'gray' 'humanoid' 'next'
  18. // Red PVP = 'murderer' 'innocent' 'enemy' 'criminal' 'gray' 'humanoid' 'next'
  19. //
  20. // How to use:
  21. // ===========
  22. // 1) Save your current equipment as 'default'
  23. //    in dress macro.
  24. // 2) Figure out what filter you want
  25. // 3) Run script any time to get an enemy.
  26. //
  27. // Version History:
  28. // * 1.0 initial release
  29. // * 1.1 performance fixes, lots of notes, enemy highlight
  30. //
  31. /////////////////////////////////////////////
  32.  
  33. //
  34. // Unset your current enemy
  35. //
  36. @unsetalias 'enemy'
  37.  
  38. //
  39. // Run search loop for all targets and insert into list
  40. //
  41. @removelist 'found'
  42. @createlist 'found'
  43. for 0 to 20
  44.     @unsetalias 'enemy'
  45.     @getenemy 'murderer' 'enemy' 'criminal' 'gray' 'next'
  46.     @pushlist! 'found' 'enemy'
  47. endfor
  48.  
  49. //
  50. // Create a distances list, seeding from 1
  51. //
  52. @removelist 'distances'
  53. @createlist 'distances'
  54. pushlist 'distances' 1
  55. pushlist 'distances' 2
  56. pushlist 'distances' 3
  57. pushlist 'distances' 4
  58. pushlist 'distances' 5
  59. pushlist 'distances' 6
  60. pushlist 'distances' 7
  61. pushlist 'distances' 8
  62. pushlist 'distances' 9
  63. pushlist 'distances' 10
  64. pushlist 'distances' 11
  65. pushlist 'distances' 12
  66. pushlist 'distances' 13
  67. pushlist 'distances' 14
  68. pushlist 'distances' 15
  69.  
  70. //
  71. // Sort by distance
  72. // with closest first
  73. //  
  74. @removelist 'targets'
  75. @createlist 'targets'
  76. for 0 to 'distances'
  77.     for 0 to 'found'
  78.         if @findobject found[] 0 0 0 distances[]
  79.             @pushlist! 'targets' found[]
  80.         endif
  81.     endfor
  82. endfor
  83.  
  84. //
  85. // Set alias 'enemy' to target
  86. //
  87. if list 'targets' > 0
  88.     headmsg "*Ready*" 22
  89.     @unsetalias 'enemy'
  90.     @setalias 'enemy' targets[0]
  91.     // Leave out ampersand on this one
  92.     getenemy 'enemy'
  93. else
  94.     headmsg "No targets" 44
  95. endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top