xzfc / agar-expose

Yet another ogar client
12 stars 12 forks source link

Correct X & Y coordinates ? #21

Open gustavgenberg opened 8 years ago

gustavgenberg commented 8 years ago

If I go to a corner in agar.io, and type window.agar.rawViewport.x and window.agar.rawViewport.y in the console, I get for example X: 5413 Y: 9975. If i respawn, and go to the same corner, I get a different value.

I think it's the effect of a recent agar.io bot-patch.

My question is: how do i get the same values every time i get in the corner?

It's not really a issue, but i really need help with this! I saw your "mouse positioning script". I just wonder if it works in the same way with just the cell coordinates.

I'm happy for answers :D

u624ka commented 8 years ago

https://github.com/xzfc/agar-expose/issues/13

SrNicolas commented 8 years ago

Calculate offset, real coords + random seed

gustavgenberg commented 8 years ago

@SrNicolas And how exactly do i do that ?

Sonicmaster13 commented 8 years ago

@GustavGenberg look at davidmanns client. Its in the window.agar.dimensionsUpdated

Barbosik commented 8 years ago

It's interesting question. If you know real border you can just calculate offset. Basically offset is equal to the center of the border.

But the most complicated thing is to detect the real border edges on a server which uses dynamic border update. I'm implemented class BorderScanner for such purposes. It is used to display map border and minimap in my own client. It may works in 3 different modes:

Mode 0: just use border received from server.

Mode 1: scan available map space by any cell coordinate/size. It's slow, because it shows only area which you already visited.

Mode 2: most complicated mode, it scans available map from different sources: border updates, any cell coordinate/size, known map size, etc. The main idea is to shift border rectangle according to observations and lock it when some conditions indicates that border limit is reached. It works well even with latest server updates (4.0.0).

Barbosik commented 8 years ago

MasonBurdette: no, in 4.0.0 dynamic border is used, this update was released yesterday. I'm using mode 0 for private servers which has static border. Mode 1 is slow but reliable, you cannot make protection from it. And mode 2 is incredibly fast, but sometimes it may get mistake, it's some kind of AI.

mayed505 commented 8 years ago

@MasonBurdette i got your skype please add me. i need to talk to you about something really important and you might like it.