SRL Archive - SRL Archives

Combat Sytles.


NiCbaZ

2009-01-29 00:54:34

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.

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;

ZephyrsFury

2009-01-29 00:59:44

Does this do the same thing as your one?


{*******************************************************************************
function SetFightMode(oFightMode: Integer): Boolean;
By: Nielsie95 tweaked by Timer
Description: Sets fight mode. Returns false if failed to set desired mode.
*******************************************************************************}

NiCbaZ

2009-01-29 01:51:27

ahh i see that one now, yes basiclly it does, only differences there is , that there are more fail safes, and this is a little more user firendly as, some people might want to use

function ModeThere(z : integer): Boolean;

in there script to see what type of wep they have.