Sign in to follow this  
Followers 0
AzKay

PixelSearch...

12 posts in this topic

Ive been having a couple of trys with pixel search, but I still dont understand it...

For example, How can I make it, search the screen, for a red dot, then click the red dot?

Maybe an example? The helpfile example didnt help me...


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites



Hi,

$coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xFF0000 )
If Not @error Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
    MouseMove($coord[0], $coord[1])
EndIf

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Doesnt want to work.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Doesnt want to work.

What type of a game or what is this for? Because i found out that virtual keystrokes dont work (or mouseclicks in this case) dont work on some games.

Share this post


Link to post
Share on other sites

I doubt it will work if keystrokes are blocked in game, but there is another way

$coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xFF0000 )
If IsArray($coord) Then
    MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
    MouseMove($coord[0], $coord[1])
EndIf

Share this post


Link to post
Share on other sites

The only thing I want it to do, is click on the pixel


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Damn, please give a little bit more detail. :D

What application or is it a game? What game? What sort of game(Browser or stand alone exe)?

Can you just test it with MouseClick(...) without PixelSearch() maybe even this won't work.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Nothing specific, just in general, how would you click a moving pixel on the screen, Im just wanting to know, on a normal application, no gamegaurd, no browser, Just, a moving pixel on the screen, how would I click it


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Okay, one step further. You have to have a specific color in a specific area I guess, otherwise you cannot indentify the spot.

Something like everything is white, just one spot is red. Then my code above should work.

Where did you test it? Cause you saif it doesn't work.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Okay, one step further. You have to have a specific color in a specific area I guess, otherwise you cannot indentify the spot.

Something like everything is white, just one spot is red. Then my code above should work.

Where did you test it? Cause you saif it doesn't work.

So long,

Mega

Well, I tryed it on that, clown game, in scripts and scarps, using the red on the tip of the nose, It was the only red of that red, and it didnt work

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Well, I tryed it on that, clown game, in scripts and scarps, using the red on the tip of the nose, It was the only red of that red, and it didnt work

Well, did it not click because maybe both scripts have mousemove instead of mouseclick?

Share this post


Link to post
Share on other sites

Hi,

try this:

HotKeySet("{esc}", "end")
HotKeySet("1", "start")

While 1
    Sleep(100)
WEnd

Func start()
    While 1
        $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xBE0E0E)
        If IsArray($coord) Then
            MouseClick("left", $coord[0], $coord[1], 1, 1)
        EndIf
        Sleep(100)
    WEnd
EndFunc   ;==>start

Func end()
    Exit (0)
EndFunc   ;==>end

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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