Cazax
2008-03-14 17:43:24
Just a little observation:
in fighting,scar, there is a function called 'FightNPC':
It could be more easier to change, 'Color1, Color2, Color3, Color4, Color,5, Color6 : Integer;' to 'Colors : TIntegerArray' something like:
To:
Just a little thing.
in fighting,scar, there is a function called 'FightNPC':
{*******************************************************************************
function FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut: Integer): Boolean;
By: WT-Fakawi
Description: Fights NPC. Inputs 6 NPC Colors. (May be the same colors),
tol = tolerance, TimeOut = amount of time before clicking on next NPC
*******************************************************************************}It could be more easier to change, 'Color1, Color2, Color3, Color4, Color,5, Color6 : Integer;' to 'Colors : TIntegerArray' something like:
function FightNPC(Color1, Color2, Color3, Color4, Color5, Color6, tol, TimeOut:
Integer): Boolean;
var
Mark, x, y, I, Color: Integer;
begin
for I := 1 to 6 do
begin
case I of
1: Color := Color1;
2: Color := Color2;
3: Color := Color3;
4: Color := Color4;
5: Color := Color5;
6: Color := Color6;
end;
if (LoggedIn) then
begin
if (FindObj(x, y, 'ttack', Color, tol)) then
begin
Result := True;
GetMousePos(x, y);
if (not (LoggedIn) or (FindDead)) then Break;
Mouse(x, y, 0, 0, True);
if (not (LoggedIn) or (FindDead)) then Break;
Wait(2000);
FFlag(10);
MarkTime(Mark);
repeat
if (not (LoggedIn) or (FindDead)) then Break;
Wait(1000 + Random(500));
FindNormalRandoms;
if (TimeFromMark(Mark) > TimeOut) then Break;
until ((not (FindColorSpiral(x, y, 65280, 240, 140, 290, 175))
or (FindDead)));
end
else
Result := False;
end
end
end;To:
function FightNPC(Colors : TIntegerArray, tol, TimeOut:
Integer): Boolean;
var
Mark, x, y, I, Color: Integer;
begin
if (LoggedIn) then
begin
for i:=0 to High(Colors) do
begin
if (FindObjCustom(x, y, ['ttack'], Colors, tol)) then
end;
begin
Result := True;
GetMousePos(x, y);
if (not (LoggedIn) or (FindDead)) then Break;
Mouse(x, y, 0, 0, True);
if (not (LoggedIn) or (FindDead)) then Break;
Wait(2000);
FFlag(10);
MarkTime(Mark);
repeat
if (not (LoggedIn) or (FindDead)) then Break;
Wait(1000 + Random(500));
FindNormalRandoms;
if (TimeFromMark(Mark) > TimeOut) then Break;
until ((not (FindColorSpiral(x, y, 65280, 240, 140, 290, 175))
or (FindDead)));
end
else
Result := False;
end
end
end;Just a little thing.