Jump to content

Help with Pixel script


Recommended Posts

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)

 

Link to comment
Share on other sites

  • Moderators

@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.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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...