|
@@ -20,14 +20,14 @@ Run, %ApplicationPath%, %ApplicationDir%
|
|
FindImg(Image, ByRef X, ByRef Y, MaxTries)
|
|
FindImg(Image, ByRef X, ByRef Y, MaxTries)
|
|
{
|
|
{
|
|
global ImgDir
|
|
global ImgDir
|
|
- WinGetPos, _, _, WindowWidth, WindowHeight
|
|
|
|
loop {
|
|
loop {
|
|
Sleep, 1000
|
|
Sleep, 1000
|
|
file := ImgDir "\" Image
|
|
file := ImgDir "\" Image
|
|
|
|
+ WinGetPos, WinX, WinY, WindowWidth, WindowHeight, A
|
|
ImageSearch, X, Y, 0, 0, %WindowWidth%, %WindowHeight%, *5 %file%
|
|
ImageSearch, X, Y, 0, 0, %WindowWidth%, %WindowHeight%, *5 %file%
|
|
ifEqual, ErrorLevel, 2
|
|
ifEqual, ErrorLevel, 2
|
|
{
|
|
{
|
|
- log("Could not conduct the search for " file 0 0 WindowWidth WindowHeight)
|
|
|
|
|
|
+ log("Could not conduct the search for " file)
|
|
return False
|
|
return False
|
|
} else ifEqual, ErrorLevel, 1
|
|
} else ifEqual, ErrorLevel, 1
|
|
{
|
|
{
|
|
@@ -44,6 +44,7 @@ FindImg(Image, ByRef X, ByRef Y, MaxTries)
|
|
}
|
|
}
|
|
|
|
|
|
; Main Program
|
|
; Main Program
|
|
|
|
+log("waiting for Kolja-Strohm Games Patcher")
|
|
If (not WinWaitActive Kolja-Strohm Games Patcher,,30)
|
|
If (not WinWaitActive Kolja-Strohm Games Patcher,,30)
|
|
{
|
|
{
|
|
log("Kolja-Strohm Games Patcher is not active after 30 seconds")
|
|
log("Kolja-Strohm Games Patcher is not active after 30 seconds")
|
|
@@ -51,9 +52,12 @@ If (not WinWaitActive Kolja-Strohm Games Patcher,,30)
|
|
}
|
|
}
|
|
|
|
|
|
Sleep, 1000
|
|
Sleep, 1000
|
|
|
|
+log("searching for play button")
|
|
if (FindImg("play.bmp", X, Y, 60))
|
|
if (FindImg("play.bmp", X, Y, 60))
|
|
{
|
|
{
|
|
log("Patching successful")
|
|
log("Patching successful")
|
|
|
|
+} else {
|
|
|
|
+ ErrorExit()
|
|
}
|
|
}
|
|
CleanUp()
|
|
CleanUp()
|
|
|
|
|