Just some unnecessary code in there as GameTab() already check to make sure it's not already on the tab before it clicks.
Old WearingItem:
SCAR Code:
{*******************************************************************************
function WearingItem(i: Integer): Boolean;
By: RsN
Description: Results True if an item is equipped at equpiment slot defined by I.
*******************************************************************************}
function WearingItem(I: Integer): Boolean;
var
X, Y: Integer;
TP: TPoint;
begin
if (not InRange(I, 1, 11)) then
begin
srl_Warn('WearingItem', 'Equipment slot #' + IntToStr(I) + ' is not a valid equipment slot', warn_Warning);
Exit;
end;
if (GetCurrentTab <> tab_Equip) then
begin
GameTab(tab_Equip);
if GetCurrentTab <> tab_Equip then exit;
Wait(750 + Random(500));
end;
TP := EquipmentCoords(I);
Result := FindColor(X, Y, srl_outline_black, TP.x - 8, TP.y - 8, TP.x + 8, TP.y + 8);
end;
My version:
SCAR Code:
{*******************************************************************************
function WearingItem(i: Integer): Boolean;
By: RsN
Description: Results True if an item is equipped at equpiment slot defined by I.
*******************************************************************************}
function WearingItem(I: Integer): Boolean;
var
X, Y: Integer;
TP: TPoint;
begin
if (not InRange(I, 1, 11)) then
begin
srl_Warn('WearingItem', 'Equipment slot #' + IntToStr(I) + ' is not a valid equipment slot', warn_Warning);
Exit;
end;
if GameTab(tab_Equip) then
begin
Wait(750 + Random(500));
TP := EquipmentCoords(I);
Result := FindColor(X, Y, srl_outline_black, TP.x - 8, TP.y - 8, TP.x + 8, TP.y + 8);
end;
end;
GetCurrentTab is also broken but I'm working on that now..
Also, same thing with Retaliate:
Old one:
SCAR Code:
{*******************************************************************************
procedure Retaliate(RetTrue: Boolean);
By: WT-Fakawi & n3ss3s, slight mod by EvilChicken!
Description: Set's Auto Retaliate ON of OFF.
*******************************************************************************}
procedure Retaliate(RetTrue: Boolean);
Var
X, Y: Integer;
Begin
if (GetCurrentTab <> tab_Combat) then
begin
GameTab(tab_Combat);
Wait(500 + Random(500));
end;
if (RetTrue) xor FindColorTolerance(X, Y, 1777019, 624, 385, 719, 396, 2) then
MouseBox(624, 385, 719, 396, 1);
End;
New one
SCAR Code:
{*******************************************************************************
procedure Retaliate(RetTrue: Boolean);
By: WT-Fakawi & n3ss3s, slight mod by EvilChicken!
Description: Set's Auto Retaliate ON of OFF.
*******************************************************************************}
procedure Retaliate(RetTrue: Boolean);
Var
X, Y: Integer;
Begin
if GameTab(tab_Combat) then
begin
Wait(500 + Random(500));
if (RetTrue) xor FindColorTolerance(X, Y, 1777019, 624, 385, 719, 396, 2) then
MouseBox(624, 385, 719, 396, 1);
end;
End;