Munchkin Swarm help

Please read the FAQ before posting and provide the required information so we can help you

Help us help you

1 Like

Help me,
this is what i have
while True:
enemy = self.findNearestEnemy()
if self.isReady(“cleave”) and self.distanceTo(enemy) < 10:
else:
self.attack(“Chest”)
self.attack(“Chest”)

I am using python for code combat

YES Thank You! I’ve had so much trouble on this! It took my two days to figure it out! Thank You~

1 Like

nearestEnemy = hero.findNearestEnemy()
distance = hero.distanceTo(nearestEnemy)
# If it comes closer than 10 meters, cleave it!
if distance < 10:
enemy = hero.findNearestEnemy()
hero.isReady(“cleave”)
hero.cleave(enemy)
# Else, attack the “Chest” by name.
else:
hero.attack(“Chest”)
pass

Please format your code.

Hint

Use a loop with hero.isReady