FindClickDocumentation1FINDCLICKDOCUMENTATIONFunctionbyBerbanLastupdatedMay6,2017FindClickisastandard-librarycompatibleimagesearchingutilitycompatiblewithAutoHotkeyBasicor_L.
ImageCreatormodeDiagnosticmodeThisdocumentationisaworkinprogress.
Somesectionsmaybeemptyandwillbeexpandedlater.
FindClickDocumentation2TABLEOFCONTENTSFindClickDocumentation1TableofContents2Quick-StartGuide4AutoHotkeyfunctionbasics.
4Clickingonanimage.
4Retrievingcoordinatesofanimage.
4Keyoptions4Creatinganimage.
5ImageSearchMode.
5ImageFileParameter.
5Searchusingapixelcolor5Formatofpixelcolor.
6ComparisonwithPixelSearch6Searchusingapreexistingimagefile.
6Omitdirectoryusing%DefaultDirs%6Omitextensionusing%DefaultExts%7OptionsParameter7Usingtheoptionsparameter.
7ModifyingDefault/UserDefaultvalues8UserConfigurationsforoptions8Listofoptions8o–ImageSearchOptions.
9a–SearchAreaModifications9r–RelativetoWindowCoords.
9x–XOffset.
9y–YOffset.
9n–Numberofclicks(Noclick)9e–FindEveryImage.
10w–Waituntilimageisfound10dx–DiagnosticMode10k–Keystroke(s)10Stay–Donotrestoremouse10Count–Returnfoundcount.
11d–DirectionOfSearch.
11m–SendMode.
11Func–FunctionCallout11Sleep–Sleepbetweenclicks11t–ImageTracking.
11FindClickDocumentation3Silent–NoDialogs.
12Center–Startatcenterofimage12Delim–Delimiterformultipleimages.
12f–Formatofoutputstring12CharX–Characterspaceholderforx-coordinate12CharY–Characterspaceholderfory-coordinate12CharN–Characterspaceholderforimageinstancenumber12ImageCreatorMode13Startingtheimagecreator.
13Searchingforanon-existentimagefile.
13Explicitlycallingtheimagecreator.
13Usingtheimagecreator13Magnifytheareayouwant.
13Selectingaregionfromthemagnifier14Allowoffset.
14Testing14Savingyourimage.
14Copycodetoclipboard.
14Modifyingimagecreatorsettings.
14DiagnosticMode15Initiatingdiagnosticmode15Usingthedxoption.
15Afteranerror.
15Usingthedebuggergui.
15ImageSearchSuggestions16Choosinganimage.
16Performance16Examples.
17ClickonTextinGoogleChrome.
17DuplicateTabinGoogleChrome.
17SeekinSpotify18FrequentlyAskedQuestions.
19Buttonsthatlookdifferentwhenthemousehovers19Choosingamongmultipleresults19License20SpecialThanks.
20FindClickDocumentation4QUICK-STARTGUIDEAUTOHOTKEYFUNCTIONBASICSUserswithsomeexperienceshouldalreadybefamiliarwiththispart,butifthesestepssoundstrangetoyouthenbesuretocheckthemout.
1.
Includingafunctioninyourscript2.
HowtousefunctionsCheckouttheAutoHotkeyfunctionsdocumentationformoreinformation.
CLICKINGONANIMAGEToclickonanimageusingFindClick,simplycallthefunctionandputthepathtoyourimagefileinthefirstparameter.
FindClick("C:\Images\MyImage.
png")RETRIEVINGCOORDINATESOFANIMAGEFindClickcanalsogiveyouthecoordinatesoftheonscreenimagemuchliketheImageSearchcommand.
Therearetwowaystoretrievethecoordinates.
1.
Usingthereturnedvalue:Thefunctionwillreturnthecoordinatesdelimitedbyacomma.
MsgBox,%FindClick("C:\MyImage.
png");Iftheimageisfoundat(100,200)themessageboxshoulddisplay"100,200"2.
UsingtheByRefvariables:The3rdand4thparametersofFindClickareByRefparametersinwhichthex-andy-coordinatesoftheimagelocationwillbestoredifthesearchissuccessful.
FindClick("C:\MyImage.
png","n",xCoord,yCoord)MsgBox,Thex-coordinateoftheimageis%xCoord%MsgBox,They-coordinateoftheimageis%yCoord%Ifyoujustwanttofindthecoordinatesoftheimagewithoutclickingonit,usethenoptionasintheaboveexample.
KEYOPTIONSAllowvariationinimagematch:ooption.
Indicateanynumbertoallowthatmanyshadesofvariation.
FindClick("C:\MyImage.
png","o12");Allows12shadesofvariationFindClickDocumentation5Findallinstancesofanimage:eoption.
Allcoordinatepairswillbereturnedbythefunction,delimitedbynewline(`n)characters.
MsgBox,%FindClick("C:\MyImage.
png","e");WilldisplayeachlocationatwhichanimageisfoundonitsownlineRelativetoactivewindowonly:roption.
FindClick("Image","r");Willonlysearchforimageinsidetheactivewindow'sbordersClickseveralpixelsawayfromanimage:xandyoptions.
FindClick("Image","x10y-20");Willclick10pixelstotherightofand20pixelsabovethecenteroftheimage,iffoundSeethesectiononOptionsformoreinfo.
CREATINGANIMAGETouseFindClick'sbuilt-inimagecreator,whichisoptimizedforthesortofsmallandpreciseimagesthatImageSearchuses,callthefunctionwithnoparameters.
FindClick();WilldisplayimagecreatorwindowMoreinfointherelevantsectionbelow.
IMAGESEARCHMODEImageSearchmodeistheprimaryintendeduseforthisscript.
IMAGEFILEPARAMETERThefirstparameterinFindClickisthegraphicalelementthatyouaresearchingfor.
Thiscaneitherbeapreexistingimagefileoracoloredregion.
SEARCHUSINGAPIXELCOLORFindClickcanemulatethebehaviorofPixelSearchifyouspecifyapixelcolorfortheImageFileparameter.
Thiscanbeusefulifthecoloryouaresearchingformightchangewhilethescriptisexecuting.
Itcanalsohelpreduceunnecessaryimagefileclutter.
FindClickDocumentation6Formatofpixelcolor1.
Asterisk(*)Thisfilepath-incompatiblecharactertellsFindClickthatyoumeanacolorandnotafile.
2.
PixelColorPixelcolormustbeahexadecimalvalueandnotacolorname.
WhetheritisinterpretedasaRGBorBGRvaluedependsonthevalueassignedto%UseRGB%atthetopofthecode.
The0xprefixisoptional.
3.
Dimensions(optional)Followingthecolorcodemayoptionallycomeanon-numericcharacterandthenaWidthxHeightvalue.
ThistellsFindClicktofindaregionofthiswidthandheightofthegivencolorasopposedtoasinglepixel.
;FindsawhitepixelandclicksonitFindClick("*0xFFFFFF");Findsauninterruptedregionofwhitepixelsthatisatleast10pixelswideand20pixelshighFindClick("*FFFFFF10x20")ComparisonwithPixelSearchDespiteitssimilaritytoPixelSearch,searchingforapixelcolorwithFindClickstillusesAutoHotkey'sImageSearchtechnique.
ThisintroducessomekeydifferencesbetweenFindClickandPixelSearch:CompatiblewithWindowsAeroandWindows8.
StartinginWindowsVista,Microsoftintroducedanewwaytorenderthedesktopcalleddesktopcomposition.
ThisbreaksPixelSearch;however,ImageSearch(andbyextensionFindClick)isunaffected.
InVistaand7youcandisabledestopcompositionbutitcannotbeturnedoffinWindows8.
FindClickcanbeusedasaworkaroundtothisissue.
Regionsmaybeusedinsteadofpixels.
Youcansearchforanareaofcolorinsteadofasinglepixel,whichhelpsavoidfalsepositivesinphotosorgradients.
Animagefilemuststillbecreatedondisk.
FindClickusesGDI+tocreateanimageofthespecifiedcolorandsizebeforeperformingthesearch.
Theimagefileisstoredinthewindowstemporarydirectory.
ThisisarelativelyCPU-intensivestep(1oreandmultipleimagesfound.
t–ImageTrackingWhattogivepercentORnumberofpixelsDescriptionThisoptionisusedtoimproveperformanceifanimagewillbefoundnearbywhereitslastlocation.
Thescriptwillfirstsearchnearbythelastfoundpositionandifitisnotfoundtherethentherestoftheareawillbesearched.
Indicateapercentagetosearchwithinthatpercentageofthesearchareaineachdirection.
Forinstance,thestring20%willfirstsearchaboxthatbegins20%ofthedistancebetweenthestartingxpositionandthelastfoundxposition,andlikewisefortheotherthreedirections.
Indicatinganumberwillsimplysearchaboxthatmanypixelsfromthelastfoundareabeforesearchingtherestofthesarea.
Indicate0tosearchEXACTLYthelastfoundlocationfirst.
Iftisnegative(including-0)thenitwillONLYsearchintheregionrequested,andwillnotgoontosearchtherestofthescreeniftheimageisnotfoundthere.
FindClickDocumentation12Silent–NoDialogsWhattogivetrueorfalse(1or0)DescriptionInsteadofdisplayinganerrordialogwhenanerrorpreventsthefunctionfromexecutingproperly(forinstance,iftheimagefileisnotfound),itwillsilentlyreturnablankstringandsettheErrorLeveltotheerrormessage.
TheerrorsconcernedshouldnotappearduringnormalexecutionandsoSilentisgenerallynotrecommended.
Center–StartatcenterofimageWhattogivetrueorfalse(1or0)DescriptionIfCenteristruethenclickswilloccuratthecenteroftheimage,i.
e.
itsfoundpositionplushalfitswidthandhalfitsheight.
Thexandyoptionstreatthisas0,0–forinstance,bydefaultanxof2willclick2pixelstotherightoftheimagecenter.
Indicatefalsetoinsteadstartatthetopleftcorneroftheimage.
Delim–DelimiterformultipleimagesWhattogiveanycharacterorcharactersDescriptionIfeisusedandmultipleimagesarefoundtheneachimage'sinfoisseparatedbythischaracter(s)inthereturnedstring.
Theformatoftheimageinfoisdeterminedbythevalueoff.
f–FormatofoutputstringWhattogivetemplatestringthatincludesCharXand/orCharYand/orCharNcharactersDescriptionThegivenstringrepresentsatemplateintowhichimagex-coordinate,y-coordinate,andinstancenumberwillbesubstituted.
Eachtimeanimageisfound,theCharX,CharY,andCharNcharacterswillbereplacedwiththesevalues.
Thefinalstringisreturnedbythefunction.
Seetheexamplessectionofthedocumentationforanexample.
CharX–Characterspaceholderforx-coordinateWhattogiveanycharacterDescriptionAnyinstanceofthischaracter,ifpresent,inthestringgivenforfwillbereplacedwiththeimage'sx-coordinate.
CharY–Characterspaceholderfory-coordinateWhattogiveanycharacterDescriptionAnyinstanceofthischaracter,ifpresent,inthestringgivenforfwillbereplacedwiththeimage'sy-coordinate.
CharN–CharacterspaceholderforimageinstancenumberWhattogiveanycharacterDescriptionAnyinstanceofthischaracter,ifpresent,inthestringgivenforfwillbereplacedwiththeorderinwhichtheimagewasfoundamongallimagesfound.
Thischaracterisonlyrelevantwheneisbeingusedandisthereforenotnormallyincludedinf.
FindClickDocumentation13IMAGECREATORMODEBuiltintotheFindClickcodeisasingle-purposegraphicalinterfaceforcreatingthesortofsmallimagefilesthatyouwillneedforFindClickorImageSearch.
Usingthistoolisconsiderablyfasterandeasierthanusingprintscreenandmspaint.
STARTINGTHEIMAGECREATORTherearetwomainwaystobringuptheFindClickscreenshotcreatorGUIwindow:Searchingforanon-existentimagefile.
IfyoucallFindClickwithanimagefilethatdoesnotexistitwillgiveanerrordialogaskingifyouwanttocreatetheimage.
Simplyselect"Yes"inthisdialogtogototheimagecreator.
Theoutputfilepathandimagesearchoptionsfieldswillbeprepopulatedwiththevaluesusedintheoriginalfunctioncall.
ExplicitlycallingtheimagecreatorIfFindClickiscalledwithablankimagefilethentheGUIwillappearwithdefaultsettings.
FindClick();SummontheimagecreatorGUIToprepopulateanoutputfilepath,precedeitwithacaret>intheImageFileparameter.
FindClick(">SuggestedName.
png");Ifthepathisrelative,asitishere,theusercanchoosewhichofthe%DefaultDirs%toputthefileinMoreinfoonexplicitlycallingtheimagecreator:Usingtwocarets>>insteadofonewillswitchtheoutputfilepathgroupboxcontroltoadropdownthattheusercanoptionallyedit.
Usingthreecarets>>>willdisableediting.
PrepopulatetheoptionsfieldbyincludingtextintheOptionsparameter.
IftheGUIissubmittedandanimageiscreated,FindClickwillreturnTrue.
Ifused,FoundXwillcontaintheultimateoutputfilepathandFoundYwillcontaintheoptionstheuserentered.
USINGTHEIMAGECREATORWhentheimagecreatorappearsyouwillseeanarrayofpixelsthatmagnifyaregionofthescreen.
MagnifytheareayouwantAsyoumoveyourmousethedisplayshouldupdateandshowtheareaunderyourcursor.
Ifthisdoesnothappenthentheimagecreatorisprobablypaused.
Pressthe"Unpause"buttonanddragthecursorovertheon-screenelementyouareinterestedin.
Whentheelementofinteresthasappearedonthemagnifier,pressthepausehotkeytofreezethedisplay.
Thedefaultpausehotkeyisbacktick(`)butyoucanchangethisintheimagecreatorsettingssection.
FindClickDocumentation14SelectingaregionfromthemagnifierThesizeofthemagnifiedregionisnotlargebutyourfinalimagewilllikelybeevensmaller.
Toselectaregionforyourimage,clickononeofthemagnifiedpixelsinthedisplay.
Movethemousefromthetop-leftcornerofthedesiredregiontothebottom-rightcornerandclickagain.
Thepixelsinyourregionshouldnowbesurroundedbyapinkbox.
Ifyouomitthisstepthentheentireregionwillbeused.
AllowoffsetSometimestheappearanceofagraphicalelementwillchangewhenyouhoverthemouseoverit.
Thismeansthathoveringthemagnifierovertheimagewon'tgivethedesiredresult.
Toworkaroundthis,pausethemagnifierandcheckthe"AllowOffset"checkbox.
Thismeansthatthebluemagnifiedregionwillmovewhenthemousemoves,asopposedtomovingtothelocationofthemouse.
Ifyoutryitoutyou'llgetthehangofit.
TestingYoucantesttheimageyou'veselectedwithFindClickbypressingthe"Test"button.
Theimagecreatorguiwillhideandthescriptwillsearchfortheimageonyourscreen.
Thecontentsofthe"Options"editfieldwillbeusedastheFindClickoptions.
Ifthe"DiagnosticMode"checkboxischeckedthenthedxoptionwillbeappendedtoyouroptionsstringwhenyouperformthetest.
Thismeansthatthedebuggerguiwilldisplayoncethetestfinishes.
Simplyclosethedebuggertoreturntotheimagecreator.
SavingyourimageWhenyoupressthe"Save"buttonyourselectedimagewillbesavedtothepathinthe"OutputFile"field.
Thedropdownitemsinthe"OutputFile"fieldarepopulatedwiththecontentsof%DefaultDirs%(describedearlier).
Theseareassumedtobethemostlikelyplacesyou'llbesavingafile,howeveryoumayalsopress"Browse"toselectanotherlocation.
CopycodetoclipboardIfthe"CopycodetoClipboard"checkboxischeckedwhenyousavetheimagefile,AutoHotkeycodeforthegivenFindClickcallwillbestoredintheclipboard.
TheImageFileparameterwillcontainthepathtotheimagefileyoujustcreated,andtheoptionsparameterwillcontainthecontentsofthetestoptionsfield.
MODIFYINGIMAGECREATORSETTINGSIfyousearchthecodeofFindClickforthephrase"ScreenshotBuilderSettings"youcanseeaseriesofvariabledeclarationsthatinfluencevariousaspectsoftheimagecreator.
Thesesettingsinclude:Changingthetextdisplayedonbuttons(e.
g.
forchangingthelanguage)Changingacceleratorkeys(altshortcuts)Changingthesizeofthemagnifier(i.
e.
thenumberofpixelsdisplayed)Changingthesize&fontofotherelementsChangingthedefaultstateofanyofthecheckboxes.
FindClickDocumentation15…amongothersettings.
Simplyfindthispartofthecodetobrowsethesettingsthatcanbemanipulated.
Allthesettingsaredescribedinthefunctioncomments.
NotethatIrecommendchangingAllowOffsettotrueonceyouhavethehangofthefunction,asitisoftennecessaryandstartingoutwithitenabledsavestime.
DIAGNOSTICMODEThediagnosticmodeinFindClickistobeusedwheneverFindClickisnotdoingwhatyouwantittodo.
Whenthediagnosticmodeisineffect,FindClickwillexecutenormallyandthendisplayaGUIoncethefunctionhasfinished.
Thisdebuggerwindowwillattempttowalktheuserthroughhowthecodeexecuted.
Afterall,thefunctionisseveralhundredlineslong,anditiseasytolosetrackofwhatishappeninginsideit.
INITIATINGDIAGNOSTICMODEUsingthedxoptionThemainwaytotellFindClicktodisplaythedebuggeristousethedxoption.
AfteranerrorIfFindClickencountersanerror(e.
g.
ifitcannotfindtheimagefileyouspecified),anerrordialogwillbedisplayed(unlesstheSilentoptionhasbeenspecified.
)Ifyoupress"Debug"inthaterrordialog,thefunctionwillrunagainanddisplaythedebuggerGUIwhenitencounterstheerror.
USINGTHEDEBUGGERGUIThemainfeatureofthedebuggerGUIisatreeviewcontainingeachstepofthecode.
Boldstepshaveagraphicalcomponent.
Theseincludeapreviewoftheimageused,highlightingthesearcharea,ordemonstratingwhereclickswereperformed.
Theboxinthetopleftshowstheamountoftimespentontheselectedstep(andallsubsteps),allowingyoutonarrowdownwhatiscausingperformanceissues.
Right-clickorusethemenustotakeactionsbasedontheselectedstepinthecode,includingcopyingthecontentsofrelevantvariablesoropeningthescripttothatlocationinthecode.
(…thissectionisaworkinprogress…)FindClickDocumentation16IMAGESEARCHSUGGESTIONSAutoHotkey'sImageSearchisanincrediblyusefultool;however,likemanytools,thereareseveralrightandwrongwaystouseit.
ThefollowingaresomepossiblyusefultidbitsI'velearnedwhileusingImageSearch/FindClickforvarioustasks.
CHOOSINGANIMAGEYourimageshouldbeunique.
Optimally,acrosswhateverregionofthescreenthatyouaresearching,thereshouldonlybeoneoccurrenceoftheimage(unlessyouarelookingformultiple.
)Ifthereismorethanoneoccurrencethenyoucantryreducingtheareatobesearched.
Forinstanceifthereisagraphicsomewhereinthetopofawindowandanothernearthebottom,youcansearchwiththeoptionsra,-200.
Thismeansonlythebottom200pixelsofthewindow'sheightwillbeconsidered.
Thetypeofon-screenelementishugelyimportant.
oGraphicsarebest.
By"graphic"Imeananelementofanapplicationthatisstoredasanarrayofcoloredpixels,i.
e.
likeanimagefile.
Onawebsite,anyelementwithanimagesrcisagraphic.
Inotherapplicationsit'sharder.
Anyicons,suchasaprinterorapairofscissors,shouldbegraphics.
oGradients&colorsareusuallyworkable.
Forinstance,selectedtextcanoftenbefoundbysearchingforthecoloroftheselectionhighlight.
Acoloredbuttonmightnotbebasedonagraphicbutifit'safairlyuniquehuethenyoucanuseasnippetofitsnon-textarea.
Ifyouaresearchingforagradientthenmakesureoismorethan0toallowforsomevariation.
Notethatgradients&colorswilllikelybeyouronlyoptionina3Dgameaseverythingwillberendered.
oTextisusuallybad.
By"text"ImeandatathatisstoredinUnicodeorASCIIformat.
Thisisbadbecauseeachtimethetextisdisplayedtheapplicationmightrenderitdifferently.
Theimagedoesn'thavetobewhatyou'researchingfor.
Sometimesthethingyouwanttoclickonwon'tbeunique.
Thisisfineaslongasthereisauniqueelementnearbyitthatcananchoritsposition.
Forinstanceifyouaretryingtoclickonasearchbox,thewhiteeditfieldbackgroundprobablywon'tbeunique,butthesearchbuttonmightbe.
Thenyoucanusethexandyoptionstoslideovertotheplaceyouactuallywanttoclick.
Smallerisbetter.
Ibarelyeveruseimagefileslargerthan10x10.
Usuallytheyaresmallerthanthat.
Yourimageshouldonlycontainasmanypixelsasyouneedtoguaranteeit'llbeuniqueonthescreen.
Toomanybeyondthatjustincreasesthelikelihoodthatyourimagewon'tmatch.
PERFORMANCETheamountoftimeanImageSearchcommandtakesisroughlyproportionatetotheareaofthesearch(assuminganimageisnotfound)andtheshadesofvariationallowed.
FindClickDocumentation17EXAMPLESCLICKONTEXTINGOOGLECHROMEAutoHotkeycan'tbeusedwithCOMtoautomateGoogleChromelikewithInternetExplorer.
However,ifyouwanttoclickonatextualelement(averycommontaskwithautomatingwebtasks)youcantakeadvantageofthefactthatusingCtrl+FinChromewillalwayshighlightthetextwiththesamecolor.
Thismethodwillevenscrolltothetextifitisn'tcurrentlyvisible.
However,unlikewithCOM,Chromemustbetheactivewindow.
ChromeClick(Text){Send^f^f;openthefinddialogbox–sendtwicetobesafeSendInput{Raw}%Text%;typeinthesearchterm;Send{Enter%n%};Normallythiswillonlyfindthefirstoccurrenceofthedesiredword.
Ifyouknowyouneedthe2ndor3rdyoucouldaddalinelikethis.
If!
FindClick("*0x3296FF3x2","ra,73k{Esc}{Click}y5w500,0"){Send{Esc};ifthetextisn'tfound,closethefindboxSoundPlay,%A_Windir%\Media\WindowsDing.
wav;dingforerror}}/*ExplanationofFindClickparameters:*0x3296FF3x2=thecolorofthehighlightaroundthefoundtextitemk{Esc}{Click}=insteadofclicking,thefunctionwillpressescape(toclosethefindbox)andthenclick.
Ifyouclickfirstthefindboxwillnolongerhavefocusandwillnotclosewhenescapeispressed.
y5=clickatinybitbelowtheimagebecauseitwillusuallyfindthetopedgeofthehighlightw500,0=wait500msincasechromedoesn'timmediatelyfindtheword.
0formaximumperformanceduringthisshortperiod.
*/#IfWinActiveGoogleSearchahk_classChrome_WidgetWin_1;examplehotkey^n::ChromeClick("Next");gotonextpageinGooglesearchresultsDUPLICATETABINGOOGLECHROMEMimicshowinInternetExploreryoucanpressCtrl+Ktoduplicatethecurrenttab.
^k::FindClick("*0x4A4A4A4x4","x5y5k{RButton}dra5,20,-100,15");0xF2F2F2isthecoloroftheactivetabwiththedefaulttheme.
Replacethiswithwhatevercoloryourthemehas.
;k{RButton}d=whenitisfound,insteadofclickingrightclickandthenpressdtoselect"duplicate"inthemenu;a5,20,-100,15=onlyseeksthetopsliverofthechromewindowFindClickDocumentation18SEEKINSPOTIFYUsesUp,Down,Left,RightkeystoseekbackinforthinthecurrenttrackinSpotifyfordesktop.
#IfWinActiveahk_classSpotifyMainWindow~$Right::;~hotkeysareusedsoarrowkeynavigatingwillstillwork~$Left::~$Up::~$Down::SeekShort=30;willmovethismanypixelswithleft/rightSeekLong=100;willmovethismanypixelswithup/downIf!
FindClick("spotify_seek","ra250,-34,-250,25x"(RegExMatch(A_ThisHotkey,"Right|Up"(RegExMatch(A_ThisHotkey,"Up|Down")SeekLong:SeekShort))SoundPlay,%A_Windir%\Media\WindowsDing.
wav;Iftheimageisn'tfoundthenplaythewindows"ding"soundindicatinganerror.
Return/*ExplanationofFindClickparameters:r=relativetotheactive(Spotify)windowa250,-34,-250,25=approximateareawithinthewindowwheretheseekbarwillbefound.
Thisisn'tstrictlynecessarybutimprovesperformance.
Thesearchareahasthefollowingcharacteristics:250–leftedgeis250pxfromtheleftedgeofthewindow-34–topedgeis34pxfromfromthebottomedgeofthewindow-250–rightedgeis250pxfromtherightedgeofthewindow25–rectangleis25pxtallx(ternaryexpression)=willclickeithertotheleft(negativex)ortotheright(positivex)oftheseekbarbasedonwhichhotkeyispressed.
*/Theimagesegmentusedcanbeseenbelow.
Notethatitisonly6x6pixels.
Usinganimagelikethismaynotalwayswork–thescrollbarcouldhavebeenavectorimagethatchangedasthesongplays.
Butit'sworthtryingwithFindClick,andinthiscaseitworksjustfineregardlessofseekposition.
FindClickDocumentation19FREQUENTLYASKEDQUESTIONSBUTTONSTHATLOOKDIFFERENTWHENTHEMOUSEHOVERSWhatifIwanttouseFindClicktoclickonsomebutton,butwhenIusethescreenshotcreatorandhoveroverthebuttonitlooksdifferentToworkaroundthisissueyouneedtochecktheboxthatsays"AllowOffset"inthescreenshotcreatorGUI.
Whenyouusethissetting,themagnificationboxwillmoverelativetowhereitwasleftwhenthescriptwaslastpaused.
Thismeansyoucanpausethescript,movethemouse,andthenunpausethescriptsothatthemagnificationareawillnotberightunderneaththemouse,andyouwillbeabletomagnifythebuttonasitlookswithoutthemousehoveringoverit.
CHOOSINGAMONGMULTIPLERESULTSForinstance,saythereare17instancesofaparticularimageonscreenthathavebeendetectedwiththeeoption.
Howdoyouchoosethe4thfromthetopTheanswerisyouneedtowriteabitmoreAutoHotkeycodetoparsetheresults.
Themethodfortheeoptioncanreturntheresultsinasomewhatarbitraryorder,sotellingFindClickyouwantaparticularimagenumberdoesn'tmeanawholelot.
;Thebelowcodestoresthecoordinatepairsin%Results%;"n"tellsFindClicktonotclickontheimagesbecauseyoujustwanttoknowwheretheyare;"fy,x"tellsFindClicktoformattheresultswiththey-coordinatefirst,thenacomma,andthenthex-coordinate.
Thiswillallowsortingbythey-coordinateResults:=FindClick("image","enfy,x")Sort,Results,N;Willsorttheresultsbasedonthey-coordinate.
NisnumericalsortLoop,Parse,Results,`n;ParsethelistonecoordinatepairatatimeIf(A_Index=4){;Stopatthe4thitemStringSplit,Coords,A_LoopField,`,;SplitbycommaMsgBox,Thecoordinatesare(%Coords2%,%Coords1%);Reversetheordersoitbecomesx,yagainBreak}Ifyouwanttosortbasedonthex-coordinate,youcanomitafewofthestepsabove.
Results:=FindClick("image","en")Sort,Results,N;x-coordinateisfirstbydefaultsowilldeterminethesortingorderLoop,Parse,Results,`nIf(A_Index=4){MsgBox,Thecoordinatesare(%A_LoopField%)BreakFindClickDocumentation20}LICENSEThiscodeisprovidedwiththeMITLicense.
Basicallyyoucandowhateveryouwantwiththecode.
Feelfreetocontactmeontheforumsifyouhaveaquestion.
Licenseat:https://opensource.
org/licenses/MITSPECIALTHANKSTic+Rseding91forGdip.
ahkhttp://www.
autohotkey.
com/board/topic/29449-gdi-standard-library-145-by-tic/p=533310Chris+LexikosforAutoHotkeyhttp://www.
autohotkey.
com/
云如故是一家成立于2018年的国内企业IDC服务商,由山东云如故网络科技有限公司运营,IDC ICP ISP CDN VPN IRCS等证件齐全!合法运营销售,主要从事自营高防独立服务器、物理机、VPS、云服务器,虚拟主机等产品销售,适合高防稳定等需求的用户,可用于建站、游戏、商城、steam、APP、小程序、软件、资料存储等等各种个人及企业级用途。机房可封UDP 海外 支持策略定制 双层硬件(傲...
paypal贝宝可撸$10的代金券!这两天paypal出了活动,本次并没有其他的限制,只要注册国区的paypal,使用国内的手机号和62开头的银联卡,就可以获得10美元的代金券,这个代金券购买产品需要大于10.1美元,站长给大家推荐几个方式,可以白嫖一年的VPS,有需要的朋友可以看看比较简单。PayPal送10美元活动:点击直达活动sfz与绑定卡的号码可以重复用 注册的邮箱,手机号与绑的银联卡必须...
最近主机参考拿到了一台恒创科技的美国VPS云服务器测试机器,那具体恒创科技美国云服务器性能到底怎么样呢?主机参考进行了一番VPS测评,大家可以参考一下,总体来说还是非常不错的,是值得购买的。非常适用于稳定建站业务需求。恒创科技服务器怎么样?恒创科技服务器好不好?henghost怎么样?henghost值不值得购买?SonderCloud服务器好不好?恒创科技henghost值不值得购买?恒创科技是...
chrome 18为你推荐
骁龙750g和765g哪个好骁龙765G,这里的g是什么意思?浏览器哪个好用浏览器哪个好三国游戏哪个好玩三国类单机游戏哪个最好玩啊?手机杀毒软件哪个好手机用杀毒软件,用哪样的好手机管家哪个好手机管家和腾讯手机管家哪个好用dnf魔枪士转职哪个好dnf魔枪士转职哪个适合平民玩电动牙刷哪个好有人懂电动牙刷吗?飞利浦的好用还是欧乐B好用行车记录仪哪个好我想买一个24小时监控行车记录仪,哪款比较好?百度空间登录怎么登录百度空间qq空间登录不了为什么我的QQ登陆不了QQ空间
网站空间购买 重庆虚拟主机 a2hosting tk域名 网站挂马检测工具 嘉洲服务器 godaddy域名证书 hostloc 双11秒杀 七夕快乐英语 下载速度测试 石家庄服务器托管 杭州电信宽带优惠 websitepanel comodo 服务器操作系统 easypanel cdn免备案空间 免费服务器 日本小学生 更多