I need help on Siege of Stonehold

wont it be easier with
if hero.health<100
hero.moveXY(x,y)
?

(Did any of this work @calvin )

I believe you need polished sense stone to check for your heroā€™s health.

1 Like

well good luck solving this
I need to study for my French Finals that is tomorrow

P.S Hope I helped in solving this level :grin:

this is if you dont have a very good sense stone, can you post your equipment pls? I think we will have a better clarification if you do

equipment is key for these world liking levels

2 Likes

*remebers how i spent 2 weeks on clash of clones and the key was simply a cleave sword *

2 Likes

yes and this is about Siege of Stonehold

1 Like

Man I remember a little bit of this levelā€¦

Not always. I didnā€™t try this strategy, but you may go to wizard and be always healed so you wait when ogres kill all your friends and then they go to you and you attack and cleave them and wizard heals you.

1 Like

My guy spends forever finding the flag while I wave it in his face! Why is this so?

function moveToFlag(flag){
hero.pickUpFlag(flag);
hero.say("Ready for orders.");
}
var flagB = hero.findFlag("black");
if(flagB){
    moveToFlag(flagB);
}

@Xander_Orneck is it the full code here? If its not can i see it pls

you have to attack because the starting force isnt enought to beat it all by itsw own and also you said your waving it did you click it? because in order for the ero to be able to see the flag is if you click the right colored flag and then click on where you want to ge th hero to go

I used the right color, but my guy wont move anywhere
maybe syntax?
btw this is full

2 Likes

Itā€™s because this bit isnā€™t looped:

var flagB = hero.findFlag("black");
if(flagB){
    moveToFlag(flagB);
}

When you run your code, it will check if thereā€™s a black flag once, at the very beginning of the level, before you have a chance to put one down. After that it wonā€™t run it again. Remember that code by itself, outside of a loop, will only run once.
You should use a while (true) { loop around the above section :arrow_double_up:.
Danny

1 Like

I get it. No loop means it only checks once

2 Likes

i dont do alot of java script but i think there is suppose to have 4 spaces

I also dont see where you defined flagā€¦
(like @Deadpool198 said you should add a while(true) { loop)

Itā€™s a function argument.
(i beat it so no more)