davidmann4 / ogar-feeder-bot

feeder bot for ogar servers
MIT License
92 stars 46 forks source link

Make the bot follow mouse #13

Closed Ogarunite closed 8 years ago

Ogarunite commented 8 years ago

Fetch mouse coordinates, follow.

davidmann4 commented 8 years ago

reverse engeniered the client:


// take playfield dimension
C0 = (end_x + start_x) / 2;
B0 = (end_y + start_y) / 2;

if (0 != playerballs.length) {
   for (var d = 0, e = 0; e < j0.length; e++) d += playerballs[e].size;
   p0 = (9 * p0 + Math.pow(Math.min(64 / d, 1), .4) * e4()) / 10;
}

// mouse xy to coordinates
x = (d.clientX - window.innerWidth / 2) / p0 + C0;
y = (d.clientY - window.innerHeight / 2) / p0 + B0;
davidmann4 commented 8 years ago
function e4() {
    var d;
    d = 1 * Math.max(window.innerHeight / 1080, window.innerWidth / 1920);
    return d *= O1;
}
afituri commented 8 years ago

Hello davinmann4,

Thank you for your work and effort,

I have a question about this, I'm using the mini-map-server userscript and I need to know how to get the playerballs variable also the j0 just to make the follow mouse work?

Thanks

davidmann4 commented 8 years ago

done

luisbriyan commented 8 years ago

@davidmann4 podría por favor ayudarme con lo mismo pero en gota.io ?? Es lo mismo que agar, pero con otro name.. Intento hacer que solo 1 cell me siga a donde está la cell master, pero no lo consigo.