Jump to content

Click on certain color is not working


Bllacke
 Share

Recommended Posts

Everytime I run it, it won't click the firefox on my desktop.

$Paused = 1
HotKeySet("{F8}", "TogglePause")
HotKeySet("{Esc}", "Terminate")

$coord = PixelSearch( 500, 500, 20, 300, 0xE1781B )
If Not @error Then
    MouseClick("left", $coord[0], $coord[1])
    $paused = 0
EndIf
;----------------------------------------------------------------------
;FUNCTION                                                       ;----
Func TogglePause() 
$Paused = NOT $Paused
While $Paused
ToolTip('Please press "F8" to resume!',600,200,"",1,2)
sleep(1000)
WEnd
ToolTip("")
EndFunc
Func Terminate()
    Exit 0
EndFunc
;----------------------------------------------------------------------
Link to comment
Share on other sites

Everytime I run it, it won't click the firefox on my desktop.

$Paused = 1
HotKeySet("{F8}", "TogglePause")
HotKeySet("{Esc}", "Terminate")

$coord = PixelSearch( 500, 500, 20, 300, 0xE1781B )
If Not @error Then
    MouseClick("left", $coord[0], $coord[1])
    $paused = 0
EndIf
;----------------------------------------------------------------------
;FUNCTION                                                   ;----
Func TogglePause() 
$Paused = NOT $Paused
While $Paused
ToolTip('Please press "F8" to resume!',600,200,"",1,2)
sleep(1000)
WEnd
ToolTip("")
EndFunc
Func Terminate()
    Exit 0
EndFunc
;----------------------------------------------------------------------
Maybe because your PixelSearch coordinates are incorrect. Maybe you meant

$coord = PixelSearch( 500, 500, 500+20,500+ 300, 0xE1781B )
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

pixelsearch

PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] )

so

$coord = PixelSearch( 500, 500, 500+20,500+ 300, 0xE1781B ,0,0)
or
$coord = PixelSearch( 500, 500, 500+20,500+ 300,14776347,0,0)
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...