Sign in to follow this  
Followers 0
Hidden

Simple PixelSearch help

6 posts in this topic

Hey, I'm trying to get Pixelsearch to press a key once it finds a pixel colour on a certain part of the screen. This is what I've got but it just doesn't seem to want to work.

While 1
If PixelSearch ( 680, 808, 707, 832, 0X721665, 50) then
Sleep(243)
        Controlsend("Window", "", "", "F")
        Endif
        
WEnd

I also tried

While 1
PixelSearch ( 680, 808, 707, 832, 0X721665, 50)
If @Error Then
;Nothing
Else
Sleep(243)
        Controlsend("Window", "", "", "F")
        Endif
        
WEnd

So basically I want it to look between a square made up by the 4 co-ords, to find that colour and I tried to give it 50 extra shades just to see if it would work...

Any help?

Share this post


Link to post
Share on other sites



Have you tried adding some code to know if its finding your pixel? Not all programs will respond to send or controlsend.

Share this post


Link to post
Share on other sites

Have you tried adding some code to know if its finding your pixel? Not all programs will respond to send or controlsend.

I'm very new to this... I wouldn't know where to start. Basically, if it's finding the pixel, it's meant to press F... Isn't it? :/

And the ControlSend does work on this particular program, I have used it on it's own.

Share this post


Link to post
Share on other sites

Are you sure about your coords for the search area? I don't know what resolution you run at but for me that is an area off my screen. Course I'm using a laptop. I tried your code, with changed coords, and it found your hex against an image painted to that color so it does work if that pixel color is present.

Share this post


Link to post
Share on other sites

Are you sure about your coords for the search area? I don't know what resolution you run at but for me that is an area off my screen. Course I'm using a laptop. I tried your code, with changed coords, and it found your hex against an image painted to that color so it does work if that pixel color is present.

I'm on a 24' screen so yes, that is on my screen, I'm mostly unsure about the colour really.

Share this post


Link to post
Share on other sites

Not sure what to tell you then outside of making sure you have the color right. :|

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