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/

美得云(15元/月)美国cera 2核4G 15元/月 香港1核 1G 3M独享

美得云怎么样?美得云好不好?美得云是第一次来推广软文,老板人脾气特别好,能感觉出来会用心对待用户。美得云这次为大家提供了几款性价比十分高的产品,美国cera 2核4G 15元/月 香港1核 1G 3M独享 15元/月,并且还提供了免费空间给大家使用。嘻嘻 我也打算去白嫖一个空间了。新用户注册福利-8折优惠码:H2dmBKbF 截止2021.10.1结束。KVM架构,99.99%高可用性,依托BGP...

pacificrack:超级秒杀,VPS低至$7.2/年,美国洛杉矶VPS,1Gbps带宽

pacificrack又追加了3款特价便宜vps搞促销,而且是直接7折优惠(一次性),低至年付7.2美元。这是本月第3波便宜vps了。熟悉pacificrack的知道机房是QN的洛杉矶,接入1Gbps带宽,KVM虚拟,纯SSD RAID10,自带一个IPv4。官方网站:https://pacificrack.com支持PayPal、支付宝等方式付款7折秒杀优惠码:R3UWUYF01T内存CPUSS...

CloudCone($82/月)15-100M不限流量,洛杉矶CN2 GIA线路服务器

之前分享过很多次CloudCone的信息,主要是VPS主机,其实商家也提供独立服务器租用,同样在洛杉矶MC机房,分为两种线路:普通优化线路及CN2 GIA,今天来分享下商家的CN2 GIA线路独立服务器产品,提供15-100Mbps带宽,不限制流量,可购买额外的DDoS高防IP,最低每月82美元起,支持使用PayPal或者支付宝等付款方式。下面分享几款洛杉矶CN2 GIA线路独立服务器配置信息。配...

chrome 18为你推荐
火影忍者644火影忍者动画644对应漫画是多少集电脑管家和360哪个好腾讯电脑管家和360安全卫士哪个更好燃气热水器和电热水器哪个好燃气热水器与电热水器的优缺点?帕萨特和迈腾哪个好迈腾与帕萨特那个好?轿车和suv哪个好轿车和SUV 的驾驶视野,那个比较好!!核芯显卡与独立显卡哪个好独立显卡和核心显卡哪个好电陶炉和电磁炉哪个好电陶炉和电磁炉哪个好行车记录仪哪个好行车记录仪哪种好用?清理手机垃圾软件哪个好手机垃圾清理软件哪个好51个人空间登录我在电脑上用的是Q号登录51个人空间,在手机上怎么却不能用Q号登录51个人空间了
asp网站空间 域名是什么 域名查询软件 西部数码vps kdata win8升级win10正式版 国外免费空间 服务器架设 193邮箱 web服务器的架设 169邮箱 卡巴斯基免费试用 google台湾 双线空间 杭州电信宽带优惠 存储服务器 umax rewritecond cx域名 linux服务器系统 更多