Sedoc94 Posted July 21, 2011 Posted July 21, 2011 Hello,So I am new to AutoIt and just practising and so far I like it very much and pretty easy to do.I have this for the normal pic: Do $result = _ImageSearch("example.png", 1, $x, $y, 10) If $result = 1 Then MsgBox(0, "", "IMAGE FOUND") EndIf Until $result == 1This works fine..And I have this for the pic with some color added on it which should be seen as transparent by the ImageSearch function: The color on there which should be seen as transparent is 0xF700FFso I did:Do $result = _ImageSearch("example2.png", 1, $x, $y, 10, 0xF700FF) If $result = 1 Then MsgBox(0, "", "IMAGE FOUND") EndIf Until $result == 1But for this one it somehow doesnt find the image while the image is showing on the screen :[Have I done something wrong?Thank you very much for your help!
blackmage999 Posted July 24, 2011 Posted July 24, 2011 you are using the last parameter wrong. its supposed to be a number from 0 - 255 and used when the color of the image your looking for would vary in shades. using the images on this browser, i used this code and got the correct results #include <ImageSearch.au3> $x1=0 $y1=0 WinActivate("Image Search Library - AutoIt Forums - Google Chrome", "") WinWaitActive("Image Search Library - AutoIt Forums - Google Chrome", "") $result = _ImageSearch(@DesktopDir & "\sq.bmp",1,$x1,$y1,0) if $result=1 Then MsgBox(0, "", "found") Else MsgBox(0, "", "not found") Exit EndIf And one more suggestion. I find that using BMP's get correct results more often...could just be me though :-p
madjack Posted August 6, 2011 Posted August 6, 2011 i have tried this and cant get it to work all i get is this error Autoit3.exe has encountered a problem and needs to close blah blah no idea why this is im on xp pro btw any ideas anyone?
madjack Posted August 7, 2011 Posted August 7, 2011 This is frustrating i have tried various scripts and both the large and small dll file i either get the error i mentioned before or the script wont even start i cant even get it to recognise the trash bin on my desktop can anyone give me any help?
monoscout999 Posted August 7, 2011 Posted August 7, 2011 (edited) we are not soothsayers. Post some code. EDIT:... And upload an image. Edited August 7, 2011 by monoscout999
madjack Posted August 7, 2011 Posted August 7, 2011 (edited) au.bmpwe are not soothsayers. Post some code. EDIT:... And upload an image. haha ok #include <ImageSearch.au3> $x1 = 0 $y1 = 0 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $result = _ImageSearch("au.bmp",1,$x1, $y1,0) ;au.bmp is small bmp of trashcan If $result = 1 Then mouseclick("left",$x1, $y1) ;click on trashcan sleep(10000) Else EndIf EndFunc thats my code and here is my pic of middle of trashcan Edited August 7, 2011 by madjack
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now