Sos on leave it on cleaver! any help?


#1

I’ve tried this:
def cleaveWhenClose(target):
if hero.distanceTo(target) < 5:
pass
# Put your attack code here
# If cleave is ready, then cleave target
hero.cleave(enemy)
# else, just attack target!
else:
hero.attack(enemy)
hero.attack(enemy)

This code is not part of the function.

while True:
enemy = hero.findNearestEnemy()
if enemy:
# Note that inside cleaveWhenClose, we refer to the enemy as target.
cleaveWhenClose(enemy)
cleaveWhenClose(enemy)
[Please be polite]


#2

Please post your code according to the FAQ.


#3

If cleave is ready, then cleave target =>
if hero.isReady(“cleave”):


#4

Make sure cleave isReady before you cleave. if(hero.isReady(“cleave”). Also, please do not use profanity