gm112
10-05-2006, 10:20 PM
Alright, made a function for fighting. Instead of clicking, it right clicks the monster then attacks. I'll soon add a Run feature.
function FightMonster(MonsterName: String; MColor,MColor2,MColor3: Integer; Tolerance: Integer): Boolean;
var Number, Color: Integer;
begin
for Number := 1 to 3 do
begin
case Number of
1: Color:= MColor1;
2: Color:= MColor2;
3: Color:= MColor3;
end;
if not InFight then
begin
FindObjFast(x,y,MonsterName,Color,Tolerance);
Mouse(x, y, 0, 0, False);
if not ChooseOption(x, y, 'Attack') then
ChooseOption(x, y, 'Cancel')
Wait(1000 + Random(5000));
end;
end;
end;
This may not be the best code out there but it works.
function FightMonster(MonsterName: String; MColor,MColor2,MColor3: Integer; Tolerance: Integer): Boolean;
var Number, Color: Integer;
begin
for Number := 1 to 3 do
begin
case Number of
1: Color:= MColor1;
2: Color:= MColor2;
3: Color:= MColor3;
end;
if not InFight then
begin
FindObjFast(x,y,MonsterName,Color,Tolerance);
Mouse(x, y, 0, 0, False);
if not ChooseOption(x, y, 'Attack') then
ChooseOption(x, y, 'Cancel')
Wait(1000 + Random(5000));
end;
end;
end;
This may not be the best code out there but it works.