[SOLVED]Siege of Stonehold - Python

Basically, my cleave code… i dont know what do do with it. It just says If you want to call hero.isReady as a function you need parentheses but i already have parentheses

heres my code:

# Help your friends beat the minions that Thoktar sends against you.
# You'll need great equipment and strategy to win.
# Flags might help, but it's up to you–be creative!
# There is a doctor behind the fence. Move to the X to get healed!!
while True:
    enemy = hero.findNearestEnemy()
    flag = hero.findFlag("green")
    if enemy and enemy.type == "munchkin" and cleave == "ready":
        hero.cleave(enemy)
    else: hero.isReady("cleave"):
        hero.attack(enemy)
    elif enemy and enemy.type == "ogre":
        hero.say("EEEK!")
        hero.moveXY(19, 69)
    if flag:
        hero.pickUpFlag(flag)

I made the EEEK because why not.

Why don’t you use the bottom code in the top example? The correct way to check if something is ready is if hero.isReady(“cleave”).

Again, I’ll say the exact same thing. The bottom usage of elif is correct. Else doesn’t take a condition (like if something is ready). Use elif like in the second bit of code.
Danny

1 Like

Hmm. Ok. (i hate 20 char)

Wait a sec. I tried to do that but then realized im trying to say “If the cleave isn’t ready, attack” to the game. On the other hand, thanks for the Elif.

oh and the isReady for my “is cleave ready” code.

Its been a day and no one has replied. Cool.

Such a cruel world)
But a lot of people prefer not to respond if they have nothing to say in order to not create junk messages.
In other words, which of your posts you’d like to be replied?

Th- this one I still haven’t been given level help.

what shield do you have?

Defensive infantry (hate 20 char)

Also, all that is wrong with my code is
1:elif hero.isReady("cleave"): hero.attack(enemy)
2:if enemy and enemy.type == "munchkin" and hero.isReady("cleave") hero.cleave(enemy)

@AlwaysConfused i basically just used flags and 7 lignes of code

First of all, it’s good idea to post your updated code.

boom

# Help your friends beat the minions that Thoktar sends against you.
# You'll need great equipment and strategy to win.
# Flags might help, but it's up to you–be creative!
# There is a doctor behind the fence. Move to the X to get healed!!
while True:
    enemy = hero.findNearestEnemy()
    flag = hero.findFlag("green")
    if enemy and enemy.type == "munchkin" and hero.isReady("cleave"):
        hero.cleave(enemy)
    elif hero.isReady("cleave"):
        hero.attack(enemy)
    elif enemy and enemy.type == "ogre":
        hero.say("EEEK!")
        hero.moveXY(19, 69)
    if flag:
        hero.pickUpFlag(flag)

i usually dont use hero.say i realized that when i say something i just stay still and take blows

1 Like

i did not use that advanced armor just the steel breastplate and the iron helmet (i used the same sword)

I would suggest simplify this part and leave only smth like

if enemy and hero.isReady("cleave"):
    Self.cleave

I started this level with 844 HP. And I didn’t ran from ogres. Don’t think you need too.
How much health does your hero have?
@WaWa_Yang is right, saying something always take a little time. Some spare seconds are important.

1 Like

i also recommend a shield that has bash ability (when i beat the level i used the “crude spike”)

i had the trap belt but did not think of using it :sweat_smile:

358 i dont have premium so i cant get that really good armor, i used the say for no reason, but ogres typically do 30 or 40 damage per hit, and munchkins do… what, five? So if i get hit by X number of munchkins and i now have 250 health, i can afford to lose a little bit on the trip to the doctor. I think i will use an attack and cleave against ogres.