Originally Posted by
Vqz
Found a solution to 1366x768 users.
in lawl.au3
replace this
Func FindCellar()
$CellCoord = 0
$gY = 0
$gX = 0
;A precheck to the cellar search
_ImageSearchArea($pngLoc & "Cellar.png", 1, Round(1672 * $x_ratio),Round(175 * $y_ratio),Round(1717 * $x_ratio),Round(209 * $y_ratio), $gX, $gY, 160)
sleep($cellarCheckSleep)
If $gX > 0 Or $gY > 0 then
Do
MouseMove(Round($cellarCoordx[$CellCoord] * $x_ratio), Round($cellarCoordy[$CellCoord] * $y_ratio), 1) ;moves cursor over to the cellar
sleep($cellarCheckSleep)
If $CellCoord < 6 then
$Pixel2 = PixelSearch($cellarCoordx[$CellCoord] - 71 * $x_ratio,$cellarCoordy[$CellCoord] - 148 * $y_ratio,$cellarCoordx[$CellCoord] + 139 * $x_ratio,$cellarCoordy[$CellCoord] + 22 * $y_ratio, 0x334FB7, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
Else
$Pixel2 = PixelSearch($cellarCoordx[$CellCoord] - 71 * $x_ratio,$cellarCoordy[$CellCoord] - 148 * $y_ratio,$cellarCoordx[$CellCoord] + 139 * $x_ratio,$cellarCoordy[$CellCoord] + 22 * $y_ratio, 0x007CB7F8, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
EndIf
If Not @Error Then
Return 1
EndIf
$CellCoord += 1
Until $CellCoord >= Ubound($cellarCoordx)
Else
Return 0
EndIf
$countMissedCellar += 1
Call("CellarScreenShot")
Return 0
EndFunc
With this
Func FindCellar()
$CellCoord = 0
$gX = 0
$gY = 0
;A precheck to the cellar search
_ImageSearchArea($pngLoc & "Cellar.png", 1, Round(1672 * $x_ratio),Round(175 * $y_ratio),Round(1717 * $x_ratio),Round(209 * $y_ratio), $gX, $gY, 160)
sleep($cellarCheckSleep)
If $gX > 0 Or $gY > 0 Then
Do
MouseMove(Round($cellarCoordx[$CellCoord] * $x_ratio), Round($cellarCoordy[$CellCoord] * $y_ratio), 1) ;moves cursor over to the cellar
$mousePos = MouseGetPos()
sleep($cellarCheckSleep)
If $CellCoord = 5 then
$Pixel2 = PixelSearch($mousePos[0] - 71 * $x_ratio,$mousePos[1] - 148 * $y_ratio,$mousePos[0] + 139 * $x_ratio,$mousePos[1] + 22 * $y_ratio, 0x007CB7F8, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
Else
$Pixel2 = PixelSearch($mousePos[0] - 71 * $x_ratio,$mousePos[1] - 148 * $y_ratio,$mousePos[0] + 139 * $x_ratio,$mousePos[1] + 22 * $y_ratio, 0x334FB7, 3) ;checks for open cellar (in a 600x400 box from the top left - where it should always be)
EndIf
If Not @Error Then
Return 1
EndIf
$CellCoord += 1
Until $CellCoord >= Ubound($cellarCoordx)
Else
Return 0
EndIf
Return 0
EndFunc