Precision kicking help!

If you need help with your code please could you post it formatted (instructions).
Thanks,
Danny

Can anyone help with mine? Here’s my code:


while(true) {
    var blueskelly = hero.findEnemies();
    var ball = hero.findByType("ball")[0];
    var peasant = hero.findByType("peasant")[0];
    for (var i = 0; i < blueskelly.length; i++) {
        if (ball.velocity.magnitude() == 0) {
            var blue = blueskelly[i];
            var goal = Vector.subtract(blue.pos, ball.pos);
            goal = Vector.normalize(goal);
            goal = Vector.multiply(goal, -5);
            goal = Vector.add(goal, ball.pos);
            hero.command(peasant, "move", goal);
            hero.wait(0.5);
            hero.command(peasant, "move", ball.pos);
            hero.wait(0.5);
            hero.command(peasant, "move", goal);
            hero.wait(2);
        }
    }
}