Jump to content

randomizing mouseclick


Recommended Posts

$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!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...