Jump to content
Sign in to follow this  
sebgg

MY mind is fried! help with pixelsearch or is there a wordsearch?

Recommended Posts

sebgg

right

i understand how 2 use the pixelgetcolor to get the the hex or decimal color,

when i fill out a pixelsearch line which color do i use hex or decimal?

and why cant it find it?

this is the example of what im trying to run

$var = PixelGetColor( 504 , 458 )

if pixelsearch (400,400,620,475,$var)=$var then mouseclick("left" , 504,458,1)

$var would just be the pixelnumber RRGGBB if i knew it right?

basically i need the program to search an area for a pixel and then click on it.

is it possible to do a word search within perameters or is that wishfull thinking?


GC - Program to rapidly manipulate DNA SequencesRotaMol - Program to measure Protein Size

Share this post


Link to post
Share on other sites
FireLord

right

i understand how 2 use the pixelgetcolor to get the the hex or decimal color,

when i fill out a pixelsearch line which color do i use hex or decimal?

and why cant it find it?

this is the example of what im trying to run

$var = PixelGetColor( 504 , 458 )

if pixelsearch (400,400,620,475,$var)=$var then mouseclick("left" , 504,458,1)

$var would just be the pixelnumber RRGGBB if i knew it right?

basically i need the program to search an area for a pixel and then click on it.

is it possible to do a word search within perameters or is that wishfull thinking?

PixelSearch(left,top,right,bottm,color)

The color parameter must be in hex or decimal so make sure $var is not in RGB.


[center]See the Helpfile[/center]
While Alive()
	 DrinkWine();
}
[center][/center]

Share this post


Link to post
Share on other sites
Klaatu

Well, for one thing you're using pixelsearch as if it returned a boolean value, which it doesn't. It returns an array. Test @error if you want to determine if the color was located or not.


My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!

Share this post


Link to post
Share on other sites
sebgg

Well, for one thing you're using pixelsearch as if it returned a boolean value, which it doesn't. It returns an array. Test @error if you want to determine if the color was located or not.

thats usefull but how would it be phrased?

$var = PixelGetColor( 504 , 458 )

if pixelsearch (400,400,620,475,$var)

if not @error then mouseclick("left" , 504,458,1)

endif


GC - Program to rapidly manipulate DNA SequencesRotaMol - Program to measure Protein Size

Share this post


Link to post
Share on other sites
AquilaChill

$var=PixelGetColor(504,458)
$var2=PixelSearch(400,400,620,475,$var)
If Not @error Then MouseClick("left",$var2[0],$var2[1])

to click on the found color from the PixelSearch of the color from the found pixel at 504,458

i think i made it a bit complicated...

im not shure if PixelGetColor gets dec or hex color, but i think it would work with both, though i've always used dec.


people are anoying, am i? ;) v2.95

Share this post


Link to post
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
Sign in to follow this  

×