SRL Archive - SRL Archives

[FIXED] GameTab.scar "small (usefull!) tweak."


Timer

2008-06-03 22:32:41

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

function SetFightMode(oFightMode: Integer): Boolean;
var
i, x, y: Integer;
b: TBox;
Begin
if not(Loggedin)then Exit;
if (GetCurrentTab <> 1) then
begin
GameTab(1);
Wait(200 + Random(777));
end;
case oFightMode of
1: b := IntToBox(575, 255, 630, 290);
2: b := IntToBox(660, 255, 710, 290);
3: b := IntToBox(575, 310, 630, 345);
4: b := IntToBox(660, 310, 710, 345);
else Exit;
end;
while (i < 4) and (not FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2)) do
begin
Mouse(RandomRange(b.x1, b.x2), RandomRange(b.y1, b.y2), 0, 0, True);
Wait(200 + Random(300));
Inc(i);
end;
Result := FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2);
end;

To…

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

function SetFightMode(oFightMode: Integer): Boolean;
var
i, x, y: Integer;
b: TBox;
Begin
if not(Loggedin)then Exit;
if (GetCurrentTab <> 1) then
begin
GameTab(1);
Wait(200 + Random(777));
end;
case oFightMode of
1: b := IntToBox(575, 255, 630, 290);
2: b := IntToBox(660, 255, 710, 290);
3: b := IntToBox(575, 310, 630, 345);
4: b := IntToBox(660, 310, 710, 345);
else Exit;
end;
while (i < 4) and (not FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2)) do
begin
Mouse(RandomRange(b.x1, b.x2), RandomRange(b.y1, b.y2), 0, 0, True);
Wait(200 + Random(300));
Inc(i);
end;
Result := FindColorTolerance(x, y, 1777020, b.x1, b.y1, b.x2, b.y2, 2);
if (not Result) and (oFightMode = 4) then
SetFightMode(3);
end;

Notice…

  if (not Result) and (oFightMode = 4) then
SetFightMode(3);

For those annoying fight mode 4 which is defense, which is tab 3, it does it.

itSchRis917

2008-06-03 23:11:57

Confuzzled.. What exactly did you change?

FreakyMonkey

2008-06-04 00:27:03

From: itschris917
Confuzzled.. What exactly did you change?


Same, what exactly are you changing?

nielsie95

2008-06-04 01:46:03

And why didn't you use my cool looking standards?

Timer

2008-06-04 07:09:38

Lol, i didn't change any thing… I added…

Look at the bottom of the function…

Your cool looking standards, better now?

Naike

2008-06-04 10:24:53

I get it ;) Usefull little tweak! Should be changed

n3ss3s

2008-06-04 10:57:38

Done.