// You'll need good strategy to win this one!
// Your clone will have the same equipment you have!
// But, they're not very skilled at using special powers.
while(true) {
var flag = hero.findFlag();
var enemy = hero.findNearestEnemy();
if (enemy && enemy.type != "sand-yak") {
if (hero.isReady("bash")) {
hero.bash(enemy);
}
hero.cast("chain-lightning", hero.findNearestEnemy());
hero.attack(enemy);
}
}
I’m not proficient in JavaScript, but shouldn’t you state what the issue is?
My hero keeps dying.
Maybe get better equipment? What are you using currently?
I apologize for the delay. I’m trying to find my account so I can test it out, but I have no idea how I can find it.
Try if hero.isReady("chain-lightning")
and put else after chain lightning because if its not ready it can use hero.attack()
Do you have the invisibility ring @Monsty?
Andrei
It doesn’t matter what equipment your using because the clones have the same equipments as you you can’t change it.
But better equipment for yourself means better equipment for your clone, and what follows is that your clone would last longer because it would be stronger.
Yeah, I know so I tried playing with the weakest boots and the first sword you get in the game
Try and defeat the archers and then the your hero clone. Your army will take care of the rest.
Elijah
Also, and I’ve said this before in another Clash of Clones post, you don’t need to check if the enemy isn’t a sand yak; they are too far away. That is… if you keep the fight in the middle.
Swap this for:
if (enemy) {
if (hero.isReady("bash")) {
hero.bash(enemy);
}
else {
hero.attack(enemy)
Don’t bother trying to cast chain-lightning - you are using a warrior so you can’t cast it anyway.
Hope this helps
Elijah
Sorry Falcon, but that is not correct. The chain-lightning is an aspect of the ring, not a skill/ability, so any character can cast it.
Also, the ‘!= sand-yak’ clause can be important…what if there are no enemy, for the split second between waves?
I wish I had known this before
This never happened to me though
Yes, it is quite unlikely, but, it can happen…besides, it doesn’t hurt to leave in the != clause…just in case
Thank you @dedreous.
I wonder if @Monsty has solved it yet…
And, I apologize too…it’s the gloves that grant the ability, not a ring. Sorry! Thanks Andrei for keeping me straight!