I am semi expirienced with ahk. I have done some simple scripts but now I am heading some more complicated problem and i couldnt find a good solution.
I want to make a script wchich will be loooking for images in certain area and then move items to desire destination. Problem is with looping.
After first loop if script found image all seems to be fine, but in next loop script is start from all again and that's consume a lot of time and CPU.
Could you guys look at my code below and give me some tips how can I improve performance of my script?
Also is it possible to not see my moving cursor at screen during script is working?
Thank you guys in advance!
Code: Select all
insert::
SetBatchLines, -1
MouseGetPos, x1, y1
Loop 40
{
ImageSearch, pX, pY, 1570, 300, 1745, 815, *2, C:\Users\Sylwek\Desktop\loot_mary\item%a_index%.png
if ErrorLevel = 0
{
SetDefaultMouseSpeed, 0
MouseClickDrag, Left, %pX%, %pY%, %InvX%, %Invy%
sleep, 250
}
}
MouseMove, %x1%, %y1%
return