The One Wizard trying to get 44 kills?

Hey all,

I’m totally stuck. The threads on this level seem to be from ages ago and don’t help. I seem to be one second away from the wizard seeing the ogre so that it can step on the button to blow them all up. Anyone can help?

while True:

enemy = hero.findNearestEnemy()
  if enemy:
  hero.moveXY(12, 51)
    if enemy.type == "munchkin":
      if hero.isReady("chain-lightning"):
        hero.cast("chain-lightning", enemy)
      else:
        hero.attack(enemy)
    else:
      if enemy.type == "scout":
        if  hero.isReady("chain-lightning"):
          hero.cast("chain-lightning", enemy)
        else:
          if hero.isReady("lightning-bolt"):
            hero.cast("lightning-bolt", enemy)
          else:
            hero.attack(enemy)
      else:
        if enemy.type == "catapult":
          hero.moveXY(1, 32)
        else:
          if enemy.type == "ogre":
            hero.moveXY(7, 35)
else:
  if hero.isReady("regen"):
    hero.cast("regen", hero)

Hi! welcome to the forum. Please format your code correctly, since whitespace is important with Python:

```language (optional)
code
```

Hi, i’m still new and I didn’t see an option to tab :melting_face:

spoilers!

Delete if not allowed but here was the solved code for 44 kills! I played around with it a few times for the least lines possible. Lmk if you found a way that uses even less!

while True:

enemy = hero.findNearestEnemy()
if enemy:
    if enemy.type == "munchkin" or enemy.type == "scout":
        if  hero.isReady("chain-lightning"):
            hero.cast("chain-lightning", enemy)
        else:
            hero.attack(enemy)
    elif enemy.type == "catapult":
        hero.moveXY(25, 47)
        hero.moveXY(14, 35)
        hero.cast("lightning-bolt", enemy)
    elif enemy.type == "ogre":
        hero.moveXY(5, 35)
elif hero.isReady("regen"):
    hero.cast("regen", hero)

It’s SO satisfying to watch over and over again. Only bc I spent ALL day trying to figure it out and once I got it, I just got it!