Jump to content

ImageSearch tolerance do not work


Recommended Posts

Hello.

I had made a bot that clicks and doing stuff. It is working fine, but when i move it to another PC ImageSearch stop working. I captured same image of a button again and i observed that they are a little bit different. How to deal with this? I wonder if i will make black and white detection might work, or not ... i don't know. The point is i am not willing to re-do photos on each and every PC i move the scripts.
 

ClickOnImageWithToleranceFast("images/fb_about.bmp",16)

Func ClickOnImageWithToleranceFast($image_path,$tolerance)
   If SearchForImageOnScreenWithTolerance($image_path,$tolerance) Then
      If $x <> 0 And $y <> 0 Then
         MouseMove($x+5, $y+5,0)
         Sleep(500)

         MouseClick("left")
         Sleep(500)
      EndIf
   EndIf
EndFunc

 

Link : https://postimg.org/gallery/z6n168ps/585debf1/#

Also i have attached them.

Thank you

fb_about.bmp

fb_about2.bmp

Link to comment
Share on other sites

1 minute ago, rootx said:

Perhaps because it changes the screen resolution and DPI Zoom, before launching the function, first try to capture the actual screen resolution.

Don't quite understand, you say that might be a problem with the fact that i use different resolution? And i am at 100% zoom on browser, i never changed that.

Link to comment
Share on other sites

try to verify browser zoom, and monitor resolution and DPI zoom, because... 4example if you run a 3840x2160 resolution on a 15 inch laptop.... windows suggest you to change the DPI Zoom to 250%... etc.... Result?? your script doesnt work well.

Link to comment
Share on other sites

30 minutes ago, rootx said:

try to verify browser zoom, and monitor resolution and DPI zoom, because... 4example if you run a 3840x2160 resolution on a 15 inch laptop.... windows suggest you to change the DPI Zoom to 250%... etc.... Result?? your script doesnt work well.

So you say that every time i try do ImageSearch, the images must have high DPI so therefore capture that button when i am very zoomed (250%). This is what you say? We have to be aware that the img will not be 20x50 ... will be +150% bigger, i don't know for sure if it will work

2 minutes ago, Bert said:

Question -why do you have to use pixelsearch to click on a button? Why can't you just hook into the button control?

Whats the name of the app? odds are there is a script that is already made that will do the work for you and be MUCH more stable.

I use pixelsearch because i believe it is faster to capture and click. I use FF.au3 lib, wich is very good http://english.documentation.ff-au3.thorsten-willert.de/

I am trying to add friends on FB, but i need it from scratch made, i am using a DB behind. I also use xpath from FF.au3, but somethimes don't work, and i relay on ImageSearch.dll

Link to comment
Share on other sites

  • 1 month later...
On 1/23/2017 at 9:01 PM, masterland said:

Hello.

I had made a bot that clicks and doing stuff. It is working fine, but when i move it to another PC ImageSearch stop working. I captured same image of a button again and i observed that they are a little bit different. How to deal with this? I wonder if i will make black and white detection might work, or not ... i don't know. The point is i am not willing to re-do photos on each and every PC i move the scripts.
 

ClickOnImageWithToleranceFast("images/fb_about.bmp",16)

Func ClickOnImageWithToleranceFast($image_path,$tolerance)
   If SearchForImageOnScreenWithTolerance($image_path,$tolerance) Then
      If $x <> 0 And $y <> 0 Then
         MouseMove($x+5, $y+5,0)
         Sleep(500)

         MouseClick("left")
         Sleep(500)
      EndIf
   EndIf
EndFunc

 

Link : https://postimg.org/gallery/z6n168ps/585debf1/#

Also i have attached them.

Thank you

fb_about.bmp

fb_about2.bmp

Hi,

I have seen ur images. the images which i captured are of almost similar size. But my script is not able to find such small images. please help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...