Auto-hotkey flight 9, macro creation using image search (Image Search)

Today, we are going to learn about ImageSearch commands that can be used in various places by searching for images. (* I will have time to learn about auto-hot keys through the auto-hotkey lecture of the business automation MAX All-in-One package on Fast Campus.)Today, we are going to learn about ImageSearch commands that can be used in various places by searching for images. (* I will have time to learn about auto-hot keys through the auto-hotkey lecture of the business automation MAX All-in-One package on Fast Campus.)ImageSearch, option valuesYou must first download the image file before you begin. For practical training, let’s bring the download image of the official site of the auto hot key as follows. The image should be named “9” and saved in PNG format.Then enter the following command. If you look at the options for the ImageSearch command.OutputVarX: Variable name for obtaining X coordinate value OutputVarY: Variable name for obtaining Y coordinate value X1: The starting point of the X coordinate for obtaining the image.Y1: The starting point of the Y-coordinate to find the image.X2: The end point of the X-coordinate to find the image.Y2: The end point of the Y-coordinate to find the image.ImageFile— The name of the image file.#single instance, ForceF4::exit application!1::;ImageSearch, pX, pY, 0, 0, 1280, 720, *0 image\9.png; 완벽히 일치한 이미지;ImageSearch, pX、 pY, 0、 0、 0、 1280、 720、 *30 9.png ; 권장 일치율 30 ~ 50MsgBox、 %X “/py” returnAnd the number that follows the star (*) is the image matching rate. Keep in mind that the closer you are to zero, the more exactly you have to match the image, and the closer you are to 255, the more you follow the command, even if it is different from the image. In other words, the closer you are to zero, the more strict you are, and the closer you are to 255, the more generous you are. Use the MsgBox command to display the X and Y coordinates in front and back relative to “/”.If “/” is displayed, first check the location of the file. For example, you might want to place the path of an image file under a folder called image, but you might want to use another location as a path. If you put it together in the location where the corresponding auto-hotkey file runs like me, it will be recognized well even if you write only the file name without referring to the folder separately. If you still can’t get the coordinate value, it might be because of the X and Y coordinate range to track. The default value is to use it at times like this.%A_ScreenWidth%—Automatically calculates and returns the width value of my monitor specification.%A_Screen Height% —Automatically calculates and returns the height value of my monitor specification.!2::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, %pX “/” pYreturn!2::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, %pX “/” pYreturnThis is the combination of ImageSearch and ClickThis time, let’s use the X and Y values of the image coordinates we found to create a macro to click on. First, get the X and Y coordinate values as they are with the ImageSearch command. Then, you can click on the image by substituting X and Y coordinates within %a% and %b% respectively after the Click command. However, by adding 30 more, the mouse clicks on the image (but if the values are X and Y, the boundaries are clicked and there is no response)!3::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pnga:= pX + 30b:= pY + 30Click, %a% %b%return!3::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pnga:= pX + 30b:= pY + 30Click, %a% %b%returnError levelUsing the ErrorLevel option, you can easily determine the situation based on the result values of 0, 1, and 2, respectively.!4::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, % ErrorLevel image missing return!4::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, % ErrorLevel image missing returnPrevious image Next imageNext time, I would like to study ImageSearch in conjunction with functions. Here’s the source code I learned today# Single instance, ForceF4::; Image Search, 0, 0, 0, 0, 0, 00, 0x; 0x; 0x0x0.x\0.x\; 완벽히 일치한 이미지;ImageSearch, pX , pY , , 0 , 0 , 0 , 1280 , 720 , *30 9.png ; 권장 일치율 30 ~ 50MsgBox , %X / py2 を返します::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309 です.PNGMsgBox, % pX “/” pYreturn!3::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pnga:= pX + 30b:= pY + + 30Click, %a%%b%return!4::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, %ErrorLevel 이미지를 찾음 이미지를 찾지 못함 이미지 파일이It’s a secret urn#Single instance, ForceF4::Exit the app!1::;ImageSearch, pX, pY, 0, 0, 1280, 720, *0 image\9.png ; 완벽히 일치한 이미지;ImageSearch, pX , pY , 0 , 0 , 0 , 1280 , 720 , *30 9.png ; 권장 일치율 30 ~ 50MsgBox , %X / py2 を返します::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309 です.PNGMsgBox, % pX “/” pYreturn!3::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pnga:= pX + 30b:= pY + 30Click, %a%%b%return!4::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, %ErrorLevel 이미지를 찾음 이미지를 찾지 못함 이미지 파일이 음없It’s a return#Single instance, ForceF4::Exit the app!1::;ImageSearch, pX, pY, 0, 0, 1280, 720, *0 image\9.png ; 완벽히 일치한 이미지;ImageSearch, pX , pY , 0 , 0 , 0 , 1280 , 720 , *30 9.png ; 권장 일치율 30 ~ 50MsgBox , %X / py2 を返します::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309 です.PNGMsgBox, % pX “/” pYreturn!3::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pnga:= pX + 30b:= pY + 30Click, %a%%b%return!4::ImageSearch, pX, pY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *309.pngMsgBox, %ErrorLevel 이미지를 찾음 이미지를 찾지 못함 이미지 파일이 음없It’s a return

error: Content is protected !!