WoW Memory EditingWoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwnedRead the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post
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...
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
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.