Comma after word "Tooltip" does nothing according to coding tests + docs. However after word "image" and "found" it did messed it up.
Regarding second tooltip,i was told by someone back in early 2019 at ahk discord that the AHK reads it top to down and braces are not necessary after errorlevels.
Need to remove my rustiness in ahk coding since i made literally coding equivalent of "spelling mistakes".
Sorry if it angered you when it meant to help.
ImageSearch Tips & Tricks
Re: ImageSearch Tips & Tricks
I don’t know why you think I’m angry. I was trying to help by pointing out the things that will make it work the way you intended. Sorry if that’s how you took it.
I wasn’t talking about the comma after the word ToolTip. Commas after command names are always optional. I’m saying that within a parameter, you can’t have a non-escaped comma or else it will think you’re starting a new parameter, which you found to be true.
Unfortunately, it sounds like you got some incorrect advice about braces after an ErrorLevel. I thought you would prefer to hear the correct advice. That’s how the rust gets knocked off. People on the forum help each other by showing them the correct or better ways to do things. I still learn things from the forum every day. I’ll make a note that you prefer not to get feedback on your code. Sorry for the trouble.
I wasn’t talking about the comma after the word ToolTip. Commas after command names are always optional. I’m saying that within a parameter, you can’t have a non-escaped comma or else it will think you’re starting a new parameter, which you found to be true.
Unfortunately, it sounds like you got some incorrect advice about braces after an ErrorLevel. I thought you would prefer to hear the correct advice. That’s how the rust gets knocked off. People on the forum help each other by showing them the correct or better ways to do things. I still learn things from the forum every day. I’ll make a note that you prefer not to get feedback on your code. Sorry for the trouble.
Re: ImageSearch Tips & Tricks
Thank you,it's great to learn new things,i'll test your idea and it's performance for my future projects.
Re: ImageSearch Tips & Tricks
I'm struggling with ImageSearch. In a nutshell, what I'm trying to do is see if a text search in chrome browser produces 0 results or not. For example, if I search for the string +delete, I have this on the screen:
Now using Window spy, I've determined (I believe correctly) that on my screen, the text 0/0 should be found somewhere between 1285,105:
and 1336,134...
The image I'm using is a screen capture of the section with the 0/0 text. I've tried searching the entire screen but it doesn't find anything. What am I doing wrong, or is this not something I can do with imagesearch?
My code looks like this:
Now using Window spy, I've determined (I believe correctly) that on my screen, the text 0/0 should be found somewhere between 1285,105:
and 1336,134...
The image I'm using is a screen capture of the section with the 0/0 text. I've tried searching the entire screen but it doesn't find anything. What am I doing wrong, or is this not something I can do with imagesearch?
My code looks like this:
Code: Select all
Run, https://www.google.com
Sleep 4000
Send ^f
Sleep 100
Send {+}delete
Sleep 5000
Imagesearch, FoundX , FoundY , 1285, 105, 1336, 134, e:\users\myuser\pictures\0.jpg
if (ErrorLevel = 2)
MsgBox Could not conduct the search.
else if (ErrorLevel = 1)
MsgBox The image was not found
else
MsgBox The image was found!
Re: ImageSearch Tips & Tricks
For reference (I couldn't attach a fourth image to my previous post), this is the image I'm looking for:
Re: ImageSearch Tips & Tricks
dont use lossy formats to search with(ur jpg needle image is artifacting due to compression, so it no longer matches whats actually on screen)
Re: ImageSearch Tips & Tricks
Hoping smaller image files would improve search time, I changed the search image bit-depth from 32bit to 8bit. Reliability signficantly improved when I recaptured and saved the image as 32bit!
Re: ImageSearch Tips & Tricks
Is it normal for shade-variation to have to use values around 80? I took an exact screenshot and saved it as a PNG. How can there be so much variation...?
Oh that's weird -- now it's working with really low values. Okay.
Oh that's weird -- now it's working with really low values. Okay.
-
- Posts: 176
- Joined: 12 Nov 2022, 15:47
Re: ImageSearch Tips & Tricks
It was the best of times, it was the worst of times...
Return to “Tips and Tricks (v1)”
Who is online
Users browsing this forum: No registered users and 24 guests