@chancity: Rechecking with you why the code utilizes:
RandMove(Round($cellarCoordx[$c] * $x_ratio), Round($cellarCoordy[$c] * $y_ratio), 1, 1) ;moves cursor over to the cellar
in a cellar check?!
This means it will check all permutations of x = 599/600/601, y = 434/435/435 for the pixel. Are all 9 xy permutations guaranteed to be the pixel color? This is just for the first of 5 cellar pixel locations, and it does this for the next 4.
What I'm saying is, to be perfectly clear - please remove the RandMove. It makes no sense to randomly move the mouse to check for specific pixels!! The issue we have is missed cellar checks, and not 'false positives' so this no doubt exacerbates the issue. I think if you put this in to avoid Warden or something like that, I'm pretty sure it won't check for mouse 'moves' and only mouse 'clicks' so if anything just randomize within a few pixels of where it actually clicks on the cellar and don't put the randomization in the cellar check function eh
Also, here is a version of the findcellar code without the $c since stylistically you don't need the extra variable. $cellcoord = 0 by default and you just want the loop to run at max 5 times.
Code:
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(135)
If $gX > 0 Or $gY > 0 Then
Do
RandMove(Round($cellarCoordx[$CellCoord] * $x_ratio), Round($cellarCoordy[$CellCoord] * $y_ratio), 1, 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