Imagesearch Problems

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
japankid3000
Posts: 43
Joined: 14 Nov 2015, 09:58

Imagesearch Problems

19 Jan 2016, 12:00

My problem is i am trying to un follow people on a list, sometimes ImageSearch will click the images correctly, but then it will skip and not click the same image it clicked before ( the image is same coordinates and same pixels but somehow it will continue and sometimes randomly click the same image over and over until the script returns the loop.)

I am using snipping tool to capture .png of image, i can't use PixelSearch because all of the buttons i need to click have the same color font and no distinctive color.

With ErrorLevel = 0 there is no in between, how can i make it have a confidence level, something like.......
IF ConfidenceLvl=90
Click,
Else Continue

Please help me make my script better.

Code: Select all

f1::
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
 
Loop
{

	Sleep, 500
	ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, C:\Scripting\exampleimage.PNG
 
	If (ErrorLevel = 0)
	{
	        FoundX := FoundX + 10
		FoundY := FoundY + 20
		Click, %FoundX%, %FoundY%
		Sleep, 500
	}
 
}
return
z::pause
vasili111
Posts: 747
Joined: 21 Jan 2014, 02:04
Location: Georgia

Re: Imagesearch Problems

19 Jan 2016, 13:01

I think script is missing sometimes clicks because maybe the image in fact is changed. For example, mouseover by cursor, or in some cases it can get border after it was mouseover but is not now, or it was clicked before and because of that changed slightly changed color or got border. Imagesearch is searching exact image not image like. So sometimes you need to use several Imagesearch commands with different images to click same button.
DRAKON-AutoHotkey: Visual programming for AutoHotkey.
japankid3000
Posts: 43
Joined: 14 Nov 2015, 09:58

Re: Imagesearch Problems

21 Jan 2016, 12:58

Oh i never thought about using several different images to get the click but i am trying to learn use Pixels now.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], moltenchees and 164 guests