SCAR Code:
procedure extrasetup;
var temp : Integer;
begin
if(findcolortolerance(x,y,Colours[CurrentPlayer].begincolour,MSX1,MSY1,MSX2,MSY2,6)) then
begin
if(not InFightAt(x,y))then
begin
writeln('not in fight');
mmouse(x,y,2,2);
if(istextat2(9,9,'Attack ' + Colours[CurrentPlayer].monster,100))then
begin
writeln('found uptext');
Colours[CurrentPlayer].colour1 := getcolor(x,y);
Colours[CurrentPlayer].colour2 := getcolor(x + 5,y + 5);
temp := Colours[CurrentPlayer].colour1 - Colours[CurrentPlayer].colour2;
end;
end;
end;
if(not Colours[CurrentPlayer].colour1 = 0)then
begin
if(temp <= 2000000)then
begin
writeln('Colour 1: ' + inttostr(Colours[CurrentPlayer].colour1));
writeln('Colour 2: ' + inttostr(Colours[CurrentPlayer].colour2));
Players[Currentplayer].loc := 'Ready';
end;
end;
wait(random(1000));
end;
SCAR Code:
Function InFightAt(x, y: Integer):Boolean;
var
dx, dy: Integer;
begin
if ( FindColor(dx, dy, GreenStatusColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, RedStatusColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, MissedColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, HitColor, x - 20, y - 10, x + 20, y + 10) ) then
Result:=True;
end;