SRL Archive - SRL Bugs

Magic.scar possible Misclicks/False positives


NCDS

2010-06-20 19:35:32

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.

{*******************************************************************************
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:

{*******************************************************************************
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.

Coh3n

2010-06-20 20:21:28

Thanks, committed. :)

Frement

2010-06-20 20:50:23

I'm sure the color is not white if it the game tab isnt magic?

NCDS

2010-06-20 21:07:30

From: Frement
I'm sure the color is not white if it the game tab isnt magic?


But why take the chance?