Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

PixelSearch

$
0
0
Hi everyone,

First off I apologize for any unclarity in my posts or anything out of the norm as I have only just signed up and this is my first scripting language...

I'm aiming to achieve a macro that can push buttons of specific colour in an internet browser
I first tryed configuring and playing around with Imagesearch, but came to a bit of a holt due to my limited knowledge in areas.

I can achieve what i want with this, (see code below) as my idea here was when 1 button dissapears another one shows up to the side at different coordinates... confirming that this is what I want.

I recieved mouse Coords from windows spy, but couldn't get controlid or any text in IE or Firefox
i know this has been covered and there are other ways.

but my problem is when i eventually make my script available to other users, the resolution settings/toolbars and other factors  will alter the coordinates and if no colour is found at such coordinates then mouse will not click.

I've tryed looking at the help file and i just can't fathom my problem. Is there anyway to
search the entire screen for such pixels as that colour id is only available on these buttons and if found return coords to array then move mouse that way? do i require multiple arrays working at once?like a massive script with every cooridnate in it?im not to good at maths  but do enjoy this type of thing.

Or if you could provide how to gather elements from buttons and a few functions needed or any helpfiles ill be happy to look and research where u tell me. i just feel lost not knowing if what im doing is even correct.
I'm sorry to be spoonfed and i hope i dont waste anyones time

thanks



[ autoit ]      
While 1 $pixel = PixelSearch (465,391,578,391,0x00c02F) if IsArray ($pixel) = True Then Sleep (750) MouseMove($pixel [0], $pixel [1], 1) MouseClick ( "left" ) Sleep (250) EndIf $pixel = PixelSearch (487,487,582,486,0x00c02F) if IsArray ($pixel) = True Then Sleep (750) MouseMove($pixel [0], $pixel [1], 1) MouseClick ( "left" ) Sleep (1000) EndIf WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>