| | WoW Memory Editing WoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwned Read 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 |  | 
10-16-2009
| | Banned | | | Join Date: Apr 2009
Posts: 139
Nominated 2 Times in 1 Post Reputation: 6 Level up: 39%, 307 Points needed |  | | | Unit Coords... Okay im using this: Code: $tarread = _BMReadUInt($handle, $aTargetGUID)
If $tarread = 0 Then
_log("No GUID")
Sleep(10)
Else
$ObjectBase = _WoWGetObjectByGUID($handle, $tarread)
$nameread = _WoWGetName($handle, $ObjectBase)
If $nameread = "Stonetusk Boar" then
_Log("Mob Found: " & $nameread)
_Movemob($handle, _getObjectX($handle, $ObjectBase), _getObjectY($handle, $ObjectBase), $ObjectBase)
EndIf
EndIf
To get see if the unit is a Stonetusk Boar - Which works well.
Im using this to get the units X & Y: Code: Func _getObjectX($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xE8, "float"))
EndFunc ;==>_getObjectX
Func _getObjectY($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xEC, "float"))
EndFunc ;==>_getObjectY
Which I thought should work...
and this to move: Code: Func _Movemob($handle, $XCoord, $YCoord, $ObjectBase)
$desiredcoords = _WoWDistance(_getObjectX($handle, $ObjectBase),_getObjectY($handle, $ObjectBase))
Do
_BMWriteFloat($handle, $ClickToMove_Xpos, $XCoord)
_BMWriteFloat($handle, $ClickToMove_Ypos, $YCoord)
_BMWriteInt($handle, $ClickToMove_State, "4")
Until $desiredcoords < 5
_log("Attacking")
_Memorywrite($ClickToMove_Target, $handle, $ObjectBase, "byte[8]")
_BMWriteInt($handle, $ClickToMove + 0x1C, "7") ;interact
EndFunc ;==>_Movemob
Func _WoWDistance($cordx, $cordy)
$posx = _GetX($handle, $pBase)
$posy = _Gety($handle, $pBase)
$dis = Sqrt(($cordx - $posx) ^ 2 + ($cordy - $posy) ^ 2)
Return $dis
It seems that its grabbing incorrect X & Y locations...
Im using the following memory addresses: Code: Const $ClickToMove = 0x01297920 ;Updated
Const $ClickToMove_Xpos = 0x012979ac;Updated
const $ClickToMove_Ypos =0x012979b0;Updated
Const $ClickToMove_State = 0x0129793c;Updated
Const $aTargetGUID = 0x113d7a8;Updated
I think I am blind... the problem is probably staring me in the face... Any ideas?  for all helpers
Last edited by ashleyww; 10-16-2009 at 08:03 PM.
Reason: Added more code. Fixed Case's
| Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx. 
10-16-2009
| | New User | | | Join Date: Nov 2007
Posts: 9
Reputation: 1 Level up: 88%, 48 Points needed | | | | oh boy, copy and paste always messes me up too! .. why is everything case sensitive?
poop should be Poop. right? | 
10-16-2009
| | Banned | | | Join Date: Apr 2009
Posts: 139
Nominated 2 Times in 1 Post Reputation: 6 Level up: 39%, 307 Points needed |  | | Quote:
Originally Posted by tymezz oh boy, copy and paste always messes me up too! .. why is everything case sensitive?
poop should be Poop. right? | What? this isn't Copy & Paste... I did this my self. Autoit isn't Case sensitive.... | 
10-16-2009
| | New User | | | Join Date: Nov 2007
Posts: 9
Reputation: 1 Level up: 88%, 48 Points needed | | | | So why do you go from handle to Handle randomly? In any case, if you did all this yourself its pretty trivial to figure out whats wrong. Also autoit being case insensitive doesn't really help you maintain good programming practices.
edit: so as to not look like im randomly flaming, try debugging the main cause of the problem, specifically the functions that determine where to move to.
Last edited by tymezz; 10-16-2009 at 07:46 PM.
| 
10-16-2009
| | Banned | | | Join Date: Apr 2009
Posts: 139
Nominated 2 Times in 1 Post Reputation: 6 Level up: 39%, 307 Points needed |  | | Quote:
Originally Posted by tymezz So why do you go from handle to Handle randomly? In any case, if you did all this yourself its pretty trivial to figure out whats wrong. Also autoit being case insensitive doesn't really help you maintain good programming practices. | Ill fix the Case's now then... It doesn't matter though... If you know what's up, while not help and earn some rep. | 
10-16-2009
| | New User | | | Join Date: Nov 2007
Posts: 9
Reputation: 1 Level up: 88%, 48 Points needed | | | Quote:
Originally Posted by ashleyww Ill fix the Case's now then... It doesn't matter though... If you know what's up, while not help and earn some rep. | I'll give you hints to help you be more efficient but not spoonfeed you completely,
take a look at movetomob, youre passing objectbase and doing nothing with it, why? ive seen a bunch of your posts and I really think you need to pick up a good programming book. | 
10-16-2009
| | Banned | | | Join Date: Apr 2009
Posts: 139
Nominated 2 Times in 1 Post Reputation: 6 Level up: 39%, 307 Points needed |  | | Quote:
Originally Posted by tymezz I'll give you hints to help you be more efficient but not spoonfeed you completely,
take a look at movetomob, youre passing objectbase and doing nothing with it, why? ive seen a bunch of your posts and I really think you need to pick up a good programming book. |
Because when I post all my code I am asking to be spoon fed... Which is not what I want...
Ive added some more code now... Maybe that can help find the problem | 
10-17-2009
| | New User | | | Join Date: Nov 2007
Posts: 9
Reputation: 1 Level up: 88%, 48 Points needed | | | | Just following up on my promise, hopefully you're learning better programming practices from a good book or through other sources.
Anyway, your next step is learning how to debug. You're half way there, almost all of your questions and posts you've made can be answered on your own through debugging (Even if you are a beginner). Notice your code has what we call debug output, it's a wonderful thing. What's next? Add more.
You could bash your head against a wall of code, or read debug output and see where things are going wrong.
Don't take this the wrong way, you're very hard headed. It's a good thing in this case though, atleast you keep trying, I'm pretty sure you could eventually do what you want on your own. | 
10-17-2009
|  | Corporal | | | Join Date: Aug 2009
Posts: 29
Nominated 5 Times in 1 Post Reputation: 56 Level up: 11%, 623 Points needed |     | | Code: Func _getObjectX($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xE8, "float"))
EndFunc ;==>_getObjectX
Func _getObjectY($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xEC, "float"))
EndFunc ;==>_getObjectY
Thats the problem:
0xEC & 0xE8 arnt the unit xyz offsets
Here are the right ones:
const $UnitX = 0x798 ; tested 
const $UnitY = 0x79C ; tested 
const $UnitZ = 0x7A0 ; tested
But i give you a tip... learn a "real" language... AutoIt is crap...
Last edited by Xeranor; 10-17-2009 at 07:08 AM.
| 
10-17-2009
| | New User | | | Join Date: Nov 2007
Posts: 9
Reputation: 1 Level up: 88%, 48 Points needed | | | | I agree with the AutoIt is crap statement, same goes for any scripting language.
Thing is with beginners like ashleyww, you either teach him/her to fish or you keep feeding him/her fish.
Ashleyww knew she was getting incorrect coordinates, but didn't know what to do about it. Her blanket "getObject" functions are correct for something other than unit coordinates.
Her real question was about offsets, as such she should have asked how to find them herself. (But first needs to recognize what exactly she needs). | 
10-17-2009
| | Banned | | | Join Date: Apr 2009
Posts: 139
Nominated 2 Times in 1 Post Reputation: 6 Level up: 39%, 307 Points needed |  | | Quote:
Originally Posted by Xeranor Code: Func _getObjectX($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xE8, "float"))
EndFunc ;==>_getObjectX
Func _getObjectY($handle, $curobject)
Return Floor(_BMReadMemory($handle, $curobject + 0xEC, "float"))
EndFunc ;==>_getObjectY
Thats the problem:
0xEC & 0xE8 arnt the unit xyz offsets
Here are the right ones:
const $UnitX = 0x798 ; tested 
const $UnitY = 0x79C ; tested 
const $UnitZ = 0x7A0 ; tested
But i give you a tip... learn a "real" language... AutoIt is crap... | OMG I feel retarded! I forgot mobs are units not objects! | 
10-17-2009
|  | Kynox's sister's pimp Legendary User | | | Join Date: Apr 2006 Location: ntdll.dll
Posts: 4,180
Nominated 63 Times in 4 Posts  TOTM/W Award(s): 1 Reputation: 1085 Points: 55,512, Level: 35 | Level up: 14%, 3,188 Points needed |     | | | Mobs ARE objects because Units are Objects. The WoW objects are set up in a classic OOP object hierarchy. Unit derives from Object and hence a Unit "is-a" Object.
Whilst the lowest type in the hierarchy when it comes to mobs is obviously Unit, that doesn't mean it's not an Object. | 
10-17-2009
|  | Contributor | | | Join Date: May 2008 Location: QLD, Australia
Posts: 617
Nominated 13 Times in 3 Posts Reputation: 299 Points: 11,415, Level: 13 | Level up: 32%, 885 Points needed |     | | Quote:
Originally Posted by ashleyww OMG I feel retarded! I forgot mobs are units not objects! | I lol'd. Fail.
__________________ IMMA FIRIN' MAH FOOBARZ!! | 
4 Weeks Ago
|  | Sergeant | | | Join Date: Feb 2009
Posts: 63
Reputation: 5 Level up: 28%, 360 Points needed |   | | | $desiredcoords = _WoWDistance(_getObjectX($handle, $ObjectBase),_getObjectY($handle, $ObjectBase))
Do
_BMWriteFloat($handle, $ClickToMove_Xpos, $XCoord)
_BMWriteFloat($handle, $ClickToMove_Ypos, $YCoord)
_BMWriteInt($handle, $ClickToMove_State, "4")
Until $desiredcoords < 5
---
hm? The $distance is declared to the start at the pulling range and $distance will never change from PullRange to less then 5.
Do you understand?:P(abit bad at explaining)
This will work better:P
-----
Do
_BMWriteFloat($handle, $ClickToMove_Xpos, $XCoord)
_BMWriteFloat($handle, $ClickToMove_Ypos, $YCoord)
_BMWriteInt($handle, $ClickToMove_State, "4")
Until $desiredcoords = _WoWDistance(_getObjectX($handle, $ObjectBase),_getObjectY($handle, $ObjectBase)) < 5 | 
4 Weeks Ago
| | New User | | | Join Date: Nov 2007
Posts: 9
Reputation: 1 Level up: 88%, 48 Points needed | | | | |  |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | All times are GMT -4. The time now is 09:06 PM. |