Jump to content

username1001101

Beta Tester
  • Content Count

    365
  • Joined

  • Last visited

Posts posted by username1001101


  1. I just made another improvement however I can't test it right now. Basically I want to randomize the timeout tp time.

    NOTICE: Portal Gem is set to middle mouse button.

    ; Define below what keys represent your lower skill bar (from left to right, 5 keys)
    ; Comment out keys that don't have an aura or an aura you don't wish to use by adding a ; in front of the line
    ; Set the key with the portal gem is set to the middle button
    
    ;aHK1 = q
    aHK2 = w
    aHK3 = e
    aHK4 = r
    aHK5 = t
    
    
    ; Set the timeout values in milliseconds after which a portal will be casted automatically. The effective casting time is randomized
    portalTimeoutMin = 240000
    portalTimeoutMax = 360000
    
    
    ; Set to 'y' if you want to cast a portal and use it when a zone entrance comes into range
    zoneEntrance = y
    
    
    
    ;
    ; BELOW BE DRAGONS
    ;
    
    getCurTimeout(portalTimeoutMin, portalTimeoutMax)
    {
        global portalTimeoutMin
        Random, portalTimeout, %portalTimeoutMin%, %portalTimeoutMax%
        return %portalTimeout%
    }
    
    
    
    ; Load Direct3DWindow class
    WinActivate, ahk_class Direct3DWindow Class
    
    
    
    ; Function to check if a variable exists
    varExist(ByRef v)
    {
        ; Requires 1.0.46+
        return &v = &n ? 0 : v = "" ? 2 : 1 
    }
    
    
    
    #Persistent
    portalTimeout := getCurTimeout(portalTimeoutMin, portalTimeoutMax)
    SetTimer, castAuras, 100
    SetTimer, usePortal, %portalTimeout%
    return
    
    
    
    usePortal:
    ; Get active window title
    WinGetActiveTitle, Title
    if (Title = "Path of Exile")
    {
        Send {F12}
        Sleep 500
        MouseClick, Middle,,
        Sleep 4000
        Mousemove 400, 300
        Sleep 100
        Click
        Sleep 5000
        Send {F12}
        Sleep 10000
    }
    return
    
    
    
    
    castAuras:
    ; Get active window title
    WinGetActiveTitle, Title
    if (Title = "Path of Exile")
    {
        if varExist("aHK1") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 526, 599, 549, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK1%} ;
            }
        }
    
        if varExist("aHK2") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 556, 599, 580, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK2%} ;
            }
        }
    
        if varExist("aHK3") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 587, 599, 611, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK3%} ;
            }
        }
    
        if varExist("aHK4") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 618, 599, 641, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK4%} ;
            }
        }
    
        if varExist("aHK5") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 649, 599, 672, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK5%} ;
            }
        }
    
        if (zoneEntrance = "y")
        {
            Imagesearch,,, 650, 20, 800, 180, *50 *TransBlack portal.png
            If Errorlevel = 0
            {
                SetTimer, usePortal, Off
                Send {F12}
                Sleep 500
                MouseClick, Middle,,
                Sleep 4000
                Mousemove 400, 300
                Sleep 100
                Click
                Sleep 5000
                Send {F12}
                ; after going through the portal, make a 30 second timeout so bot can do stashing and stuff... adjust number to your desired result
                Sleep 30000
                portalTimeout := getCurTimeout(portalTimeoutMin, portalTimeoutMax)
                SetTimer, usePortal, %portalTimeout%
            }
        }
    }
    

    post-153-138501023582_thumb.png


  2. I just noticed that on skills like lightning strike the attack distance doesn't work... well, it works but if you don't keep Shift pressed then the bot will run up to the mob and then actually do its attack.

    There should be some kind of option to use Shift when mobs are in attack range.


  3. The PoE forum has this little useful AHK script posted:

    ; Path Of Exile Sync Script 1.0
    
    #IfWinActive Path of Exile
    SendMode Input
    {
    F3::
    Send {enter}
    Sleep 20
    Send {Alt} /oos {enter}
    Sleep 20
    Return
    
    F2::
    Send {enter}
    Sleep 20
    Send {Alt} /itemlevel {enter}
    Sleep 20
    Return
    
    F4:: 
    Send {enter}
    Sleep 20
    Send {Alt} /remaining {enter}
    Sleep 20
    Return
    }
    

    http://www.pathofexile.com/forum/view-t ... 5#p4280279


  4. So, I finally did make quite a few changes.

    Now you have a global timer that you can set after which the portal is cast and the toon goes through it. Be sure to make a high enough value because it's not safe to try to cast a portal inside bunch of mobs that hit on you.

    Also since you cast portals to go back to town, the auras won't be activated. So I used the previous aura script to cast auras with it. They don't need to be cast by the bot right now. It does image search on the auras. You can easily configure what auras you want to cast and on which key they lay. NOTICE: If you use Eldritch Battery or something to boost your mana (with determination aura for example) then put that on the first aura key that you want to use.

    Also, I cut down the previous portal image to a 2x2 px image that is then being looked on in the minimap. I tested it in City of Sarn and The Forest and Mud Flats and it found the entrance properly. If it finds the entrance, it'll cast a portal and transport back to town.

    So this part is useful for Zones where you start at one point and move your way accross to another one where the entrance is at the opposite end.

    In the docks for example it isn't useful and you'll be better off setting zoneEntrance to 'n'. That way it won't cast a portal when a zone entrance appears. Then just limit the run time to something you desire and let the bot explore.

    Anyway, here's the current code:

    ; Define below what keys represent your lower skill bar (from left to right, 5 keys)
    ; Comment out keys that don't have an aura or an aura you don't wish to use by adding a ; in front of the line
    ; Set the key with the portal gem is set to the middle button
    
    ;aHK1 = q
    aHK2 = w
    aHK3 = e
    aHK4 = r
    aHK5 = t
    
    
    ; Set the timeout in milliseconds after which a portal will be casted automatically
    portalTimeout = 240000
    
    
    ; Set to 'y' if you want to cast a portal and use it when a zone entrance comes into range
    zoneEntrance = y
    
    
    
    ;
    ; BELOW BE DRAGONS
    ;
    
    
    
    
    ; Load Direct3DWindow class
    WinActivate, ahk_class Direct3DWindow Class
    
    
    
    ; Function to check if a variable exists
    varExist(ByRef v)
    {
        ; Requires 1.0.46+
        return &v = &n ? 0 : v = "" ? 2 : 1 
    }
    
    
    
    #Persistent
    SetTimer, castAuras, 100
    SetTimer, usePortal, %portalTimeout%
    return
    
    
    
    usePortal:
    ; Get active window title
    WinGetActiveTitle, Title
    if (Title = "Path of Exile")
    {
        Send {F12}
        Sleep 500
        MouseClick, Middle,,
        Sleep 4000
        Mousemove 400, 300
        Sleep 100
        Click
        Sleep 5000
        Send {F12}
        Sleep 10000
    }
    return
    
    
    
    
    castAuras:
    ; Get active window title
    WinGetActiveTitle, Title
    if (Title = "Path of Exile")
    {
        if varExist("aHK1") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 526, 599, 549, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK1%} ;
            }
        }
    
        if varExist("aHK2") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 556, 599, 580, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK2%} ;
            }
        }
    
        if varExist("aHK3") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 587, 599, 611, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK3%} ;
            }
        }
    
        if varExist("aHK4") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 618, 599, 641, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK4%} ;
            }
        }
    
        if varExist("aHK5") = 1
        {
            CoordMode, Pixel, Relative
            PixelSearch, FoundX, FoundY, 649, 599, 672, 622, 0xffffff, 0, Fast RGB
            if ErrorLevel = 0
            {
                Send {%aHK5%} ;
            }
        }
    
        if (zoneEntrance = "y")
        {
            Imagesearch,,, 650, 20, 800, 180, *50 *TransBlack portal.png
            If Errorlevel = 0
            {
                SetTimer, usePortal, Off
                Send {F12}
                Sleep 500
                MouseClick, Middle,,
                Sleep 4000
                Mousemove 400, 300
                Sleep 100
                Click
                Sleep 5000
                Send {F12}
                ; after going through the portal, make a 30 second timeout so bot can do stashing and stuff... adjust number to your desired result
                Sleep 30000
                SetTimer, usePortal, %portalTimeout%
            }
        }
    }
    return
    

    Don't forget to download the attached portal.png image and put it into the same folder as your ahk script.

    post-153-138501023574_thumb.png

×
×
  • Create New...