Hmm... did more testing today with a memoryscanner on the adr.
0x011384DC seems to be X, but the value is frozen all other places then dalaran?
The adr i have found seems to work everywhere:
X= 0x0131EC44
Y= 0x0131EC48
Hmm... did more testing today with a memoryscanner on the adr.
0x011384DC seems to be X, but the value is frozen all other places then dalaran?
The adr i have found seems to work everywhere:
X= 0x0131EC44
Y= 0x0131EC48
Done some memoryscanning and when coordinating my facing on map i came up with these numbers:
0->90 degrees: 0->0.999
90->180 degrees: 0.999->0
180->270 degrees:0->-0.999
270->360/0 degrees: -0.999->0
SO: if i was facing 45 degrees OR 135 degrees i cant seem to differ. I must bee reading the wrong value. But it seems correct as it corresponds with turning-around-movement.
maybe i'm wrong. i tested it a month ago.
so then it seems to be a tan of the current degree.
to get this value in degrees you should use arctan function.
ITT: math rapists.
Here's rather good man
Movement Shynd’s WoW Modification Journal
UPD:he lold us i guess
omg... do you need a math major to figure it out? been looking at the link, at it seems pretty straight forward and simple.
But there is something wrong, when i try to integrate it with my own code. "integrate", im really copying it and replacing tPos, pPos and his facing var with what i can read from memory.
facing should be radian as i understood. now: trying to point as close to 45 degree on minimap gives me a facing of 0.67484045028686523. (memscanner)
Degree makes more sence for me so i convert it: (facing*180)/Math.PI = 38.6 degree, so not so far from 45 degree! :-)
But then things get "#¤! up.
Turning again, to point my char to something about 260 degrees (almost straight south on minimap) my memory reads that facing is -0.91371572017669678.
Again i convert it to degree as it makes more sense for me(helps point out the obvious): -52 degrees.
Okey... thats where things stops making sense.
Could someone please point out the obvious as it must be in there somewhere![]()
Last edited by Shutzler; 09-17-2009 at 05:07 PM.
i dont exactly understand where your problem is, but here is a little snippet from my bot which does maybe help you:
x/y = local player coordinatesCode:private static double CalcAngle(double x, double y, double tx, double ty) { double xOffset = Math.Abs(tx - x); double yOffset = Math.Abs(ty - y); if(tx < x && ty < y) return Math.PI/2 + Math.Atan(xOffset / yOffset); if(tx < x) return Math.PI + Math.Atan(yOffset / xOffset); if(ty < y) return Math.Atan(yOffset / xOffset); return Math.PI*1.5 + Math.Atan(xOffset / yOffset); }
tx/ty = target coordinates
return value = the angle (in rad) you need to face to reach your target, you can just write this value to memory or you press your turn keys (you should check if turning left or right is shorter, else it could look a little stupid :P) until your char faces this angle
mnbvc: why so complicated?
(return value is in degrees)Code:public float GetAngle( float x, float y ) { float dx = x - this.x; float dy = y - this.y; float result = ( float )Math.Atan2( dy, dx ); result = ( float )( 180 * ( result / Math.PI ) ); return result; }
Shutzler: are you reading at correct address? For me this works just fine.
Code:public float Rotation { get { float result = process.Read<float>( Address.Offset( 0x7A8 ) ); result = ( float )( 180 * ( result / Math.PI ) ); return result; } }
Last edited by Kryso; 09-17-2009 at 06:45 PM.
and what do u do with the return value? it is definitely different from what my function returns :P
i created my function based on this picture, which i drew in the first step, could maybe help some more to understand the coord system
![]()
It is same as yours, just in degrees :-) If you prefer radians, just remove this line:
And if you need angle in 0° - 360°, you can simplyCode:result = ( float )( 180 * ( result / Math.PI ) );
or and equivalent for radians with PI * 2Code:if ( result < 0 ) result += 360;
Last edited by Kryso; 09-17-2009 at 07:42 PM. Reason: damn typo
ah, i didnt see the 2 behind the atan in your code ^^
well, just looked at msdn for it, internally it does the same what i do with my if/else, maybe i will change it
but i think for understanding how it works my function is quite good :P
My eternal question atm... am i? im reading my X, Y, Z and facing. with adr of X, then +0x4 on each of the x, y, z to get facing.
right now my bot is just spinning around, ONLY clockwise.
example of a point in AV: (360,846, -497,4867). The code above is from Movement Shynd’s WoW Modification JournalCode:float f = (float)Math.Atan2(target.posY - player.posY, target.posX - player.posX); double r, l; if (player.facing > f) { l = ((2 * Math.PI) - player.facing) + f; r = player.facing - f; } else { l = f - player.facing; r = player.facing + ((2 * Math.PI) - f); } if (l < r) { // PUSH D KEY } else { // PUSH A KEY }
Last edited by Shutzler; 09-18-2009 at 05:58 AM.