I'm doing final tests on a new revision of zeabot now. The logic of the function was flawed in that it cycled through your abilties and checked for appropriate targets. However, the new logic, which works 100% better, cycles through people around you checking to see if the abilities you have fit their situation. This means that friendly targets with the lowest hp will be healed first and will continue to be healed until someone else is the lowest. Alternatively, enemies with the least hp will be attacked first.
A release soon. However, I would really like to impliment support for multiple hots/dots before I do so.
EDIT: You can replace your own zeabot function with this one if you want to see the improvements right away.
Code:
function HackPack.CheckForZeabot()
local MyGUID = GetPlayer().GUID -- Gets your characters GUID
local MyEntity = GetEntity(MyGUID)
HackPack.EntityList = {} -- Clear the entity list
local TargetTypeString = ""
local found = 0
if HackPack.ZeabotUseOnPlayers == true then
TargetTypeString = TargetTypeString .. "player,"
end
if HackPack.ZeabotUseOnNPCs == true then
TargetTypeString = TargetTypeString .. "npc,"
end
for GUID , Details in pairs(EntityList("los,"..TargetTypeString..",alive,maxdistance=200")) do
found = found + 1
local thisT = GetEntity(GUID)
table.insert(HackPack.EntityList,found,thisT)
end
found = found + 1
table.insert(HackPack.EntityList,found,MyEntity) -- add myself to the list
table.sort(HackPack.EntityList, HackPack.SortByHealth) -- sort the table in order of least health first
for i, v in pairs(HackPack.EntityList) do
for aID, Details in pairs(HackPack.ZeabotAbilities) do
local skipThis = false
local skipReason = ""
if HackPack.ZeabotAbilities[aID] == 245 or HackPack.ZeabotAbilities[aID] == 0 then
skipThis = true
skipReason = "skipping flee or non-existant ability"
end
if HackPack.ZeabotCooldowns[aID] <= 0 then
local thisAbility = GetAbilityData(HackPack.ZeabotAbilities[aID])
if thisAbility == nil then skipThis = true end
local minRange, maxRange = GetAbilityRanges(HackPack.ZeabotAbilities[aID])
if maxRange < 9 then
maxRange = 9
end
local CastTime = math.floor(GetAbilityCastTime(thisAbility.id))
local waitTime = 1
-- d("at:"..thisAbility.targetType .. " tt:" .. HackPack.EntityList[i].TargetType .. " na:" .. tostring(HackPack.EntityList[i].name))
if thisAbility.targetType == 2 then -- filters friendly players and mobs for friendly spells
if not (HackPack.EntityList[i].TargetType == 1) and not (HackPack.EntityList[i].TargetType == 3) and not (HackPack.EntityList[i].TargetType == 4) then
skipThis = true
skipReason = "friendly spell, not friendly target - "..tostring(HackPack.EntityList[i].name)
end
end
if thisAbility.targetType == 1 then -- filters hostile players and mobs for hostile spells
if not (HackPack.EntityList[i].TargetType == 0) and not (HackPack.EntityList[i].TargetType == 6) then
skipThis = true
skipReason = "hostile spell, friendly target - "..tostring(HackPack.EntityList[i].name)
end
end
if v.distanceFT > maxRange or v.distanceFT < minRange then
skipThis = true
skipReason = "skipping too close or out of range"
end
if not (thisAbility.targetType == 2) and GameData.Player.inCombat == false and HackPack.EntityList[i].healthPercent <= 75 and HackPack.ZeabotUseOnPlayers == false then
skipThis = true
skipReason = "standing around to heal health a bit"
end
if skipThis == false then
local GUID = HackPack.EntityList[i].GUID
if not HackPack.DottedTargets[GUID] then
table.insert(HackPack.DottedTargets,GUID,0)
end
if GetPlayer().actionPoints > GetAbilityActionPointCost(thisAbility.id) then
if HackPack.ZeabotEffectTimes[aID] > 0 and HackPack.DottedTargets[GUID] > 0 then
skipThis = true -- he's already got a DoT or HoT, skip him
skipReason = "skipping target already has a dot or hot"
end
if thisAbility.targetType == 2 and HackPack.EntityList[i].healthPercent >= 90 then
skipThis = true -- he's above 90% health, skip him
skipReason = "skipping friendly target is above 90% health"
end
if thisAbility.targetType == 2 and HackPack.EntityList[i].healthPercent >= 70 and HackPack.DottedTargets[GUID] > 5 then
skipThis = true -- he's above 70% health, with a HoT for atleast 5 more seconds, skip him
skipReason = "skipping friendly target is above 70% health with a HoT"
end
if HackPack.EntityList[i].TargetType == 6 then
if GameData.Player.inCombat == true and not (HackPack.EntityList[i].target == MyGUID) then
skipThis = true
skipReason = "skipping hostile mob, mob not targetting me"
end
end
if skipThis == false then
Target(GUID)
HackPack.Cast(thisAbility.id)
HackPack.DottedTargets[GUID] = HackPack.ZeabotEffectTimes[aID]
HackPack.Casting = math.floor(thisAbility.reuseTimerMax)
HackPack.ZeabotCooldowns[aID] = math.floor(thisAbility.reuseTimerMax)
return true
-- else
-- d(tostring(HackPack.EntityList[i].name)..": "..skipReason)
end
end
-- else
-- d(tostring(HackPack.EntityList[i].name)..": "..skipReason)
end
end
end
end
return false
end