Im not sure if SRL allready has these. If it does they would probabbly be better then my function. Just posting this as its my first time making a Semi Include and making an Index of the Fight Modes with a TBox.
SCAR Code:
Function FightModeBox(i :Integer): TBox;
var
row, col: Integer;
begin
if not I > 0 then
Exit;
I:= I - 1;
row:= I mod 2;
col:= i div 2;
Result.x1 := 571 + (86 * Row);
Result.y1 := 252 + (54 * col);
Result.x2 := 628 + (86 * row);
Result.y2 := 288 + (54 * col);
end;
function CurrentFightMode: Integer;
var
T,I: Integer;
H: TBox;
TPA : TPointArray;
begin
T := GetCurrentTab;
if T <> 1 then
GameTab(1);
for i:= 1 to 3 do
begin
H := FightModeBox(I);
FindColorsTolerance(TPA,1908609, h.X1, h.Y1, h.X2, h.Y2 , 15);
if Length(TPA) > 8 then
begin
Result:= I;
Break;
end;
end;
end;
function ModeThere(z : integer): Boolean;
var
T: Integer;
H: TBox;
TPA : TPointArray;
begin
Result:= False;
T := GetCurrentTab;
if T <> 1 then
GameTab(1);
H := FightModeBox(z);
FindColorsTolerance(TPA,4343109, h.X1, h.Y1, h.X2, h.Y2 , 15);
if Length(TPA) > 8 then
Result:= True;
end;
Function FightMode(I : integer) : Boolean;
var
T: Integer;
H: TBox;
begin
T := GetCurrentTab;
if T <> 1 then
GameTab(1);
if CurrentFightMode = I then
Exit;
Result:= ModeThere(I);
if not Result then
Exit;
H := FightModeBox(I);
MouseBox(h.X1, h.Y1, h.X2, h.Y2,1);
end;