Skip to content

Instantly share code, notes, and snippets.

@fnx4
Last active April 3, 2021 20:05
Show Gist options
  • Select an option

  • Save fnx4/fa0cbb79a495c6894a402417c078befe to your computer and use it in GitHub Desktop.

Select an option

Save fnx4/fa0cbb79a495c6894a402417c078befe to your computer and use it in GitHub Desktop.
ocr to prmt
;CoordMode Mouse, Screen
tgtMonitor = 2
Search("p3.png", tgtMonitor)
Search(srcImg, tgtMonitor) {
SysGet, Mon, Monitor, %tgtMonitor%
ImageSearch, xi, yi, %MonLeft%, %MonTop%, %MonRight%, %MonBottom%, %A_WorkingDir%\%srcImg%
if (ErrorLevel = 2) {
MsgBox Could not conduct the search
} else if (ErrorLevel = 1) {
if (srcImg == "p3.png") {
Search("p2.png", tgtMonitor)
} else if (srcImg == "p2.png") {
Search("p1.png", tgtMonitor)
} else if (srcImg == "p1.png") {
MsgBox Not found
}
} else {
;MsgBox Icon %srcImg%: %xi%x%yi%
Click %xi%, %yi%, 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment