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 ... end
I 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.