cromulator icon

PoE BonesAndProfane V1

cromulator | PRO | 12/20/24 11:05:34 AM UTC (Edited) | 0 ⭐ | 15118 👁️ | Never ⏰ | []
Autohotkey |

3.75 KB

|

None

|

0 👍

/

0 👎

;============================================================
;Auto initialisation, non-user configurable stuff usually
;============================================================
 
#NoEnv
#SingleInstance, Force
SendMode, Input
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%
 
 
;============================================================
;configurable stuff, remember that variables need to be global if you want to set them this far from the function
;============================================================
global sWindowString:="ahk_exe PathOfExile.exe"
 
 
;============================================================
;Hotkeys
;============================================================
 
 
Numpad1:: ;your key of choice to fire this macro
{
    BonesAndProfane()
    return
}
 
 
 
 
;============================================================
;Main process or loop
;============================================================
 
BonesAndProfane()
{
 
    ;fire bones then fire the debuff
    SuperSend("f","both",1000,1200,,sWindowString) ;bones
    SuperSend("q","both",35,1200,,sWindowString) ;profane
 
/* 
    The one-line SuperSend function largely replaces the need to do a series of
    commends for key combos with ideal timing
 
    Here's is how I had previously written the above for just 2 skils;
 
    send {t down}
    rsleep(35)
    send {t up}
    rsleep(840)
    send {q down
    rsleep(50)
    send {q up}
    rsleep(1050)
*/
 
}
 
;============================================================
;Functions and classes etc
;============================================================
 
 
    SuperSend(key,direction,delay:=50,postdelay:=0,repetition:=1, winactiveString:=0)
    {
    ;A way to do more repeat sends when the application is flaky with just a single send. Don't go big on the repetitions.
            
    ;First three parameters must be enclosed in quotes ""
        
    ;The key is the key you want to send
    ;The direction should be "up" or "down" for partial keys, "both" for a regular down then up
        
    ;The following paramters are optinoal:
    ;Delay is how many ms between the up and the down, only applies to normal key presses
    ;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
    ;Reptition is how many loops, defaulting to 1
    ;winactiveString is the string to pass to ifwinactive and can be the normal paramters acceptable by that function, e.g. "ahk_exe PathOfExile.exe"
        
        
        if delay<1
            delay:=0
        
        if (direction = "both") ;do this for normal key sends
        {
            sStringDown:=(key . " down")
            sStringUp:=(key . " up")
 
            Loop, %repetition%
            {
 
                Send {%sStringDown%}
                RSleep(delay)
                Send {%sStringUp%}
 
                if postdelay>0
                    {
                        RSleep(postdelay)
                    }
            }
            
        }
        else ;do this when you just want key up or key down, such when applications aren't handle single key down reliably.
        {
            sString:=(key . " " . direction)
            
            Loop, %repetition%
            {
                ifwinactive, %winactiveString%
                {
                    Send {%sString%}
 
                    if postdelay>0
                        {
                            RSleep(postdelay)
                        }
                }
            }
        }
         
    }
 
 
    RSleep(duration,variance:=10)
    {
        min:=duration
        max:=min+variance
        random,RND,min,max
        sleep %RND%
    }

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎