Problem attacking mobs
Posted: Sat Mar 17, 2012 8:46 am
Hello,
I wish to create a bot in which I stand at some waypoint. Mobs will spawn. I kill them, next wave of mobs spawn and I kill them again and so on, until the while-statement is ok.
But I'm having problems killing them to get their loot and thus can't complete the while-statement.
Waypoint looks like:
The while loop works, if I manually kill the mobs after gathering 4 items i move to next waypoint. But I can't seem to target the mobs.
Their names are "Demon Dragon Seal" and "Demon Dragon Prison Guard".
I tried adding in the if-statement, but when i reach that waypoint i get a compile error.
I Also tried this code:
But my character is just standing there, not attacking mobs, even though I have entered combat.
All ideas are welcome. ThQ.
I wish to create a bot in which I stand at some waypoint. Mobs will spawn. I kill them, next wave of mobs spawn and I kill them again and so on, until the while-statement is ok.
But I'm having problems killing them to get their loot and thus can't complete the while-statement.
Waypoint looks like:
Code: Select all
<!-- # 13 --><waypoint x="3565" z="4271" y="743">
target = player:getTarget();
if target ~= nil then
player:cast("ROGUE_SHADOWSTAB");
yrest(500);
player:cast("ROGUE_LOW_BLOW");
yrest(500);
end
while 4 > inventory:itemTotalCount(206138) do
yrest(500);
item:update(206138)
if item.ItemCount == 4 then
break
end
yrest(300);
end
yrest(1000);
</waypoint>Their names are "Demon Dragon Seal" and "Demon Dragon Prison Guard".
I tried adding
Code: Select all
if target.Name == "Demon Dragon Seal" || "Demon Dragon Prison Guard" then ... endI Also tried this code:
Code: Select all
<!-- # 13 --><waypoint x="3565" z="4271" y="743">
yrest(3000);
la = player:findNearestNameOrId(102738)
lb = player:findNearestNameOrId(102779)
if la then
player:target(la);
player:cast("ROGUE_SHADOWSTAB");
yrest(500);
player:cast("ROGUE_SHADOWSTAB");
yrest(500);
else if lb then
player:target(lb);
player:cast("KNIGHT_HOLY_STRIKE");
end
end
while 4 > inventory:itemTotalCount(206138) do
yrest(500);
item:update(206138)
if item.ItemCount == 4 then
break
end
yrest(300);
end
yrest(1000);
</waypoint>All ideas are welcome. ThQ.