Tog
11-30-2015, 10:57 AM
Hello, I have almost finished completed my first script!
Most of the major parts of the script are completed, but now I just want to make it a bit more polished :)
My current problem is that my bot tries to attack NPC's that are already fighting other players (This makes the bot obvious as all heck!) Is there a way to check if a NPC is in combat so I may avoid clicking that NPC?
Here is my current combat 'attacking' script (Code from the Reflection tutorial)
procedure AttackEnemy;
var
Guard: TReflectNpc;
Point: TPoint;
begin
if not isHealthy() then exit;
while not MyPlayer.IsUnderAttack do
begin
writeln('looking for Guard');
if Guard.Find('Guard') then
begin
writeln('Found guard! Clicking!');
Point := Guard.GetMsPoint;
Reflect.Mouse.Move(Point, 2, 2);
Reflect.Mouse.Click(MOUSE_LEFT);
wait(RandomRange(1000,2000));
While MyPlayer.IsMoving do
Wait(randomRange(300,600));
end;
end;
end;
Is what I'm asking possible? Would it be along the lines of using:
Guard.GetAnimation or Guard.GetCombatCycle?
Another method I've thought of would be to check the chatbox for 'that x is already under attack', but then how would I go about clicking a different guard? Is there a way to chose a particular guard to attack using Guard.Find('Guard')? Or is it just random?
Thanks for the help,
Tog.
Most of the major parts of the script are completed, but now I just want to make it a bit more polished :)
My current problem is that my bot tries to attack NPC's that are already fighting other players (This makes the bot obvious as all heck!) Is there a way to check if a NPC is in combat so I may avoid clicking that NPC?
Here is my current combat 'attacking' script (Code from the Reflection tutorial)
procedure AttackEnemy;
var
Guard: TReflectNpc;
Point: TPoint;
begin
if not isHealthy() then exit;
while not MyPlayer.IsUnderAttack do
begin
writeln('looking for Guard');
if Guard.Find('Guard') then
begin
writeln('Found guard! Clicking!');
Point := Guard.GetMsPoint;
Reflect.Mouse.Move(Point, 2, 2);
Reflect.Mouse.Click(MOUSE_LEFT);
wait(RandomRange(1000,2000));
While MyPlayer.IsMoving do
Wait(randomRange(300,600));
end;
end;
end;
Is what I'm asking possible? Would it be along the lines of using:
Guard.GetAnimation or Guard.GetCombatCycle?
Another method I've thought of would be to check the chatbox for 'that x is already under attack', but then how would I go about clicking a different guard? Is there a way to chose a particular guard to attack using Guard.Find('Guard')? Or is it just random?
Thanks for the help,
Tog.