Thanks to Lisa for the targeting functions, the bot will now stand in place and target all characters around it instead of just in front of it.
Code: Select all
function SiegeBuffs()
while(true) do
local objectList = CObjectList()
objectList:update()
local objSize = objectList:size()
for i = 0,objSize do
local obj = objectList:getObject(i)
local distance = distance(player.X, player.Z, obj.X ,obj.Z)
if player.Y >= (obj.Y - 10) and obj.Y >= (player.Y - 10) and 50 > distance then
player:target(obj)
player:update();
if (player:haveTarget() ~= nil) then
player:update();
local target = player:getTarget()
target:update()
target:updateBuffs()
player:checkSkills(true)
player:checkPotions()
end
end
end
end
endThe waypoint file looks like this. It shouldn't move from it's spot.
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
SiegeBuffs()
</onLoad>
</waypoints>