I need help with Stranded in the dunes

My code:

While true:
    flag = hero.findFlag(“green”)
    enemies = hero.findEnemies()
    If flag:
        Hero.pickUpFlag(flag)
        If enemies:
            If hero.isReady(“cleave”):
                Hero.cleave(enemy)
            Else:
                Hero.attack(enemy)

Why are you using capital H’s for some of the time and lowercase h’s for other times. Keep it all lowercase.

Oh it is the iPad doing it

Ah. Autocorrect? That can sometimes be very unhelpful.

1 Like

Anything else I need to fix?

I haven’t done flags in awhile. But if I remember correctly, instead of Hero.pickUpFlag(flag)
Do Hero.pickUpFlag("green") But I can’t be sure about that one.

Ok let me try

Ok. But I have to go now.

1 Like

Actually you don’t need to. But @The_legendary_pro19 your quotes("" these things) look wrong.

How do they look wrong?

The quotes ususally look like " but yours look like

Is my code wrong?

Watch for capitals.
20dcn

it is auto complete

Is my code wrong?

Oh I formatted my code

@Eric_Tang

Post your most recent code.


while True:
    flag = hero.findFlag("green")
    enemy = hero.findNearestEnemy()
    if flag:
        hero.pickUpFlag(flag)
        if enemy and enemy.type != "yak":
            if hero.isReady("cleave"):
                hero.cleave(enemy)
            else:
                hero.attack(enemy)

Format.
20c hdraddddd