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/

ZJI:520元/月香港服务器-2*E5-2630L/32GB/480G SSD/30M带宽/2IP

ZJI发布了一款7月份特别促销独立服务器:香港邦联四型,提供65折优惠码,限量30台(每用户限购1台),优惠后每月520元起。ZJI是原来Wordpress圈知名主机商家:维翔主机,成立于2011年,2018年9月启用新域名ZJI,提供中国香港、台湾、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册等业务。下面列出这款服务器的配置信息。香港邦联四型CPU:2*E5-2...

阿里云金秋上云季,云服务器秒杀2C2G5M年付60元起

阿里云(aliyun)在这个月又推出了一个金秋上云季活动,到9月30日前,每天两场秒杀活动,包括轻量应用服务器、云服务器、云数据库、短信包、存储包、CDN流量包等等产品,其中Aliyun轻量云服务器最低60元/年起,还可以99元续费3次!活动针对新用户和没有购买过他们的产品的老用户均可参与,每人限购1件。关于阿里云不用多说了,国内首屈一指的云服务器商家,无论建站还是学习都是相当靠谱的。活动地址:h...

ReadyDedis:VPS全场5折,1G内存套餐月付2美元起,8个机房可选_服务器安装svn

ReadyDedis是一家2018年成立的国外VPS商家,由印度人开设,主要提供VPS和独立服务器租用等,可选数据中心包括美国洛杉矶、西雅图、亚特兰大、纽约、拉斯维加斯、杰克逊维尔、印度和德国等。目前,商家针对全部VPS主机提供新年5折优惠码,优惠后最低套餐1GB内存每月仅需2美元起,所有VPS均为1Gbps端口不限流量方式。下面列出几款主机配置信息。CPU:1core内存:1GB硬盘:25GB ...

chrome 18为你推荐
滴滴软银合资最适合跑滴滴的是什么车?10万一下的车?316不锈钢和304哪个好保温杯买304不锈钢的好,还是316不锈钢的好?少儿英语哪个好少儿英语哪套教材好哪里好呢?朗逸和速腾哪个好朗逸跟速腾的最大区别在哪朗逸跟速腾买那个好电视直播软件哪个好目前最好的电视直播软件是什么?录音软件哪个好录音软件哪个好用又简单绝地求生加速器哪个好绝地求生的加速器哪个好用?手机管家哪个好有哪些人下了手机管家,最好的是哪个?手机管家哪个好手机管家和腾讯手机管家哪个好用手机杀毒哪个好手机杀毒软件哪个好
qq云存储 企业主机 openv t楼 rackspace 56折 68.168.16.150 标准机柜尺寸 浙江独立 java虚拟主机 777te 阿里云浏览器 七夕快乐英文 谁的qq空间最好看 稳定免费空间 天翼云盘 彩虹云 视频服务器是什么 游戏服务器出租 学生服务器 更多