player:figh() or Cast problem
Posted: Wed Jun 26, 2013 4:30 pm
Hello there,
i made myself a very long script for this new title stuff and i end up with a quest in waterdragon cave.
So basically the quests needs you to pass by and kill 10 of the elements hanging around at 10 fixed spots.
So i tried to find the elements, target them and use player:fight() so that the bot is clever and kills the target automatically.
It is the same as when using Attack()
I also found that when checking for battle and fighting spawn gates in malatinas course of survival.
The bot just clears the target...
So here is a snippet that is a workaround:
Dont get confused by the chests. I was just lazy and did a c&p of a Tempesthigh waypoint.
This snippet finds the elements and targets the closest then it uses my button 2. This works.
but
do both not work :/
I've already tried to change leveldependancies, mob settings, RUN/NORMAL waypoint-style but nothing helps.
This is also bad when killing the boss, since it just does not do that -.-
any idea?
Br,
nuker
i made myself a very long script for this new title stuff and i end up with a quest in waterdragon cave.
So basically the quests needs you to pass by and kill 10 of the elements hanging around at 10 fixed spots.
So i tried to find the elements, target them and use player:fight() so that the bot is clever and kills the target automatically.
It is the same as when using Attack()
I also found that when checking for battle and fighting spawn gates in malatinas course of survival.
The bot just clears the target...
So here is a snippet that is a workaround:
Code: Select all
function attackelementalincave()
local chests = {}
local objectList = CObjectList();
objectList:update();
local objSize = objectList:size()
for i = 0,objSize do
local obj = objectList:getObject(i);
obj:update()
print(obj.HP)
if obj.Name == "Possessed Water Elemental" and obj.Attackable then
obj.Dist = distance(player.X,player.Z,obj.X,obj.Z)
if 200 > obj.Dist then
table.insert(chests, table.copy(obj))
end
end
end
table.sort(chests,function(a,b) return b.Dist>a.Dist end)
table.print(chests)
for k,v in ipairs(chests) do
player:target(v)
keyboardPress( key.VK_2 )
yrest(3200) -- 2 seconds
keyboardPress( key.VK_2 )
yrest(3200) -- 2 seconds
yrest(2000)
break
end
endThis snippet finds the elements and targets the closest then it uses my button 2. This works.
but
Code: Select all
player:fight()
player:cast("MAGE_FLAME");I've already tried to change leveldependancies, mob settings, RUN/NORMAL waypoint-style but nothing helps.
This is also bad when killing the boss, since it just does not do that -.-
any idea?
Br,
nuker