PharmerPhale...
I had an idea after looking thru the lua for this... now, forgive me if this idea sounds foolish, but it may help:
Was wondering if the highlighted areas could be stored in an array instead of having to 'look them up' every iteration. This way you won't have to take 'extra time' to look up the same information over and over which may help improve the performance. You can just pull it from a table.
Code:
for i = FIRST_ITEM_INDEX, LAST_ITEM_INDEX do
local skipThis = false
local thisAbility = GetAbilityData(Zeabot.ChosenAbilities[i]) local abilityID = thisAbility.id
if thisAbility ~= nil and IsAbilityEnabled(abilityID) ~= false then -- skill is good AND ready, continue
if abilityID ~= 245 or abilityID ~= 0 then -- is not flee or 0, continue
local thisSlot = Zeabot.IsAbilityOnHotbar(abilityID)
if thisSlot ~= 0 then
local curCD, maxCD = GetHotbarCooldown(thisSlot)
if curCD ~= 0 then
skipThis = true
end
else
skipThis = true
end
if skipThis == false then
local minRange, maxRange = GetAbilityRanges(Zeabot.ChosenAbilities[i])
if maxRange <= 10 then
maxRange = 10
end
Maybe a function similar to this(totally new to lua so I'll understand if you laugh at my mistakes)
Code:
function Zeabot.SetTables()
abilityTable = {} --stores abilityID
slotTable = {} -- stores slot locations
minRangeTable = {} --stores min ranges for abilities
maxRangeTable = {} --stores max ranges for abilities
local minRange = -1
local maxrange = -1
local thisSlot = -1
local abilityID = -1
for i = FIRST_ITEM_INDEX, LAST_ITEM_INDEX do --iterate through Zeabot abilities selected
local thisAbility = GetAbilityData(Zeabot.ChosenAbilities[i]) --get ability object
abilityID = thisAbility.id --get the ability id
thisSlot = Zeabot.IsAbilityOnHotbar(abilityID) --Check if ability is on hotbar
if thisSlot ~= 0 then --if the ability is on a hotbar get/set min and max range
minRange, maxRange = GetAbilityRanges(Zeabot.ChosenAbilities[i])
if maxRange <= 10 then
maxRange = 10
end
end
table.insert(abilityTable,abilityID) --enter abilityid into array
table.insert(slotTable,thisSlot) --enter slot into array
table.insert(minRangeTable,minRange) --enter minrange into array
table.insert(maxRangeTable,maxRange) --enter maxrange into array
end
end