I am currently trying. Does the electrocute ring have a cooldown?
Yes, I think. Sorry, I didn’t buy it.
I still can’t beat this level. It’s really hard. Also there are definitely better ways to beat this than I am trying but I’m not that good. This is the best I can do so far.
def retreat():
hero.moveXY(33, 65)
def attack(enemy):
if hero.health < 250:
retreat()
if enemy and enemy.type != "sand-yak" and enemy.health > 0:
hero.shield()
if hero.isReady("cleave") and hero.distanceTo(enemy) < 10:
hero.cleave(enemy)
hero.shield()
elif hero.canElectrocute(enemy) and hero.isReady("electrocute"):
hero.electrocute(enemy)
hero.shield()
elif hero.isReady("bash"):
hero.bash(enemy)
hero.shield()
else:
hero.attack(enemy)
hero.shield()
else:
if enemy and enemy.type != "sand-yak":
if hero.isReady("cleave") and hero.distanceTo(enemy) < 10:
hero.cleave(enemy)
hero.shield()
elif hero.canElectrocute(enemy) and hero.isReady("electrocute"):
hero.electrocute(enemy)
hero.shield()
elif hero.isReady("bash"):
hero.bash(enemy)
hero.shield()
else:
hero.attack(enemy)
hero.shield()
while True:
enemy = hero.findNearestEnemy()
attack(enemy)
Do you have any armor?
in mine i used flags to guide the hero out of places I don’t want to be like in a hoard of ogres or clones
Hi GraySkayI007,
Great to see that you’re trying lots of different things - it’s how you’ll learn & improve. Keep experimenting!
A few things to try:
- Take the first 2 lines of the attack function out, and put them in the while True loop instead. Ie you want a sentence that says “while hero’s health is more than 250, run the attack function, else run the retreat function”.
- I got my hero to attack the archers first (especially with a cleave)
- I needed two move codes in my ‘retreat’ so the hero kept running away (while my archers finished off the clone)
- Don’t repeat ‘shield’ too much. It only blocks some of the attacks. Running away is more effective if you’re low on health.
Keep going with it - you’re on the right lines :).
Jenny
I got my hero to attack the archers first (especially with a cleave)
@jka2706 but I’m really bad at that type of stuff. I couldn’t code an index if my life depended on it.
Not sure I even know what coding an index is
.
How about:
archer = hero.findNearest(hero.findByType("archer"))
enemy = hero.findNearestEnemy()
Then use the attack function you already have - if there’s an archer, attack it; if not attack the enemy.
First of all, I think coding an index is taking all nearby enemies and checking something for each of them. Also I don’t think I have hero.findByType available for me to use. What can I wear or have that allows that for me?
someone = hero. findNearest(hero.findByType("someone"))
I can’t use hero.findByType because I don’t have the right glasses.
OK, so here is a hint: jump/move to archers and cleave just near them.
What @PeterPalov suggest would work!
To answer your question, findByType comes from the more advanced glasses. Kithgard worker’s glasses are the cheapest (190 gems), but consider getting something more expensive as you’ll use more properties later on.
Jenny
That would be awesome, except for the fact that I have 52 gems lol
Also, I’m trying to move to the archers and cleave, but something always seems to kill me before I get there.
Do you have invisibility ring? If you don’t, try to equip your best armour.
I don’t have invis ring, but I am currently playing practice levels so that I can get enough gems to buy findByType glasses.
So I did this level with the Index. If you don’t know how to do Index, you can ask.
These are the units I used for Clash of Clones.
enemies = hero.findEnemies()
archers = hero.findByType("archer", enemies)
friends = hero.findFriends()
enemyIndex = 0
Using my code, my hero goes directly for the archers, once the archers are dead, my hero then attack my clone, after that, my hero just starts attack everyone else, beside my archers and the sand-yaks. I would suggest not to put so much
hero.shield()
but to put one.
This is the armor that I used:

Lydia
A couple things.
- I have done an index before, but I forget completely how to do it. I might check an earlier level on how to do that.
- I am not that extremely GOATed. I don’t even have a pet because I haven’t subscribed. The best thing I have is the regular obsidian breastplate.
- I am still trying to get enough gems to get
findByTypeglasses.
Ok, so you can check on an earlier level for how to do an Index.
You don’t need a pet for this level.
A regular obsidian breastplate is good enough.
Do you have a good bash shield?
Good job!
Lydia