Page 7 of 7

Re: FindClick() - ImageSearch, Clicking, & More [Newest Version]

Posted: 06 Jan 2020, 15:00
by Oblituarius
Hi @berban It's me again.

I gave up on "db" since it never worked. I tried using the example on P.19 and I always get a blank result or "(,0). Is there a way to use that example or a variation of it to extract %Results% into an Array that I can order up? I know that if I get it to work, I could store %Coords1% and %Coords2% into some variables and then put them into an Array.
That would also work in my case.

Still testing some stuff, it's been a while since I worked on my script. I will probably have to go through FindClick.ahk to see how it is working too.


Edit1: So I managed to get every single instance coord with this code . Probably too much sh*t and it shouldn't be done like this. It's super messy, but it gets the job done:

Code: Select all

	FindClick("Image", "e n Sleep500 oTransBlack,1 a408,680,-443,-329")
	Sort, Results, N R
	Coords := StrSplit(Results, "`n", "`")
	Loop % (Coords.MaxIndex()-1)
		X1_Table_Array[TA1] := Coords[A_Index]
		if (X1_Table_Array[TA1] = X1_Table_Array[TA1-1])
			Tooltip, Sum %TA2%, 1578, 523, 2
		Sleep 800
		Temp1 := X1_Table_Array[TA1]
		Temp2 := X1_Table_Array[TA1]
		StartingPos := InStr(Temp1, ",")
		string1 := SubStr(Temp1, 1, 4)
		StartingPos := InStr(Temp2, ",")
		string2 := SubStr(Temp2, StartingPos + 1)
		Tooltip, %TA3%, %string1%, %string2%, %TA3%
		Click1 := Format("{:i}", string1)
		Click2 := Format("{:i}", string2)
		MouseGetPos, X, Y
		Random, I, 0, 1 ;Random ellipse invert.
		MouseMove_Ellipse(X, Y, Click1+40, Click2+60, 1, 0, I)
Now, for some reason, I have to leave in oTransBlack,1 or it goes bunkers xd.

This took me solid 8+hrs of research to put together. Kill me.

Re: FindClick() - ImageSearch, Clicking, & More [Newest Version]

Posted: 17 Mar 2020, 21:50
by symaw
Does the options "Width and height to which to scale the image" works with "o – ImageSearch Options"?
I can't get it to work:
FindClick("image.jpg", "n oTransBlack,10 ow,44 oh,-1")

It will find the image.jpg at the original size, but not the scaled size.

o – ImageSearch Options
What to give comma-delimited string of imagesearch options
Description The optional parameters for ImageSearch, as shown in the AutoHotkey documentation. Use a comma to separate options instead of a space. You may omit the asterisk (*). For example: oTransBlack,20 makes black transparent and allows 20 shades of variation.

From the AutoHotkey documentation:
Options: Zero or more of the following strings may be also be present immediately before the name of the file. Separate each option from the next with a single space or tab. For example: *2 *w100 *h-1 C:\Main Logo.bmp.
*wn and *hn: Width and height to which to scale the image (this width and height also determines which icon to load from a multi-icon .ICO file). If both these options are omitted, icons loaded from ICO, DLL, or EXE files are scaled to the system's default small-icon size, which is usually 16 by 16 (you can force the actual/internal size to be used by specifying *w0 *h0). Images that are not icons are loaded at their actual size. To shrink or enlarge the image while preserving its aspect ratio, specify -1 for one of the dimensions and a positive number for the other. For example, specifying *w200 *h-1 would make the image 200 pixels wide and cause its height to be set automatically.

Thank you for reply