Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coordinates fix #597

Open
FliiFe opened this issue Apr 19, 2016 · 4 comments
Open

Coordinates fix #597

FliiFe opened this issue Apr 19, 2016 · 4 comments

Comments

@FliiFe
Copy link
Collaborator

FliiFe commented Apr 19, 2016

It seems like when you use getPlayer(), getPlayer().x and getPlayer().y are correct and relative to the entire map. We should use them for getting location, even if it requires using a new unit. (Something else is better than nothing)

Current status

We can retrieve the map size with packet id 64 (thanks @ermiyaeskandary). We have the coordinates of the player relative to some yet-to-find point on the map.

@ermiyaeskandary
Copy link
Contributor

ermiyaeskandary commented Apr 19, 2016

If I'm not mistaken, when I was porting the old launcher code to the new agar.io main_out.js file, getPlayer() is a function which takes its variables from launcher.user.js, which converts all the agar.io obfuscated variables and converts them into function which the bot.user.js file can understand. Therefore, it is agar.io's own information and should be relative and correct to the entire map as agar.io needs the information itself and because of this, we can use them for getting location.

window.getX = function() {
return A;
}

window.getY = function() {
return B;
}

@ermiyaeskandary
Copy link
Contributor

The map sizes are sent by the server when you first connect, packet ID 64. We can possibly use that to figure out where we are 👍

@FliiFe
Copy link
Collaborator Author

FliiFe commented Apr 20, 2016

How are agario's coordinates converted to "location" coordinates (the one the bot uses now) ?

@ermiyaeskandary
Copy link
Contributor

ermiyaeskandary commented Apr 20, 2016

Don't know - didn't ask @Apostolique . I'm just sure that we can use them to find our location as we know the map size and I have done it before.

The map sizes are sent by the server when you first connect, packet ID 64. We can possibly use that to figure out where we are

This was referenced Apr 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants