Sign in to follow this  
Followers 0
bowbowbow

Regarding Pointers/pixel Searching

3 posts in this topic

Hi, Im new in learning how to build a intermediate script, although I've done some easy macros before, yet I have one question. As regarding pixelsearhing, Im still not sure how the Left, Top, Right Botom works

"PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )"

What I mean is, how do i get the coordinates for left, top, right bottom?

Ive tried visualizing the object I want to get pixelsearched as a rectangle, Left and Right would be Y axi.

Top and Bottom would be X axis. Then I would get a co-ord border around the rectangle, then finally run the script. But whenever I do so, it either:

1)Doesn't give me a prompt box with color found

or

2)Gives me a X,Y coord but is a few #'s off of the color I searched for.

If anyone could help me and clarify the left top right bottom business, it would be awesome. THX

(btw-I have done searches for pixelsearch, coords L t r b, to learn about this matter, even read the help, yet im still unsure. )

Oh heres the script i used, (which is found in the help)

; Find a pure red pixel in the range 0,0-20,300

Sleep(5000)

$coord = PixelSearch( 160, 198, 156, 213, 0x000000) <---I just switched it around to search for black

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

; Find a pure red pixel or a red pixel within 10 shades variations of pure red

$coord = PixelSearch( 160, 198, 156, 213, 0x00000, 10)

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$coord = PixelSearch( 160, 198, 156, 213, 0x000000) <---I just switched it around to search for black

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

; Find a pure red pixel or a red pixel within 10 shades variations of pure red

$coord = PixelSearch( 160, 198, 156, 213, 0x00000, 10)

If Not @error Then

MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])

EndIf

ok that will not work for this reason...

Left is obviously the x axis, and top is the y axis, but you have a right value less than that of the left, think of it like this...

Left, Top, Width, Height .... WHERE Width = Left + How Wide the search area need be, IE. left is at 100 and you want to search in a width of 100 then right need be 200, the same concept goes for top and bottom/height.

Hope I have not confussed you further.

Also I see on the 2nd pixelsearch you have a 10 at the end, that means that every 10 pixels it searches that ONE pixel, you might want to make that more accurate by setting it to anything from 1 - 3, maybe 4 or 5 max in some situations.

Hope I have shed some light on this issue.

Laterzzz,

Onoitsu2

Edit: I thought I saw a shade variance value in the 2nd one, then looked again, disregard scratched out items.

Edited by Onoitsu2

Things I have made:[font="Trebuchet Ms"]_CheckTimeBlock UDF(LT)MOH Call Ignore List (MOH = Modem On Hold)[/font]

Share this post


Link to post
Share on other sites

Ahhh I finally unstand now. I complete forgot about how graph's are, regarding X and Y's, and pictured a rectangle instead. No wonder.

Thank you very much, now i can finally pinpoint the pixel colors i want, thx!

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  
Followers 0