Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

ControlClick with PixelSearch

$
0
0

Hey!
I would like to write a script which clicks to a bookmark of mine while it's on the tray. 

AutoIt         
Global $Paused HotKeySet("{F2}", "TogglePause") HotKeySet("{F3}", "Terminate") HotKeySet("{F1}", "Start") $GoogleChrome = 0x9E0E09 ; Youtube icon color MsgBox(4096, "", "Go to DeskTop Before Pressing Home.") While 1     Sleep(10) WEnd Func TogglePause()     $Paused = Not $Paused     While $Paused         Sleep(100)         ToolTip('Script is "Paused".To resume press "Pause" again', 0, 0)     WEnd     ToolTip("") EndFunc   ;==>TogglePause Func Terminate()     MsgBox(4096, "", "Press ok To close IE opener.")     Exit 0 EndFunc   ;==>Terminate Func Start()     If $t = PixelSearch(@DesktopWidth, @DesktopHeight, 34, 80, $GoogleChrome) Then         ControlClick("Facebook - Google Chrome", "", 101973760, "Left", "1",)     Else         MsgBox(64, "Error", "Not found")     EndIf EndFunc   ;==>Start

I would like to write this script in order to speed up opening a specified page (like youtube) even if i have lagg.

+I started writing this script because i have read the help file under PixelSearch and these were it's parameters:

left left coordinate of rectangle.

top top coordinate of rectangle.

right right coordinate of rectangle.

bottom bottom coordinate of rectangle.

color Colour value of pixel to find (in decimal or hex).

shade-variation [optional] A number between 0 and 255 to indicate the allowed number of shades of variation of the red, green, and blue components of the colour. Default is 0 (exact match).

step [optional] Instead of searching each pixel use a value larger than 1 to skip pixels (for speed). E.g. A value of 2 will only check every other pixel. Default is 1.

hwnd [optional] Window handle to be used.

 

The last one means that you can use this function for Windows which are not on the screen but maybe on the tray.

Thanks for help!


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>