Summits gate help me (javascript)

some how oy flags do not work can anyone help?

here is my code(20char)

hero.moveXY(92, 55);
hero.attack('Catapult');
hero.attack('Catapult');
hero.moveXY(92, 12);
hero.attack('Catapult 1');
hero.attack('Catapult 1');
hero.moveXY(60, 34);
this.jumpBash = function () {
    var enemy = hero.findNearest(hero.findEnemies());
    if (enemy && hero.isReady("jump") && hero.isReady("bash")) {
        hero.jumpTo(enemy);
        hero.bash(enemy);
    }
};
this.attack3 = function () {
    var enemy = hero.findNearest(hero.findEnemies());
    if (enemy) {
        hero.scattershot(enemy);
    }
    
};
this.summonSoldier = function () {
    if (hero.gold >= hero.costOf("griffin-rider")) {
        hero.summon("griffin-rider");
    }
};
this.commandSoldier = function () {
    var friend = hero.findFriends();
    var enemy = hero.findNearest(hero.findEnemies());
    if (enemy&&friend) {
        for (var i = 0; i < friend.length; i += 1) {
            hero.command(friend[i], "attack", enemy);
        }
    }
};
this.commandPaladin = function () {
    var friend = hero.findByType("paladin");
    var enemy = hero.findNearest(hero.findEnemies());
    if (friend) {
        for (var s = 0; s < friend.length; s += 1) {
            hero.command(friend[s], "cast", "heal", this);
        }
    }
};
this.PickupItems = function () {
    var item = hero.findNearest(hero.findItems());
    if (item) {
        hero.move(item.pos);
    }
};
this.Wait = function () {
    if (this.pos.x > 216) {
        hero.wait(10);
    }
};
while (true) {
    this.summonSoldier();
    this.commandSoldier();
    this.commandPaladin();
    this.jumpBash();
    this.attack3();
    if (this.pos.x > 249) {
        break;
    }
}
var tt = true;
while (tt) {
    var enemy = hero.findNearest(hero.findEnemies());
    if (enemy && enemy.type === 'Warlock') {
        hero.attack(enemy);
    }
    if (this.pos.x > 272) {
        hero.moveXY(277, 57);
        hero.attack('Vax');
        hero.attack('Vax');
        hero.moveXY(276, 8);
        hero.attack('Vyrryx');
        hero.attack('Vyrryx');
        hero.attack('Vyrryx');
        hero.attack('Yzzrith');
    }
    var tt = false;
}
while (true) {
    var flag = hero.findFlag();
    if (flag) {
        hero.blink(flag.pos);
        hero.pickUpFlag(flag);
    }
    else {
        this.PickupItems();
    this.summonSoldier();
    this.commandSoldier();
    this.commandPaladin();
    this.jumpBash();
    this.attack3();
    }
    
}

@Chaboi_3000 can you help me?

my flags are not responsive

enemy.type === 'Warlock'  # "warlock"

ok(20charssssssssss)

Sorry, a bit busy this week with loads of work to do.

1 Like

ok