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/

快云科技,免云服务器75折优惠服务器快云21元/月

近日快云科技发布了最新的夏季优惠促销活动,主要针对旗下的香港CN2 GIA系列的VPS云服务器产品推送的最新的75折优惠码,国内回程三网CN2 GIA,平均延迟50ms以下,硬件配置方面采用E5 2696v2、E5 2696V4 铂金Platinum等,基于KVM虚拟架构,采用SSD硬盘存储,RAID10阵列保障数据安全,有需要香港免备案CN2服务器的朋友可以关注一下。快云科技怎么样?快云科技好不...

乌云数据(10/月),香港cera 1核1G 10M带宽/美国cera 8核8G10M

乌云数据主营高性价比国内外云服务器,物理机,本着机器为主服务为辅的运营理念,将客户的体验放在第一位,提供性价比最高的云服务器,帮助各位站长上云,同时我们深知新人站长的不易,特此提供永久免费虚拟主机,已提供两年之久,帮助了上万名站长从零上云官网:https://wuvps.cn迎国庆豪礼一多款机型史上最低价,续费不加价 尽在wuvps.cn香港cera机房,香港沙田机房,超低延迟CN2线路地区CPU...

CYUN(29元/月)美国、香港、台湾、日本、韩国CN2,续费原价

关于CYUN商家在之前有介绍过一次,CYUN是香港蓝米数据有限公司旗下的云计算服务品牌,和蓝米云、蓝米主机等同属该公司。商家主要是为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。目前,CYUN主要运营美国、香港、台湾、日本、韩国CN2线路产品,包括云服务器、站群服务器和独立服务器等。这次看到CYUN夏季优惠活动发布了,依然是熟悉的...

chrome 18为你推荐
集成显卡和独立显卡哪个好独立显卡和集成显卡区别??轿车和suv哪个好同价位的轿车和suv哪个更好?电视直播软件哪个好电视直播软件安卓tv版哪个好用浮动利率和固定利率哪个好对于企业来说固定利率贷款与浮动利率贷款优缺点各是什么?谢谢了。核芯显卡与独立显卡哪个好核芯显卡与独立显卡哪个好qq空间登录不了为什么我的QQ登陆不了QQ空间电信dns服务器地址广西电信应该填什么DNS服务器地址?360云网盘下载360云盘与百度云盘的对比360云盘资源谁有360云盘账号和密码啊?告诉我下呗,决不删东西!男生都懂的那种……谢谢了!360云盘企业版怎么把360云盘文件导入360企业云盘
仿牌空间 国外php主机 68.168.16.150 申请空间 最好看的qq空间 上海域名 linux空间 可外链网盘 天翼云盘 多线空间 申请免费空间和域名 香港亚马逊 dnspod 东莞服务器托管 php服务器 摩尔庄园注册 广东主机托管 石家庄服务器 中美互联网论坛 nano 更多