Advertisement
cromulator

PoE GrenadeBurst V2

Dec 18th, 2024
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ;============================================================
  3. ;Auto initialisation, non-user configurable stuff usually
  4. ;============================================================
  5.  
  6. #NoEnv
  7. #SingleInstance, Force
  8. SendMode, Input
  9. SetBatchLines, -1
  10. SetWorkingDir, %A_ScriptDir%
  11.  
  12.  
  13. ;============================================================
  14. ;configurable stuff, remember that varibales need to be global if you want to set them this far from the function
  15. ;============================================================
  16. global sWindowString:="ahk_exe PathOfExile.exe"
  17.  
  18.  
  19. ;============================================================
  20. ;Hotkeys
  21. ;============================================================
  22.  
  23.  
  24. Numpad1::
  25. {
  26.     GrenadeBurst()
  27.     return
  28. }
  29.  
  30.  
  31.  
  32.  
  33. ;============================================================
  34. ;Main process or loop
  35. ;============================================================
  36.  
  37. GrenadeBurst()
  38. {
  39.  
  40.     ;Fire flash bang then fire gas grenade
  41.     SuperSend("t","both",35,840,,sWindowString)
  42.     SuperSend("q","both",35,1050,,sWindowString)
  43.  
  44. /*
  45.     The one-line SuperSend function largely replaces the need to do a series of
  46.     commends for key combos with ideal timing
  47.  
  48.     Here's is how I had previously written the above for just 2 skils;
  49.  
  50.     send {t down}
  51.     rsleep(35)
  52.     send {t up}
  53.     rsleep(840)
  54.     send {q down
  55.     rsleep(50)
  56.     send {q up}
  57.     rsleep(1050)
  58. */
  59.  
  60. }
  61.  
  62. ;============================================================
  63. ;Functions and classes etc
  64. ;============================================================
  65.  
  66.  
  67.     SuperSend(key,direction,delay:=50,postdelay:=0,repetition:=1, winactiveString:=0)
  68.     {
  69.     ;A way to do more repeat sends when the application is flaky with just a single send. Don't go big on the repetitions.
  70.            
  71.     ;First three parameters must be enclosed in quotes ""
  72.        
  73.     ;The key is the key you want to send
  74.     ;The direction should be "up" or "down" for partial keys, "both" for a regular down then up
  75.        
  76.     ;The following paramters are optinoal:
  77.     ;Delay is how many ms between the up and the down, only applies to normal key presses
  78.     ;postdelay is a delay that will occur after the key press. for "both" it occurs after the up, otherwise occurs after the part key press
  79.     ;Reptition is how many loops, defaulting to 1
  80.     ;winactiveString is the string to pass to ifwinactive and can be the normal paramters acceptable by that function, e.g. "ahk_exe PathOfExile.exe"
  81.        
  82.        
  83.         if delay<1
  84.             delay:=0
  85.        
  86.         if (direction = "both") ;do this for normal key sends
  87.         {
  88.             sStringDown:=(key . " down")
  89.             sStringUp:=(key . " up")
  90.  
  91.             Loop, %repetition%
  92.             {
  93.  
  94.                 Send {%sStringDown%}
  95.                 RSleep(delay)
  96.                 Send {%sStringUp%}
  97.  
  98.                 if postdelay>0
  99.                     {
  100.                         RSleep(postdelay)
  101.                     }
  102.             }
  103.            
  104.         }
  105.         else ;do this when you just want key up or key down, such when applications aren't handle single key down reliably.
  106.         {
  107.             sString:=(key . " " . direction)
  108.            
  109.             Loop, %repetition%
  110.             {
  111.                 ifwinactive, %winactiveString%
  112.                 {
  113.                     Send {%sString%}
  114.  
  115.                     if postdelay>0
  116.                         {
  117.                             RSleep(postdelay)
  118.                         }
  119.                 }
  120.             }
  121.         }
  122.          
  123.     }
  124.  
  125.  
  126.     RSleep(duration,variance:=10)
  127.     {
  128.         min:=duration
  129.         max:=min+variance
  130.         random,RND,min,max
  131.         sleep %RND%
  132.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement