I guess I kind of know what a failsafe is, but I'm not sure how to put it into a script. For example, if I want to make it so that if there isn't a color, to end the script, I would put:
SCAR Code:
program Red;
{.include SRL/SRL.scar}
var
x, y: Integer;
procedure FindRed;
begin
if FindColor(x, y, 255, 0, 0, 1027, 775) then
WriteLn('Red found at ('+IntToStr(x)+', '+IntToStr(y)+').');
MMouse(x, y);
ClickMouse(x, y);
end;
begin
ClearDebug;
SetupSRL;
FindRed;
end.
...But how do I add a failsafe option of ending the script if SCAR doesn't find color 255? Also, if I could add an option to
SCAR Code:
WriteLn('Red not found. Terminating.');
then could I?