so after a longer time I've returned with a question. Of course it's easy to solve for the real professionals here, but for me it's too tricky :&
Here is my code:
Code: Select all
player:target_NPC("Drillmaster");
yrest(500)
sendMacro("ChoiceOption(2);");
repeat
yrest(100)
until player:findNearestNameOrId("Destiny Box")
local time = os.time()
while ((5 * 60 * 1000) > os.time() - time) do
local target = player:findNearestNameOrId("Destiny Box");
if (target) then
teleport(target.X, target.Z)
player:target_Object("Destiny Box")
while(target.Name == "Destiny Box") do
yrest(100)
target:update()
end
end
player:clearTarget();
player:update();
local targetenemy = player:findNearestNameOrId("Obstructor of Fate");
if (targetenemy) then
if (targetenemy.Name == "Obstructor of Fate") then
local XX = player.X;
local ZZ = player.Z;
local targethelper = player:findNearestNameOrId("Drill Ground Guardian");
repeat
targethelper.update();
player:moveTo(CWaypoint(targethelper.X, targethelper.Z, targethelper.Y),true)
until 30 > (math.abs(targethelper.X - player.X) + math.abs(targethelper.Z - player.Z))
player:moveTo(CWaypoint(targethelper.X+10, targethelper.Z-10, targethelper.Y),true)
player:moveTo(CWaypoint(targethelper.X-10, targethelper.Z+10, targethelper.Y),true)
yrest(750)
teleport(XX, ZZ)
targetenemy:update();
end
end
player:clearTarget();
end
Find a Destiny Box wich spawns in groups of 2 up to 9, pick the closest and open it. After it is open it shall proceed to the next box until all boxes are open.
Once all are open or player found a badge the boxes vanish and new boxes spawn.
From time to time there is a chance that a Obstructor of Fate spawns. The player has to run to the Drill Ground Guardian t get rid of the mob. But the mob does not always follow, but fall into pices in place or fight the Guard. No idea how to check if the mob is hitting the bot.
So any idea how i can make the bot recognize that a box is open and go to the next one?
Br,
nuker