Rich
2009-09-02 18:53:39
Self-explanatory. Another 8 functions from me.
No time for typing…Must fix SRL :p
Richard.
{*******************************************************************************
function IsLoginStill : Boolean;
By: R1ch
Description: Returns true if the login page is still
*******************************************************************************}
function IsLoginStill : Boolean;
begin
if LoggedIn then Exit;
Result:= GetColor(16, 487) = 2302956;
end;
{*******************************************************************************
function MakeLoginStill(Still : Boolean) : Boolean;
By: R1ch
Description: Makes login page still, depending on Still
*******************************************************************************}
function MakeLoginStill(Still : Boolean) : Boolean;
begin
if LoggedIn then Exit;
if not (IsLoginStill xor Still) then
Mouse(16, 487, 7, 7, True);
Result:= True;
end;
{*******************************************************************************
function GetCastStance : Boolean;
By: R1ch
Description: Returns true if cast stance is defensive.
*******************************************************************************}
function GetCastStance : Boolean;
begin
GameTab(tab_Magic);
Result:= GetColor(562, 441) = 16777215;
end;
{*******************************************************************************
function MakeCastStance(Defensive : Boolean) : Boolean;
By: R1ch
Description: Makes cast stance defensive or regular, depending on Defensive
*******************************************************************************}
function MakeCastStance(Defensive : Boolean) : Boolean;
begin
GameTab(tab_Magic);
if not (GetCastStance xor Defensive) then
Mouse(562, 450, 7, 7, True);
Result:= True;
end;
{*******************************************************************************
function HiddenSpells : TBooleanArray;
By: R1ch
Description: Returns spells which are hidden in the spell book in a TBA
0 = Combat 1 = Tele 2 = Misc 3 = Skill
*******************************************************************************}
function HiddenSpells : TBooleanArray;
var
I : Byte;
begin
GameTab(tab_Magic);
for I:= 0 to 3 do
Result[i]:= GetColor(592 + (I * 22), 441) = 16777215;
end;
{*******************************************************************************
function HideSpells(Combat, Tele, Misc, Skill : Boolean) : Boolean;
By: R1ch
Description: Makes cast stance defensive or regular, depending on Defensive
*******************************************************************************}
function HideSpells(Spells : TBooleanArray) : Boolean;
var
I : Byte;
begin
if High(Spells) > 3 then
begin
SRL_Warn('HideSpells', 'Only 4 parameter in Spells to be used', warn_AllVersions);
Exit;
end;
GameTab(tab_Magic);
for I:= 0 to 3 do
if not (HiddenSpells[i] xor Spells[i]) then
Mouse(592 + (I * 22), 450, 7, 7, True);
Result:= True;
end;
{*******************************************************************************
function GetMagicSortBy : Integer;
By: R1ch
Description: Gets the current way the magic spells are sorted by
0 = Level 1 = Combat 2 = Teleport
*******************************************************************************}
function GetMagicSortBy : Integer;
var
I : Byte;
begin
GameTab(tab_Magic);
for I:= 0 to 2 do
if GetColor(658 + (22 * I), 441) = 16777215 then
Result:= I;
end;
{*******************************************************************************
function MakeMagicSortBy(Sort : Integer) : Boolean;
By: R1ch
Description: Changes the way the magic spells are sorted by
0 = Level 1 = Combat 2 = Teleport
*******************************************************************************}
function MakeMagicSortBy(Sort : Integer) : Boolean;
var
I : Byte;
begin
if Sort > 2 then
begin
SRL_Warn('MakeMagicSort', '0..2 for Sort : Integer', warn_AllVersions);
Exit;
end;
GameTab(tab_Magic);
I:= GetMagicSortBy;
if not (I = Sort) then
Mouse(658 + (22 * Sort), 450, 7, 7);
Result:= True;
end;No time for typing…Must fix SRL :p
Richard.