Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted

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.

Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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