The one wizard help!

This is my code. I only get 30 kills before i am teleported. This is the best i could think of so far

# Defeat as many ogres as you can.
# Use 'cast' and 'canCast' for spells.
enemy = hero.findNearestEnemy()
hero.cast("chain-lightning", enemy)
e = 0
while e <= 4:
    hero.moveXY(14, 42)
    hero.moveXY(12, 32)
    e +=1
    if e == 4:
        enemy = hero.findNearestEnemy()
        while enemy.health > 0:
            hero.attack(enemy)
        hero.cast("regen", hero)
enemy = hero.findNearestEnemy()
hero.cast("lightning-bolt", enemy)
hero.say("Yea come one!")
enemy = hero.findNearestEnemy()
hero.cast("chain-lightning", enemy)
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.say("Hey where are you")
hero.say("Hey!")
hero.say("!!!")
enemy = hero.findNearestEnemy()
hero.cast("lightning-bolt", enemy)
hero.cast("regen", hero)
hero.say("Hey where are you")
hero.say("Hey!")
hero.say("!!!")
hero.say("!!!")
hero.moveXY(8, 36)
while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
        if hero.canCast("chain-lightning") and enemy.type == "scout" or enemy.type == "catapult":
            hero.cast("chain-lightning", enemy)
        elif hero.canCast("lightning-bolt") and enemy.type == "scout" or enemy.type == "catapoult":
            hero.cast("lightning-bolt", enemy)
        elif hero.isReady("root"):
            hero.cast("root", enemy)
    if not enemy and hero.canCast("regen"):
        hero.cast("regen", hero)

1 Like

only use chain-lightning on the long line scouts. only use lightning bolt on catapults. otherwise just attack.

Use chain-lightning on long line of munchkins too.

Also, move back a little bit, so you can deal more damage before the enemy reaches you.

The only problem is that the ball is still there when i kill the catapult so i cant avoud it unless i get the findenemymissiles method. Then i would ba a ok

So kill the catapult before it shoots. easy.

also remove all the hero.say("message") commands. they waste time.

Hi Red-backspider,

Appreciate that you’re trying to help, but you’re commenting on a conversation that is 2 years old. I don’t think anyone in it is active any more!

Jenny

2 Likes

Yes @jka2706 is right please don’t bring up dead topics. This wasn’t active for two years and if the user really needed help they would have kept posting