Sign in to follow this  
Followers 0
Bllacke

Click on certain color is not working

4 posts in this topic

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Maybe because your PixelSearch coordinates are incorrect. Maybe you meant

$coord = PixelSearch( 500, 500, 500+20,500+ 300, 0xE1781B )
The program still won't run.

Share this post


Link to post
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)

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