optionalchrome

chrome 18  时间:2021-01-31  阅读:()
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/

青云互联19元/月,美国洛杉矶CN2GIA/香港安畅CN2云服务器低至;日本云主机

青云互联怎么样?青云互联美国洛杉矶cn2GIA云服务器低至19元/月起;香港安畅cn2云服务器低至19元/月起;日本cn2云主机低至35元/月起!青云互联是一家成立于2020年的主机服务商,致力于为用户提供高性价比稳定快速的主机托管服务。青云互联本站之前已经更新过很多相关文章介绍了,青云互联的机房有香港和洛杉矶,都有CN2 GIA线路、洛杉矶带高防,商家承诺试用7天,打死全额退款点击进入:青云互联...

BeerVM1GB内存/VDSps端口1GB,350元/月

beervm是一家国人商家,主要提供国内KVM VPS,有河南移动、广州移动等。现在预售湖南长沙联通vds,性价比高。湖南长沙vps(长沙vds),1GB内存/7GB SSD空间/10TB流量/1Gbps端口/独立IP/KVM,350元/月,有需要的可以关注一下。Beervm长沙联通vps套餐:长沙联通1G青春版(预售)长沙联通3G标准版(预售)长沙联通3G(预售)vCPU:1vCPU:2vCPU...

VPS云服务器GT线路,KVM虚vps消息CloudCone美国洛杉矶便宜年付VPS云服务器补货14美元/年

近日CloudCone发布了最新的补货消息,针对此前新年闪购年付便宜VPS云服务器计划方案进行了少量补货,KVM虚拟架构,美国洛杉矶CN2 GT线路,1Gbps带宽,最低3TB流量,仅需14美元/年,有需要国外便宜美国洛杉矶VPS云服务器的朋友可以尝试一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务器...

chrome 18为你推荐
桌面背景图片下载在哪里可以下载桌面背景图片唐人社美国10次啦我看到罗显琪第一眼就喜欢他了!当中我们一共见过10次面,也发生过两次关系! 但是他有女朋友对我也只是一时兴起吧,所以第十次见面之后,我们再没有联系,但是现在我大姨妈晚了很多天了,我担心是否怀孕,如果有的话,我又不想打掉,该找他吗?麒麟820和980哪个好820和980哪个处理器好?985和211哪个好985和211哪个强?具体分析点。传奇类手游哪个好什么传奇手游还不错的 不烧钱 比较耐玩点手机杀毒软件哪个好手机安全杀毒软件哪个比较好些?英语词典哪个好英语词典哪个好电陶炉和电磁炉哪个好电磁炉和电陶炉买哪个?红茶和绿茶哪个好红茶好还是绿茶好?dns服务器设置DNS服务器建立的详细步骤?
cn域名备案 美国主机排名 openv 老鹰主机 siteground 警告本网站 发包服务器 服务器维护方案 idc资讯 php空间推荐 百度云1t 个人免费邮箱 wordpress中文主题 域名转入 免费网络空间 服务器托管价格 镇江高防服务器 windows2008 发证机构 更多