Jump to content
Sign in to follow this  
Chimerians

Help with Pixel script

Recommended Posts

Chimerians

Hi guys I need help with my pixel script, I cant get it working.

The script runs, but nothing is done, I want the script to press F10 when both coordinates get the same colour, if 1 colour is different, then it wont do anything.

Can someone helpme with this? what did I do wrong?

 

WinActive("cmedu.exe")

#include "misc.au3"
;_sendEx("keys");$keys will not be sent until CTRL, ALT, SHIFT are released back into the wild
Func _SendEx($keys)
    While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12")
      sleep(50)
    WEnd
    Send($keys)
EndFunc;==>_SendEx

Global $xp95 = PixelGetColor(1296, 125)
Global $yp90 = PixelGetColor(1291, 141)

While 1

    If $xp90 = 0x686868 And $yp90 = 0x686868 Then
        If not @error Then
        _SendEx("{F10}")
        sleep(200)

    EndIf
    EndIf
WEnd
sleep(50)

 

Share this post


Link to post
Share on other sites
JLogan3o13

@Chimerians it is difficult to troubleshoot with no more explanation than "nothing is done". How about a detailed description of the app or site you're trying to automate, and what the script should do. PixelGetColor is among the less reliable ways of doing things in AutoIt; there is almost certainly an easier way to accomplish what you're after.


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

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  

×