Jump to content

Recommended Posts

Posted (edited)

$coord = pixelsearch(0, 0, @DesktopWidth, @DesktopHeight,0x817F77)
Mouseclick("left", $coord[0], $coord[1])

So how i could click in random place of that color?

Edited by bf2forlife
Posted

$coord = pixelsearch(0, 0, @DesktopWidth, @DesktopHeight,0x817F77)
Mouseclick("left", $coord[0], $coord[1])

So how i could click in random place of that color?

To do so first of all you need to build an array holding the coordinates of ALL occurrences of pixels of that given shade.

As pixelsearch always returns jus the 1st matching pixel's coords, you could break down the screen into single-pixel-lines. Then search these for the 1st occurrence, after that start searching the same line from x+1 to EOL.

Then use something like Random(1,$MyPixelArr[0],1) to pick out a random one.

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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
×
×
  • Create New...