ahh, so the checkpixel functions for isTerran(),isZerg(),isProtoss() were hardcoded and are not using the ranged checkPixelColor Function.. the ,10) below allows you to set a range to compensate for gamma variance. the comparison is done within the checkColor function.. Here are modified versions of the race check.. the ,10)) tells it to allow +/- 10 decimal for each R G or B component. you could dial this up and down if you wanted.
;------------------------------------------
isTerran(){
;------------------------------------------
if (checkPixelColor(0x36363f, 5, 317,10)){
return 1
} else {
return 0
}
}
;------------------------------------------
isZerg(){
;------------------------------------------
if (checkPixelColor(0x797979, 5, 317,10)){
return 1
} else {
return 0
}
}
;------------------------------------------
isProtoss(){
;------------------------------------------
if (checkPixelColor(0x3bbfa2, 5, 317,10)){
return 1
}else{
return 0
}
}
;------------------------------------------
countUnits(){
;------------------------------------------
xSrch:=169
ySrch:=398
XW:=36
YH:=37
pColor:=0x1459d4
;}
total:=0
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch:=169
YSrch+=YH
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
XSrch+=XW
if( checkPixelColor(pColor,XSrch,YSrch,10) ) {
total++
}
return total
}
We will want to make this change to all calls to pixelGetColor() and replace them with our custom Gamma adjusted checkPixelColor() function..
Also, keep in mind if you are needing to reset things manually when out of game.. that creating a pixel test for the lobby, and then activating any reset functions before going back into the game, works really well. And as an emergency backup you could create a hotkey to just reset the script while in game if things go nuts..
{YOUR_RESET_KEY}::
Reload
msgBox reloading
Return