Jump to content

Join our Slack

Talk to other users and have a great time
Slack Server

Welcome to our Community

Click here to get your Exiled Bot license
Donation Store
AlexOwnzAll

Simple fixed location scour+chance script

Recommended Posts

So I am trying to make a very simple fixed location scour+chancing script and I cannot get it to work inside the Path of Exile window. I have looked through the examples of "WinActivate" and other related commands but cannot get any of them to work. I also find it interesting and confusing how ONE 1 example of the winactive or any related command provided in the https://autohotkey.com/docs/commands/WinActivate.htm seems to work. For example, running the provided example of 

IfWinExist, Untitled - Notepad

     WinActivate

else

     WinActivate, Calculator

returns the following error "Error: "else" statement with no corresponding "if" statement

Like either something is very very wrong with my installation or the examples in the documentation/tutorials of the functions is wrong (and if that's true, I have no clue how to learn to use AHK since that's the pt of example uses of commands-to teach how to use them"

 

Anyway though, my current total attempt at the script is this:

GroupAdd, PoEexe, ahk_exe PathOfExile.exe
GroupAdd, PoEexe, ahk_exe PathOfExileSteam.exe
GroupAdd, PoEexe, ahk_exe PathOfExile_x64.exe
GroupAdd, PoEexe, ahk_exe PathOfExile_x64Steam.exe

$i = 0

IfWinActive Path of Exile ahk_class POEWindowClass ahk_group PoEexe
    Do
        MouseClick("right",1144,705.1)
        Sleep(250)
        MouseClick("left",1211,652.1)
        Sleep(500)

        MouseClick("right",1201,704.1)
        Sleep(250)
        MouseClick("left",1201,653,1)
        Sleep(500)
        $i += 1
    Until $i = 1

 

The Do to Until part works anywhere else but inside a particular window. The groupadd stuff was one way I saw someone else supposedly fix the whole "script doesnt work inside poe so do this" problem but the script currently returns the error of "groupadd=unknown function name"

Share this post


Link to post
Share on other sites

I've tried similar with varios mouse recorders and even manually creating the script myself, POE REALLY doesn't want you using scripts to scoure/chance items about a year ago I was able to get a recorder working but a patch broke it and i've yet to get one working since.

Share this post


Link to post
Share on other sites

let me show u my approach, didnt use it for quite some time but it should still work.

its made for 800x600 resolution and it needs images of the item u want to chance (belt.png) and the 2 orbs.

maybe u can use it or get inspiration for your own script:

CoordMode, Pixel, Client
Coordmode, Mouse, Client
Gui, Add, Button, x5 y5 w40, Do it!
Gui, Add, text, x50 y10 w40, try: 
Gui, Add, text, vtrys x65 y10 w30, 0
Gui, Add, Button, x5 y28 w90, Exit
Gui, -MinimizeBox -MaximizeBox
Gui, Show,, Card
return
^j:: pause
GuiClose:
buttonexit:
ExitApp
Buttondoit!:
sleep 1000
winactivate, Path of Exile
sleep, 500
Loop, 
{
    
    
    ImageSearch, beltX, beltY, 430, 320, 804, 480, *60 belt.png
if ErrorLevel = 1
{
    goto, itsdone
}
ImageSearch, chanceX, chanceY, 430, 320, 804, 480, *60 chance.png
if ErrorLevel = 1
{
    goto, itsdone
}
sleep 100
MouseClick, right, %chanceX%, %chanceY%
sleep 300
MouseClick, left, %beltX%, %beltY%
sleep 300
try++
GuiControl,, trys , %try%

ImageSearch, scourX, scourY, 430, 320, 804, 480, *100 scour.png
if ErrorLevel = 1
{
    goto, itsdone
}
sleep 100
MouseClick, right, %scourX%, %scourY%
sleep 300
MouseClick, left, %beltX%, %beltY%
sleep 300
}
itsdone:
return

Share this post


Link to post
Share on other sites

Yeah, yours doesn't work either. Copying your code gives the error "cannot parse at line 3 Gui, Add, Button, x5 y5 w40, Do it!". That is the main cause of all my problems I think. I believe the formatting was recently changed in auto hotkey and many of the example scripts and or user submitted scripts use old formatting that is no longer supported. Either that, or I didn't download something that people have. I think I need help from someone that very recently made scripts using auto hot key as they would know how to format the functions/commands.

 

In regards to the 2nd comment, making the script is very simple imo. I just want the most basic static position click the stack of 30 orbs then click on next fixed location stack till done. My only issue is getting the pathofexile window to be activated and having the mouse clicks register inside the game (which i cant believe is this complicated since I should just have to tell the computer "click the mouse here"  regardless what window is active, but it seems more complicated than that)

 

 

Edited by AlexOwnzAll
elaboration

Share this post


Link to post
Share on other sites

Agreed making a script is easy, heck i just took another swing at a scoure/chance script but im running into the same issue I was before

the First orb right click registers, The First left click of the item(with the orb selected) registers, after that 99% of the time its going to failed to click onto the second orb(be it scour or chance)

Share this post


Link to post
Share on other sites

dynasto your script is working for me when i manually move the mouse, i mean it clicks for me, but id like to know if its possible to automate it totally so that the script moves the mouse?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×