Sarven Statue Help

I need some help in sarven statue. Here is my code;

# Walk to a few points around the ogre camps, defeating any enemies along the way.
# Visit the statue to begin the event.
# Stand your ground and defeat the attacking ogres.
hero.moveXY(60, 65)
# Hint: fight close to the statue for it's assistance during the battle.
def attack(enemy):
    if enemy and hero.distanceTo(enemy) < 20:
        if hero.isReady("bash"):
            hero.bash(enemy)
        if hero.isReady("stomp") and hero.distanceTo(enemy) < 15:
            hero.stomp()
        if hero.canCast("earthskin"):
            hero.cast("earthskin", self)
        hero.attack(enemy)
        hero.shield()
        
    else:
        hero.moveXY(60, 65)
    if hero.health < 500 and hero.canCast("invisibility"):
        hero.cast("invisibility", hero)
        hero.moveXY(60, 65)

def move(pos):
    if hero.isReady("jump"):
        hero.jumpTo(pos)
    else:
        hero.move(pos)



def raise_dead():
    Summon = hero.findCorpses()
    toSummon = hero.findNearest(Summon)
    if toSummon:
        if hero.canCast("raise-dead"):
            hero.cast("raise-dead")

def buff():
    skeleys()
    if hero.canCast("sacrifice"):
        skeleton = hero.findNearest( hero.findByType( "skeleton" ) )
        if skeleton:
            hero.cast( "sacrifice", skeleton, hero )
            raise_dead()

def summon():
    if hero.gold > 20:
        hero.summon("soldier")
    for solider in hero.findFriends():
        enemy = solider.findNearestEnemy()
        if enemy and (solider.type == 'soldier'):
            hero.command(solider, "attack", enemy)
        if (solider.type == "soldier") and not enemy:
            hero.command(solider, "defend", self)



def farm():
    while True:
        enemy = hero.findNearestEnemy()
        buff()
        if enemy and hero.distanceTo(enemy) < 20:
            attack(enemy)
        if hero.maxHealth > 5000:
            hero.moveXY(60, 65)
            break


while True:
    enemy = hero.findNearestEnemy()
    attack(enemy)
    summon()
    if pet.isReady("cold-blast") and enemy and hero.distanceTo(enemy) < 15:
        pet.coldBlast()
            

I have okar, and the best warrior armour, sword of the forgotten, and deflector.

Also im in sarven statue 7

What is not working? what happens when you run your code?

Is that Sacred Statue? If it is, it’s difficult to complete level 7 with okar. Do you have wizards?

Yeah it is (20 chars)

I have pender, and naflar

I also have senick. (20chars)

That;s nice that you have Nalfar! It’s the best hero for this level! Try to summon many troops and sacrifice them.

Do I kill burls, and also what troops do I summon? Like archer, solider, paladin

Well, I think it’s good to summon skeletons and paladins and sacrifice them and use lightning twig.

I think when you are on Sarven Statue seven, you just have to try around, because its really difficult (I’ve never been to it, but Ive been to others with seven and above). I dont think there its a lot of advice to give here. But its still very kind and encouraging of you guys

Happy B-Day @anon62741001

Thanks @milton.jinich :3