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.