Auto hotkey ImageSearch + send key

Ask gaming related questions (AHK v1.1 and older)
Inferno1337
Posts: 1
Joined: 27 Mar 2020, 11:55

Auto hotkey ImageSearch + send key

27 Mar 2020, 12:04

Hello, I started coding today and i wanted to make an auto mine script for a game, you need to press left mouse button, then click the 3 random keys. Well thats what i came up. Oh yeah and also the script after pressing one of the searched buttons needs to press one of 3 others, and then 2 more so(https://i.imgur.com/N2jtJ8S.png). I want to make it work so. Any advices? My friend said that i should use Optical character recognition because the pictures may not be 100% recognized. But i don't know how to set it up.

Code: Select all

CoordMode, Pixel, Screen
Pause


Loop
{
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\K.PNG
if !ErrorLevel
{
   Send, {K}
   Sleep, 200
}
{
   ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\Z.PNG
if !ErrorLevel
{
   Send, {Z}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\X.PNG
if !ErrorLevel
{
   Send, {X}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\H.PNG
if !ErrorLevel
{
   Send, {H}
   Sleep, 200
}
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\R.PNG
if !ErrorLevel
{
   Send, {R}
   Sleep, 200
}
{
   ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\Z.PNG
if !ErrorLevel
{
   Send, {Z}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\X.PNG
if !ErrorLevel
{
   Send, {X}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\H.PNG
if !ErrorLevel
{
   Send, {H}
   Sleep, 200
}
}

ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\M.PNG
if !ErrorLevel
{
   Send, {M}
   Sleep, 200
}
{
   ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\Z.PNG
if !ErrorLevel
{
   Send, {Z}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\X.PNG
if !ErrorLevel
{
   Send, {X}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\H.PNG
if !ErrorLevel
{
   Send, {H}
   Sleep, 200
}
}

ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\G.PNG
if !ErrorLevel
{
   Send, {G}
   Sleep, 200
}
{  
   ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\Z.PNG
if !ErrorLevel
{
   Send, {Z}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\X.PNG
if !ErrorLevel
{
   Send, {X}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\H.PNG
if !ErrorLevel
{
   Send, {H}
   Sleep, 200

}
}
{
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\9.PNG
if !ErrorLevel
{
   Send, {9}
   Sleep, 200
}
   ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\Z.PNG
if !ErrorLevel
{
   Send, {Z}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\X.PNG
if !ErrorLevel
{
   Send, {X}
   Sleep, 200
}
ImageSearch, FoundX, FoundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, *20 C:\Users\INFERNO\Desktop\gurnik bot\H.PNG
if !ErrorLevel
{
   Send, {H}
   Sleep, 200
}
}




}



return



Esc::ExitApp
Home::Pause
[Mod edit: [code][/code] tags added and image link fixed.]

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 94 guests