I have a loop with 2 pixelsearches. It crashes and then when Windows gives me the pop up that an error occured. When its there my machine plays a very weird sound when i click or move the mouse. Anyway, is it possible that if pixelsearches are using too many resources it will cause it to crash?
My script:
Code:
Hotkey, $Up, UpKey
Hotkey, $Down, DownKey
Hotkey, $Left, LeftKey
Hotkey, $Right, RightKey
Hotkey, $NumPadUp, NumPadUpKey
Hotkey, $NumPadDown, NumPadDownKey
Hotkey, $NumPadLeft, NumPadLeftKey
Hotkey, $NumPadRight, NumPadRightKey
return
Gosub, SeaRubySearch
SeaRubySearch: ; has a g-label so it can be "gone to" with 'gosub' later on
$Insert::
Loop
{
PixelSearch, XSeaColor, YSeaColor, 206, 166, 227, 188, 0xC77314, 0, Fast|RGB
SeaErrorLevel = %ErrorLevel%
If SeaErrorLevel = 0 ; color was found so preform next line
gosub, StopWalk
else
gosub, AllowWalk
PixelSearch, XRubyColor, YRubyColor, 206, 166, 227, 188, 0x0B078E, 0, Fast|RGB
if ErrorLevel = 0 ; color was found so preform next line
gosub, StopWalk
else
gosub, AllowWalk
}
return
StopWalk:
Hotkey, $Up, On
Hotkey, $Down, On
Hotkey, $Left, On
Hotkey, $Right, On
Hotkey, $NumPadUp, On
Hotkey, $NumPadDown, On
Hotkey, $NumPadLeft, On
Hotkey, $NumPadRight, On
gosub, SeaRubySearch
return
AllowWalk:
Hotkey, $Up, Off
Hotkey, $Down, Off
Hotkey, $Left, Off
Hotkey, $Right, Off
Hotkey, $NumPadUp, Off
Hotkey, $NumPadDown, Off
Hotkey, $NumPadLeft, Off
Hotkey, $NumPadRight, Off
gosub, SeaRubySearch
return
UpKey:
gosub, SeaRubySearch
return
DownKey:
gosub, SeaRubySearch
return
LeftKey:
gosub, SeaRubySearch
return
RightKey:
gosub, SeaRubySearch
return
NumPadUpKey:
gosub, SeaRubySearch
return
NumPadDownKey:
gosub, SeaRubySearch
return
NumPadLeftKey:
gosub, SeaRubySearch
return
NumPadRightKey:
gosub, SeaRubySearch
return
Thanks.