here’s my code but you have to play fill in the blanks lol: (also sorry it’s js)
function findFurthest (t, r, u) {
let m = 'distance' + (u ? 'To' : '');
let e = r[0];
for (let v of r) {
if (t[m](v) > t[m](e)) {
e = v;
}
}
return e;
}
function dir (x1, y1, x2, y2) {
if (x2 === true) {
y2 = y1.y;
x2 = y1.x;
y1 = x1.y;
x1 = x1.x;
}
return null; // something to do with atan (math function)
}
function circle (cx, cy, radius, angle) {
return null; // something to do with the level: library tactician
}
function move (unit, place) {
hero.command(unit, 'move', place);
// wait until the unit gets to the place they're moving to, move command only takes 0.1s, while the unit takes a bit more time than that to move... hint: while true with a break condition regarding distanceTo
}
const p = null; // peasant
const ball = null;
const center = null;
const original = new Vector(p.pos.x, p.pos.y);
const dia = [null, null, null, null]; // west, north, south, east by 10 meters of the ball
while (true) {
let prev = findFurthest(p, null /* enemies that are alive (it probably does the filter already, but just in case... hint: p.findEnemies() with filter method: array.filter(variableName => condition) (or python: filter(lambda variableName: condition, array) */, true);
move(p, circle(center.x, center.y, null /* radius, it's mentioned somewhere above... */, null/* dir function with parameters: prev.pos, center, and true, I'll yet you figure out the order */ + Math.PI));
move(null, null); // move p to center
let t = findFurthest(p, null /* same as prev but check if enemy isn't prev: enemy health is bigger than 0 and enemy does not equal prev */, true);
if (!t) break;
move(p, circle(center.x, center.y, null /* radius, it's mentioned somewhere above... */, dir(center, t.pos, true) + Math.PI));
// wait until ball is in the center: ball.distanceTo(center), while loop with break condition
}
hero.say('Fun fact: I had aimbot');