LUA, but any help appreciated. I have been playing around with the code, but am having trouble due to the somewhat limited options and trying to make them all work together correctly.
while true do
local enemy = hero:findNearestEnemy()
local distance = hero:distanceTo(enemy)
if enemy then
if hero:isReady("lightning-bolt") then
hero:cast("lightning-bolt", enemy)
elseif hero:canCast("regen") then
hero:cast("regen", self)
else
hero:attack(enemy)
end
end
end
I know this has been asked before, but I’d like to discuss the possibilities if anyone is willing.
Here is my current code now that I am working on. I still haven’t integrated “root” into this version and will target “Freesa” and more.
while true do
local enemy = hero:findNearestEnemy()
if enemy then
distance = hero:distanceTo(enemy)
if enemy.type == "ogre" then
hero:moveXY(10, 36)
elseif distance < 10 and hero:canCast("chain-lightning", enemy) then
hero:cast("chain-lightning", enemy)
elseif hero:canCast("lightning-bolt", enemy) then
hero.cast("lightning-bolt", enemy)
elseif hero:canCast("regen", hero) and hero.health < 50 then
hero:cast("regen", hero)
else
hero.attack(enemy)
end
end
end