[HELP] Skipping waypoint that are on South-East menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] Skipping waypoint that are on South-East

    YoYo,
    I made some kinda crappy waypoint bot, so far so good it walks to the next ones, but he thinks he is already there when the next Waypoints are on southeast only... :confused:

    here's my approach
    Code:
                    float DistanceToCheck = 0.5f;
    
                    getxyz();
                    float xDistance = NextXWaypoint - XValue;
                    float yDistance = NextYWaypoint - YValue;
    
                    if (xDistance < DistanceToCheck)
                    {
                        if (yDistance < DistanceToCheck)
                        {
                            MoveToNextWaypoint();                       
                        }
                    }
    XValue is the X of my char currently, same goes for YValue.

    Someone that can help me? :wave:


    [HELP] Skipping waypoint that are on South-East
  2. #2
    Xarg0's Avatar Member
    Reputation
    61
    Join Date
    Jan 2008
    Posts
    389
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
     
    if(sqrt(pow(NextXWaypoint - XValue,2))+pow(NextYWaypoint - YValue,2))<DistanceToCheck)
    {
           MoveToNextWaypoint();
    }
    l2calculate...
    this is very basic math
    I hacked 127.0.0.1

  3. #3
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Xarg0 View Post
    Code:
     
    if(sqrt(pow(NextXWaypoint - XValue,2))+pow(NextYWaypoint - YValue,2))<DistanceToCheck)
    {
           MoveToNextWaypoint();
    }
    l2calculate...
    this is very basic math
    Thanks! +Rep I'm not good with maths... :'(


  4. #4
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by FartBlast View Post
    Thanks! +Rep I'm not good with maths... :'(
    But its REALLY, REALLY easy math

    http://en.wikipedia.org/wiki/Pythagorean_theorem

  5. #5
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you know how the coordinate system works in wow? ie. do you know which way x/y increases? Last time I checked X increased to the left (..weird) and Y increases up..normal
    ^
    |
    <--------------------|

    Basically any time you do any calculation for positions you have to be aware of negative/positive --> ie. if they're to your LEFT , their X is greater than yours..BUT if they're on the right, their x is less...depending on the code you use, it might mess up when it gets a - and it expects a +..just speaking from experience. Since you used MyX-pointX ...sometimes that'll be --, sometimes ++..you agree? Personally I draw it all out on paper and sub in small test values being sure to check all cases (my x is larger..smaller..the same, etc)

    you might make a function like..

    DistanceBetweenPoints(x1,y1,x2,y2) you'll need to calculate distance for other things like....is the mob in a group? ..and it'll be easier if you have a function vs. trying to re-write the getObjDist code every time
    hope this helps

  6. #6
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    my GetObjDist code

    If px2 > px1 Then
    v1 = px2 - px1
    If py2 > py1 Then
    v2 = py2 - py1
    End If
    Else
    v1 = px1 - px2
    If py2 > py1 Then
    v1 = py2 - py1
    Else
    v1 = py1 - py2
    End If
    End If
    distance = ((v1 ^ 2 + v2 ^ 2)) ^ 0.5
    Return distance

    Ok, so this might not be the fastest way to calculate distance..but it works.

    Basically you create a right-triangle who's base is the X distance between the 2 points and the height is the Y distance between . Depending on who's above/below this might make the base/height negative..so I use a couple of IF's to see who's is larger, and then subtract the smaller from the larger. I guess you could use | | absolute value to make it always positive..but I don't. Hope this helps.

  7. #7
    fish2k's Avatar Member
    Reputation
    5
    Join Date
    Nov 2008
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    v1 = py1 - py2 = -(py2 - py1)
    =>
    v1^2 = (py1 - py2)^2 = (py2 - py1)^2
    => you can throw away your if cases and use the code Xarg0 already posted

  8. #8
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is not the math help section.

Similar Threads

  1. Help!! my npc's are green
    By SuperNinjaBob in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 07-10-2007, 11:44 AM
  2. Videos that are teh sex
    By Cheezeit117 in forum Community Chat
    Replies: 10
    Last Post: 05-08-2007, 07:04 AM
  3. Fraps help / sumthing liek that needed :'<
    By Itazuki in forum Community Chat
    Replies: 3
    Last Post: 03-23-2007, 04:14 PM
  4. ANY models that are confirmed to work in 1.12.x
    By Evangelista in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 01-14-2007, 08:14 AM
  5. Addons that are very helpful
    By general_salsa in forum World of Warcraft Guides
    Replies: 8
    Last Post: 11-07-2006, 10:59 PM
All times are GMT -5. The time now is 05:42 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