[QUESTION] Player x,y coords? menu

Shout-Out

User Tag List

Page 3 of 4 FirstFirst 1234 LastLast
Results 31 to 45 of 46
  1. #31
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Made a small c# form just to test. could someone look it over:

    Code:
            float player_x = 1; // Just rnd, for testing
            float player_y = 1; // Just rnd, for testing
     
            float target_x = 4; // Just rnd, for testing
            float target_y = 4; // Just rnd, for testing
     
            float facing = (float)0.5718; // Player facing NW-ish direction on wowminimap!
     
            public float GetAngle(float x, float y)
            {
                float dx = x - player_x;
                float dy = y - player_y;
                float result = (float)Math.Atan2(dy, dx);
                result = (float)(180 * (result / Math.PI));
                return result;
            }
     
            public float RadianToDegree(float rad)
            {
                float result = (float)((180 * (rad / Math.PI)));
     
                if (rad < 0)
                    result += 180;
     
                return result;
            }
     
            public void ShowMessage()
            {
                //MessageBox.Show("Facing angle: " + RadianToDegree(facing));
                //MessageBox.Show("Point angle: " + GetAngle(target_x, target_y));   
     
                float degre_to_turn = (RadianToDegree(facing) + GetAngle(target_x, target_y));
     
                if( degre_to_turn < 180 )
                    MessageBox.Show("Turn RIGHT: " + degre_to_turn);
                else
                    MessageBox.Show("Turn LEFT: " + degre_to_turn);
            }
     
            // OUTPUT(for these values):
            // Turn RIGHT: 77.76173

    [QUESTION] Player x,y coords?
  2. #32
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    its extremely poor to understand with all this rad/deg conversion, you should just stay at rad
    at the beginning i didnt think at this nice site: - Wolfram|Alpha where i can easily calculate with atan2

    so i drew a picture to understand it better:


    in both cases you can see that your result should be pi/4 rad or 45 degree
    -> remove these stupid conversions

  3. #33
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Shutzler View Post
    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.
    Mmm, actually its more like this

    float x
    float y
    float z
    4 bytes of something
    float rotation
    float pitch



    edit: did some testing, and those 4 bytes between Z and Rotation seem to be always 0 for me

    Also here is my movement code, maybe it will help you little bit (written in python, cuz my bot uses IronPython as scripting language):

    Code:
    class Moving:
    	def __init__( self, minDistance = 5, minAngle = 30 ):
    		self.MinDistance = minDistance
    		self.MinAngle = minAngle
    
    		self.__swDir = KeyboardSwitch()
    		self.__swMov = KeyboardSwitch()
    
    	def __GetDistance( self ):	
    		return World.Player.Position.GetDistance( self.X, self.Y ) 
    
    	def __GetRelativeAngle( self ):
    		angle = World.Player.Position.GetAngle( self.X, self.Y ) - World.Player.Rotation
    		if ( angle < -180 ):
    			angle += 360
    		if ( angle > 180 ):
    			angle -= 360
    		return angle
    
    	def __Mov( self ):
    		distance = self.__GetDistance()
    
    		if ( distance <= self.MinDistance ):
    			self.__swMov.Release()
    		else:
    			angle = self.__GetRelativeAngle()
    
    			if ( angle < -135 ):
    				self.__swMov.Release()
    			elif ( angle < -45 ):
    				self.__swMov.Push( Key.D )
    			elif ( angle < 45 ):
    				self.__swMov.Push( Key.W )
    			elif ( angle < 135 ):
    				self.__swMov.Push( Key.A )
    			else:
    				self.__swMov.Release()
    
    
    	def __Dir( self ):		
    		angle = self.__GetRelativeAngle()
    
    		if ( -self.MinAngle <= angle <= self.MinAngle ):
    			self.__swDir.Release()
    		else:
    			if ( angle > 0 ):
    				self.__swDir.Push( Key.Left )
    			else:
    				self.__swDir.Push( Key.Right )
    
    	def Go( self, x, y ):
    		self.X = x
    		self.Y = y
    
    		self.__Dir()
    		self.__Mov()
    
    
    mover = Moving()
    while ( True ):
    	mover.Go( 1335, -4424 )
    Last edited by Kryso; 09-18-2009 at 08:13 AM.

  4. #34
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First off i want to thank all repliers for replying Been a great help and shown great tolerance

    NOW:
    With updated adr to whats suppose to be rotation i still dont get it. Ill post a image to show my point:



    (both my "wrong" adr and updated offset from playerX from Kryso are both showing -1 -> 1 values as images shows. The difference is only that W = 0, instead of N)

    These are the values i get from the adr. And the orientation is minimap. North is north and West is West on the minimap ingame.

    But my point here is that 2 and 2 of the quadrants are having the same values. Like the same direction in SW quadrant and NW quadrant. 45 degrees in both of them would have the same value.. So i cant tell if char is facing 135 degrees or 255 degrees (E=0, W=180 in this orientation).

    Am i still reading the wrong values? If so, what am i suppose to read from 0->180 degrees? Guessing X*PI, as PI = 180 and X is value in adr?
    Last edited by Shutzler; 09-19-2009 at 03:54 AM.

  5. #35
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you post addresses your using?

    It should be

    North - 0
    West - 1.57
    South - 3.14
    East -4.71
    Last edited by Kryso; 09-19-2009 at 06:35 AM.

  6. #36
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Kryso View Post
    Could you post addresses your using?

    It should be

    North - 0
    West - 1.57
    South - 3.14
    East -4.71
    Im am using 0x131EC58, but since the values only go from -1 to 1, its the wrong one obviously.

    I found it when i found my Xpos(moving, scanning mem, movin, +++) as i earlier posted(x being 0x0131EC44).

  7. #37
    furang's Avatar Member
    Reputation
    19
    Join Date
    Jul 2009
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't remember the right address, but it just followed players coords as i remember.
    Its values changed from 0 to 6.28 when turning. You see what i mean?
    Guess it was [CurObject + 0x7E0]
    Last edited by furang; 09-19-2009 at 08:17 AM.
    i did it 4 lulz

  8. #38
    dekz's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #39
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IT HELPS ALOT HAVING THE RIGHT ADR!

    After scanning memory for a value between 0 - 6.3 (kryso's post on what values i should expect) i found it.

    Going to post them all:

    Player_PosX: 0x0131EC44
    Player_PosY: 0x0131EC48
    Placyer_facing: 0x0131EC5C

    These are statics, and work everytime i restart computer/wow.

    So now that i have all the data(and correct ones even) things work. A little "bottish" doh, as i use SendKey.Send("A") and SendKey.Send("D") for turning around. Googled it, but cant seem to find a key-press (not push-and-realeas-all-in-once like SendKey).

    How do you guys go about it? Is there a hold key function (with a release ofc) or do you write to that adr of facing to turn things around? Is it safe to do so?

    By the way, i cant seem to edit 0x0131EC5C with my memscanner application ( MHS), guessing it reads from another adr...
    Last edited by Shutzler; 09-20-2009 at 05:36 AM.

  10. #40
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I write my facing and then tap the turn key for 1ms in both directions. I'm sure there's a better way, but this works pretty well. Also. The X,Y,Z,Rotation,Health, and pretty much everything else player-related is dynamically allocated. You have to read through pointers to get it.

  11. #41
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't hope i get hated too much by reviving this problem of mine, but it is still existing. IM TRYING, but failing.

    Under is a screen of my problem:



    Data:
    Player: X= -9000, Y= -30, FACING= 0.04634 (char facing almost straight north ingame)

    Target: X= -8985, Y= -34

    "My" code:
    Code:
    double p1_x = DataFetcher.GetPlayerPosX();
                double p1_y = DataFetcher.GetPlayerPosY();
    
                double p2_x = waypoints[waypointindex].x;
                double p2_y = waypoints[waypointindex].y;
    
                double facing = DataFetcher.GetPlayerFacing();
    
                //get the angle to which we need to turn in order to face our target
                float f = (float)Math.Atan2(p2_y - p1_y, p2_x - p1_x);
    
                double r, l;
    
                //if our current facing angle, in radians, is greater than
                //the angle which we desire to face
                if (facing > f)
                {
                    //we'd have to turn past North if we're turning left
                    l = ((2 * Math.PI) - facing) + f;
                    //we don't have to turn past North if we're turning right
                    r = facing - f;
                }
                else
                {
                    //we don't have to turn past North if we're turning left
                    l = f - facing;
                    //we have to turn past North if we're turning right
                    r = facing + ((2 * Math.PI) - f);
                }
    
                //let's please turn in the direction where we have to spend
                //the least amount of time turning
                if (l < r)
                    string_test_var = "Turn left.  " + l + "  :  " + r;
                else
                    string_test_var = "Turn right.  " + l + "  :  " + r;
    *****
    The red line is where the message tips over from "Turn left...." and "Turn right...." and this red line SHOULD be straight on my point. BUT as we all can see: it aint and now i dont know what to do any longer, as i am noob.

    The code above is from shynds great blog Movement Shynd’s WoW Modification Journal , code: NoMorePasting.com

    Fixing this problem would make me really really happy

  12. #42
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just write the value you get from the atan() function to player facing. It works GREAT.

  13. #43
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Just write the value you get from the atan() function to player facing. It works GREAT.
    Yes, but to do that i need to know the location of player facing. I've just scanned the memory and found several locations, and the one i use is static...(there were more then one).

    Shynds tutorial points out that north is 0, so the value i found was static and seemed the logical one. But there are several values that differ a bit.

  14. #44
    Shutzler's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    48
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found the adr but it aint static... Is it part of player GUID?

  15. #45
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's at [[pBase + 0xD8]+0x20] or somewhere around there. Can't we sticky some constant offsets that don't change?

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. [QUESTION] player.spell(ID).charges = X
    By Kilorar in forum PE Support forum
    Replies: 3
    Last Post: 07-30-2015, 11:53 PM
  2. [Question] Player Offset: PowerType
    By DrakeFish in forum WoW Memory Editing
    Replies: 1
    Last Post: 02-23-2010, 10:15 PM
  3. a question about reading xyz coords
    By mcuncool in forum World of Warcraft General
    Replies: 0
    Last Post: 08-11-2009, 06:28 AM
  4. [QUESTION] Player GUID
    By waymirec in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 01-23-2009, 08:46 PM
  5. [question] Players online 2 realms
    By xaverz in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 06-01-2008, 11:01 AM
All times are GMT -5. The time now is 04:36 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search