[AHK] Simple script for expedition: Gwennen - buy highlighted items+reroll with hotkey menu

User Tag List

Results 1 to 8 of 8
  1. #1
    letalko's Avatar Member
    Reputation
    4
    Join Date
    Jan 2012
    Posts
    9
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [AHK] Simple script for expedition: Gwennen - buy highlighted items+reroll with hotkey

    This is a small AHK script with quick setup. He buys everything highlighted in the window and then rerolls. Maybe it will be useful for someone

    ...

    ...

    Download at the bottom or make a new folder and a new ahk script inside with the following code:

    Code:
    #IfWinActive  Path of Exile
    
        #NoEnv 
    
        #SingleInstance  , Force
    
        SetWorkingDir %A_ScriptDir%
        SendMode, Input
        ConfigINI=%A_scriptdir%\Config.ini
        ifnotexist,%ConfigINI%
        {
            IniWrite, 0	, %ConfigINI%, RerollPos, RerollPosX
            IniWrite, 0 , %ConfigINI%, RerollPos, RerollPosY
            IniWrite, 0	, %ConfigINI%, WindowGambleSearchGwennen, xLeft
            IniWrite, 0	,	%ConfigINI%, WindowGambleSearchGwennen, yLeft
            IniWrite, 0	,	%ConfigINI%, WindowGambleSearchGwennen, xRight
            IniWrite, 0	,	%ConfigINI%, WindowGambleSearchGwennen, yRight
        }
    
        SetMouseDelay, 45 ; ~latency
        Global ReGixSearchedDelay := 200 ; ReGix search delay in game. This is a personal delay, it depends on ping and computer power
        Global statusRoll := true
        Global pixelColor := 0xE7B477
    
        +F10::
            MouseGetPos x, y
            IniWrite,%x%	,	%ConfigINI%, RerollPos, RerollPosX
            IniWrite,%y%	,	%ConfigINI%, RerollPos, RerollPosY
        return
    
        $F1::
            if !GetKeyState("capslock","T")
            {
                SendInput, {F1}
            }
            else {
                StartRoll()
            }
        return
    
        +F9::
            GetRange(x,y,w,h)
            xr := x+w
            yr := y+h
            IniWrite,%x%, %ConfigINI%, WindowGambleSearchGwennen, xRight
            IniWrite,%y%, %ConfigINI%, WindowGambleSearchGwennen, yRight
            IniWrite,%xr%, %ConfigINI%, WindowGambleSearchGwennen, xRight
            IniWrite,%yr%, %ConfigINI%, WindowGambleSearchGwennen, yRight
        return
    
        SearchItemAndClick(){
            Global lastPositionFindX =
            Global lastPositionFindY =
            while(GetKeyState("F1","p") && statusRoll){
                IniRead, _xLeft,Config.ini, WindowGambleSearchGwennen, xLeft
                IniRead, _yLeft,Config.ini, WindowGambleSearchGwennen, yLeft
                IniRead, _xRight,Config.ini, WindowGambleSearchGwennen, xRight
                IniRead, _yRight,Config.ini, WindowGambleSearchGwennen, yRight
                PixelSearch , Px, Py, _xLeft, _yLeft , _xRight, _yRight, pixelColor,3, Fast RGB
                if (ErrorLevel) {
                    Break
                }
                else if (lastPositionFindX == Px && lastPositionFindY == Py){
                    Global statusRoll := false
                    Break
                }
                else{
                    Global lastPositionFindX := Px
                    Global lastPositionFindY := Py
                    SendInput, {Control down}
                    Sleep, 5
                    BlockInput, MouseMove
                    MouseClick, left, Px+=30, Py+=30
                    SendInput, {Control up}
                    BlockInput, MouseMoveOff
                }
            }
        }
    
        StartRoll(){
            Global statusRoll := true
            SearchItemAndClick()
            while(GetKeyState("F1","p") && statusRoll) {
                BlockInput, MouseMove
                IniRead, _RerollPosX, Config.ini, RerollPos, RerollPosX
                IniRead, _RerollPosY, Config.ini, RerollPos, RerollPosY
                MouseClick, Left, _RerollPosX, _RerollPosY
                Sleep ReGixSearchedDelay
                BlockInput, MouseMoveOff
                SearchItemAndClick()
    
            }
    
        }
    
        GetRange(ByRef x="",ByRef y="",ByRef w="",ByRef h="")
        {
            ; Save the initial state and set the current state
            cmm:=A_CoordModeMouse
            CoordMode, Mouse, Screen
    
            ; Create canvas GUI
            nW:=A_ScreenWidth, nH:=A_ScreenHeight
            Gui, Canvas:New, +AlWaysOnTop +ToolWindow -Caption
            Gui, Canvas:Add, Picture, x0 y0 w%nW% h%nH% +0xE HwndPicID
    
            ; Create selection range GUI
            Gui, Range:New, +LastFound +AlWaysOnTop -Caption +Border
                +OwnerCanvas +HwndRangeID
            WinSet, Transparent, 100
            Gui, Range:Color, Yellow
    
            ; Screenshots to the memory image and sent to
            ; the picture control of the canvas window.
            Ptr:=A_PtrSize ? "UPtr":"UInt", int:="int"
            hDC:=DllCall("GetDC", Ptr,0, Ptr)
            mDC:=DllCall("CreateCompatibleDC", Ptr,hDC, Ptr)
            hBM:=DllCall("CreateCompatibleBitmap", Ptr,hDC, int,nW, int,nH, Ptr)
            oBM:=DllCall("SelectObject", Ptr,mDC, Ptr,hBM, Ptr)
            DllCall("BitBlt", Ptr,mDC, int,0, int,0, int,nW, int,nH
                , Ptr,hDC, int,0, int,0, int,0x00CC0020|0x40000000)
            DllCall("ReleaseDC", Ptr,0, Ptr,hDC)
            ;---------------------
            SendMessage, 0x172, 0, hBM,, ahk_id %PicID%
            if ( E:=ErrorLevel )
                DllCall("DeleteObject", Ptr,E)
            ;---------------------
            DllCall("SelectObject", Ptr,mDC, Ptr,oBM)
            DllCall("DeleteDC", Ptr,mDC)
    
            ; Display the canvas window and start to wait for the selection range
            Gui, Canvas:Show, NA x0 y0 w%nW% h%nH%
    
            ; Prompt to hold down the LButton key
            ListLines, Off
            oldx:=oldy:=""
            Loop {
                Sleep, 100
                MouseGetPos, x, y
                if (oldx=x and oldy=y)
                    Continue
                oldx:=x, oldy:=y
                ;--------------------
                ToolTip, Please hold down LButton key to select a range
            }
            Until GetkeyState("LButton","P")
    
            ; Prompt to release the LButton key
            x1:=x, y1:=y, oldx:=oldy:=""
            Loop {
                Sleep, 100
                MouseGetPos, x, y
                if (oldx=x and oldy=y)
                    Continue
                oldx:=x, oldy:=y
                ;--------------------
                w:=Abs(x1-x), h:=Abs(y1-y)
                x:=(x1+x-w)//2, y:=(y1+y-h)//2
                Gui, Range:Show, NA x%x% y%y% w%w% h%h%
                ToolTip, Please drag the mouse and release the LButton key
            }
            Until !GetkeyState("LButton","P")
    
            ; Prompt to click the RButton key to determine the range
            oldx:=oldy:=""
            Loop {
                Sleep, 100
                MouseGetPos, x, y, id
                if (id=RangeID) and GetkeyState("LButton","P")
                {
                    WinGetPos, x1, y1,,, ahk_id %RangeID%
                    Loop {
                        Sleep, 100
                        MouseGetPos, x2, y2
                        Gui, Range:Show, % "NA x" x1+x2-x " y" y1+y2-y
                    }
                    Until !GetkeyState("LButton","P")
                }
                if (oldx=x and oldy=y)
                    Continue
                oldx:=x, oldy:=y
                ;--------------------
                ToolTip, Please click the RButton key to determine the scope`,`n
                    and use the LButton key can adjust the scope
            }
            Until GetkeyState("RButton","P")
            KeyWait, RButton
            ToolTip
            ListLines, On
    
            ; Clean the canvas and selection range GUI
            WinGetPos, x, y, w, h, ahk_id %RangeID%
            Gui, Range:Destroy
            Gui, Canvas:Destroy
    
            ; Clean the memory image and restore the initial state
            DllCall("DeleteObject", Ptr,hBM)
            CoordMode, Mouse, %cmm%
        }
    How use:

    1. Open gamble window gwennen and write the mouse on the reroll button and click Shift+F10
    2. Open gamble window gwennen and click Shift+F9. Follow the instructions near the cursor for and select area the window gamble

    3. Hold F1 start script only if active capslock


    You only need to set the settings once, they are saved next to the script file


    If you have a large number of skips, then increase these values

    Code:
        
    SetMouseDelay, 45 ; ~latency
    Global ReGixSearchedDelay := 200 ; ReGix search delay in game. This is a personal delay, it depends on ping and computer power

    Archive: RerollGwennen.zip
    Last edited by letalko; 02-27-2023 at 06:42 PM.

    [AHK] Simple script for expedition: Gwennen - buy highlighted items+reroll with hotkey
  2. Thanks camapxam, xerance (2 members gave Thanks to letalko for this useful post)
  3. #2
    Conservative's Avatar Member Curb Creature CoreCoins Purchaser
    Reputation
    1
    Join Date
    Aug 2018
    Posts
    9
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mouse cursor just hovers above Gwennens face. I've set the re-roll button and the window as well.

  4. #3
    letalko's Avatar Member
    Reputation
    4
    Join Date
    Jan 2012
    Posts
    9
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Conservative View Post
    Mouse cursor just hovers above Gwennens face. I've set the re-roll button and the window as well.
    perhaps you have set too large a search window that goes beyond the window where things are located? if it hangs in the left corner, then you have not assigned the position of the reroll button.
    Last edited by letalko; 02-27-2023 at 03:41 AM.

  5. #4
    husshuss's Avatar Member
    Reputation
    1
    Join Date
    May 2022
    Posts
    3
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works pretty well. thanks!

  6. #5
    camapxam's Avatar Active Member
    Reputation
    23
    Join Date
    Nov 2009
    Posts
    274
    Thanks G/R
    196/20
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    it works very nice, i've always wanted to make something like this, but i guess coding is not for anyone.

  7. #6
    tsunatsu5's Avatar Member
    Reputation
    5
    Join Date
    Aug 2017
    Posts
    38
    Thanks G/R
    10/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good work. May I ask can you do the same thing for Tujen too ? It'd be nice. I can copy and paste which currency do I wanna buy. Thanks
    Last edited by Sychotix; 03-05-2023 at 09:23 PM. Reason: Removed unnecessary quote

  8. #7
    recoil51's Avatar Member
    Reputation
    1
    Join Date
    Dec 2023
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it can reroll but it does not actually buy the item it just hovers over it

  9. #8
    letalko's Avatar Member
    Reputation
    4
    Join Date
    Jan 2012
    Posts
    9
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by recoil51 View Post
    it can reroll but it does not actually buy the item it just hovers over it
    I don't think it's necessary to use it at all now, there are alternatives. You should also not use those that teleport the mouse, it is almost 100% ban if you use it constantly

Similar Threads

  1. [Release] [AHK] Simple script for expedition: Tujen Haggle - quick buy/reroll with hotkey
    By xerance in forum PoE Bots and Programs
    Replies: 77
    Last Post: 09-16-2023, 07:16 AM
  2. Replies: 28
    Last Post: 08-29-2023, 07:18 AM
  3. Created simple script for pindle farming, no autoloot though
    By shnwj in forum Diablo 2 Resurrected Bots and Programs
    Replies: 1
    Last Post: 10-06-2021, 10:47 PM
  4. [Bot] WTB AHK custom Script for Elite dangerous! [Serious Only]
    By BAKERKUSH in forum MMO Exploits|Hacks
    Replies: 0
    Last Post: 08-17-2018, 10:39 AM
  5. Need a realllllly simple script for AUTO IT!
    By unfunkable in forum Diablo 3 Bots Questions & Requests
    Replies: 3
    Last Post: 06-06-2012, 07:35 AM
All times are GMT -5. The time now is 11:01 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search