Magic.scar possible Misclicks/False positives
Neither of the following functions check to make sure that tab_Magic is selected. If the correct tab isn't selected then it will result in a misclick or a possible false positive.
SCAR Code:
{*******************************************************************************
Function DefCastIs: Boolean;
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Results if defensive casting is enabled.
*******************************************************************************}
function DefCastIs: Boolean;
begin
Result := (LoggedIn) and (GetColor(563, 441) = 16777215);
end;
{*******************************************************************************
procedure ToggleDefCast(SetTo: Boolean);
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Turns defensive casting on/off.
*******************************************************************************}
procedure ToggleDefCast(SetTo: Boolean);
begin
if DefCastIs = SetTo then
Exit;
Mouse(556, 443, 12, 14, True);
Wait(70+Random(70));
end;
Fix:
SCAR Code:
{*******************************************************************************
Function DefCastIs: Boolean;
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Results if defensive casting is enabled.
*******************************************************************************}
function DefCastIs: Boolean;
begin
if not Gametab(tab_Magic) then
Exit;
Result := (LoggedIn) and (GetColor(563, 441) = 16777215);
end;
{*******************************************************************************
procedure ToggleDefCast(SetTo: Boolean);
By: N1ke!
Rev: 39
Date: 12 Sep 09
Description: Turns defensive casting on/off.
*******************************************************************************}
procedure ToggleDefCast(SetTo: Boolean);
begin
if not Gametab(tab_Magic) then
Exit;
if DefCastIs = SetTo then
Exit;
Mouse(556, 443, 12, 14, True);
Wait(70+Random(70));
end;
Maybe I'm missing something, correct me if I'm wrong.