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

Post your working scripts, libraries and tools
User avatar
berban
Posts: 88
Joined: 14 Apr 2014, 03:20

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

31 Mar 2019, 19:02

Hi Oblituarius, happy to help. I just tried using the directional option (e.g. "bottom") and was dismayed to find it didn't seem to be working. There's a bunch of options in here that I don't really use myself, and unfortunately sometimes when I tweak something sometimes it screws up something elsewhere. I'm guessing that's what happened here. I'll take a look and let you know once I figure it out.
gverrilla1
Posts: 6
Joined: 26 Mar 2019, 23:31

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

02 Apr 2019, 13:52

Hey guys, I don't know why this isnt working, can you please help?

Code: Select all

^!m::  ; Control+Alt+M hotkey.
Loop
{
FindClick("F:\tidle\worker.png", "n2 e o20")


Sleep, 60000
}
I'll run the script, open the target-window, and press ctrl+alt+m.
There are 6 instances of this image on my screen, but it's only finding 2 of them.
Second problem is that after finding them, the click doesnt work. I have used "dx" on options to see if it was clicking the right place, and it was. But the clicking doesnt work.
What can I do? Tried n3 aswell. And Sleep20 and Sleep50.
Dx doesn't shoot any error btw.
geniishii
Posts: 1
Joined: 04 Jun 2019, 09:08

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

04 Jun 2019, 09:17

Hi! Amazing work you've done here.

Im struggling a bit with what im trying to do. So i have a small image 22x18. Im trying to find how many times it appears ( i can expect 0-6 appearances in the screen). However the only way to see the image is to be hovering over the item's tooltip and since the mouse moves while im using the FindClick (), then it'll never detect it. Is there any way to use the function and allow the mouse to stay static while the function searches over the image?

; Moving mouse to tooltip
MouseMove, 10, 25, 0, R
;Initializing Id var
IdCount = 0
;Searching for img in tool tip
IdCount := FindClick(A_ScriptDir . "\dmgtop1.png", "Count o20")
;Results
MsgBox, %IdCount%
User avatar
berban
Posts: 88
Joined: 14 Apr 2014, 03:20

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

05 Jun 2019, 19:35

Yeah, you can use the "n" option to not click on anything. The mouse will not move either in that case.
carno
Posts: 204
Joined: 20 Jun 2014, 16:48

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

09 Jun 2019, 15:41

This script is in the top 5 of the best AHK has ever offered the community. :bravo:
godofOOF
Posts: 24
Joined: 22 Dec 2018, 06:03

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

21 Jun 2019, 15:50

This script seems to not work for me
User avatar
berban
Posts: 88
Joined: 14 Apr 2014, 03:20

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

26 Jun 2019, 21:25

Thanks for the kind words carno! :)

Could you provide me with more details, godofOOF?
arazu
Posts: 5
Joined: 05 Sep 2019, 05:12

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

05 Sep 2019, 05:21

o/

**found a fix
FindClick("img/1.png", "dx o65 r" )

r := "" targetwindow "" , r_user := "" targetwindow ""

thanks :bravo:

the findclick is great and powerful
i got a small issue with the "r" option

im trying to push r "" "" %targetwindow% "" ""

it wont let me use any % on the r title only direct name of window works.

can i bypass it?

"global targetwindow := "No window Picked" ;Window name"

"connected to edit box
Gui, Add, Edit, x100 y5 w100 h18 +0x200 vtargetwindow gsubmit_all, %targetwindow%"

"F2::
MouseGetPos,,,guideUnderCursor
WinGetTitle, Title, ahk_id %guideUnderCursor%
;Msgbox, %Title%
GuiControl,,targetwindow, %Title%
Gosub,submit_all
Return"

i want to be able to put a %% window title so user can keep pick window with simple f2


atm my target tester look like this

#Include Core/FindClick.ahk
global targetwindow := "Mirror2" ;Window name


WinGetPos, X, Y, Width, Height, %targetwindow%
X1 := X
Y1 := Y
W := Width
H := Height
X_end := (X1 + W)
Y_end := (Y1 + H)
Loop

{
;MsgBox, %targetwindow%
;FindClick()
FindClick("img/1.png", "dx o65 r" "Mirror2" )
sleep, 5000
}

F8::ExitApp

Return to “Scripts and Functions”

Who is online

Users browsing this forum: DuyMinh, TAC109 and 63 guests