Mages might, help!

I am happy that mages might is out!But I have problems.Here is my code:

count = 0;

def choose(collector):
    global count
    count += 1
    return ['fire', 'water', 'earth'][0]



while True:
    hero.spawnCollector()
    hero.spawnCollector()
    if hero.canCast("fire-beam"):
        hero.cast('fire-beam')
    elif hero.canCast("water-arrow"):
        hero.cast('water-arrow')
    elif hero.canCast("earth-ball"):
        hero.cast('earth-ball')

Why the mage does not cast as soon as he has enough mana?

perhaps add the amount of mana you have and you canCast

Because your mage is probably spending time on spawning collectors. That’s why put the hero.spawncollector() outside of the while True loop.

Thanks, everyone!It helped me a lot!

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.