Hello, my name is Devon and I'm an alcoholic...
Moving on.
~ Introduction:~
I recently left my job because Zellers is one of the shittiest places to work. EVER. (at least mine is) So after a few days kicking in the front seat and sitting in the back seat, i decided to do something productive. Something like teach you newbies more useful crap, in the hopes that one day you too will be useful.
This guide will be about a way to make a gather bot. It will be simple (it is your job to elaborate) but none the less it will (i hope) explain the fundamentals of creating gathering bot.
Again you need to know at least one programming language and be quite a bit experienced in it.
To start you will need:
1x knowledge of an object manager
1x A GetLocalPlayerXYZR function
1x A way to make your character run (waypoints are good)
1x common senses
-1x noobines
-1x trolling
Any help needed on making bots can be found here: http://www.mmowned.com/forums/world-...ete-newbs.html
Lets get started,
~XYZ:~
To start, lets go ahead and find the object in memory (our GetMemloc function) To do this, we must tell it to strictly search for Objects. We can do this by going through each object and checking the type to see if it is type 5
Note: you can also check it buy name or both.
Example:
Again referring to the dump thread, you can get the objects XYZ position. This will obviously help you get to your node that you want to collect.Code:Func GetObjectMemLoc() $NextObject = _MemoryRead("0x" & Hex($currMgr + $FirstObjectOffset), $wow, "dword") While (<= 7) $ObjType = _MemoryRead("0x" & Hex($NextObject + $GameObjTypeOffset), $wow, "dword") IF ($ObjType = 5) Then ;GetClosestNode endif $NextObject = _MemoryRead("0x" & Hex($NextObject + $NextObjectOffset), $wow, "dword") Wend Endfunc
In the dump, you will see an offset for an objects X location, as well as y and z, that equals this: x = '0x110, y = x + 0x4 , z = x + 0x8'. If we use this as well as get our local players position then we can calculate the distance between the two and get our player to run to the closest one.
It would look something like this:
After you have your positions for both the player, you can then calculate the closest one by doing this:Code:Global Const $ObjectPosXOffset = 0x110 Global Const $ObjectPosYOffset = 0x110 + 0x4 Global Const $ObjectPosZOffset = 0x110 + 0x8 Global Const $UnitPosXOffset = 0x898 Global Const $UnitPosYOffset = 0x898 + 0x4 Global Const $UnitPosZOffset = 0x898 + 0x8 Global Const $UnitRotationOffset = 0x8A8 Func _GetXYZR($GUID = $pGUID, $isObject = False) Local $pXYZR[4] $ObjectMemLoc = _GetPlayerMemLoc($GUID) If $isObject = True Then $pXYZR[0] = _MemoryRead("0x" & Hex($ObjectMemLoc + $ObjectPosXOffset), $wow, "float") $pXYZR[1] = _MemoryRead("0x" & Hex($ObjectMemLoc + $ObjectPosYOffset), $wow, "float") $pXYZR[2] = _MemoryRead("0x" & Hex($ObjectMemLoc + $ObjectPosZOffset), $wow, "float") $pXYZR[3] = 0 Else $pXYZR[0] = _MemoryRead("0x" & Hex($ObjectMemLoc + $UnitPosXOffset), $wow, "float") $pXYZR[1] = _MemoryRead("0x" & Hex($ObjectMemLoc + $UnitPosYOffset), $wow, "float") $pXYZR[2] = _MemoryRead("0x" & Hex($ObjectMemLoc + $UnitPosZOffset), $wow, "float") $pXYZR[3] = _MemoryRead("0x" & Hex($ObjectMemLoc + $UnitRotationOffset), $wow, "float") If $GUID = $pGUID Then If ($pXYZR[0] = 0 And $pXYZR[1] = 0) Then MsgBox(0x10, "Error", "Probably not in game") _EmergencyExit() EndIf EndIf EndIf Return $pXYZR EndFunc ;==>_GetXYZR
And...Code:Func _GetDistanceTarget($targetX, $targetY, $targetZ = False) $pXYZR = _GetXYZR() $pXPos = $pXYZR[0] $pYPos = $pXYZR[1] $pZPos = $pXYZR[1] If $targetZ = False Then $targetZ = 0 $pZPos = 0 EndIf $DistanceToTarget = Sqrt(($targetX - $pXPos) ^ 2 + ($targetY - $pYPos) ^ 2 + ($targetY - $pYPos) ^ 2) Return $DistanceToTarget EndFunc ;==>_GetDistanceTarget
Just a reminder that the above is only to locate the closest node to you. There is no actual movement. The movement is for you to figure out. You can do this buy checking the distance between your current position and the node vs. your next waypoint position and the node. There are other ways of doing it.Code:Func GetClosestNode $XYZR = _GetXYZR($GUID,True); Gets XYZ and Rotation of wowobject params "_GetXYZR(guid, isobject)" $dist = _GetDistanceTarget($XYZR[0], $XYZR[1]) If $dist <> 0 Then If $tempdist = "" Then $tempdist = $dist $tempguid = $GUID Else If $tempdist > $dist Then $tempdist = $dist $tempguid = $GUID EndIf EndIf EndIf Return $tempguid endfunc
~Collecting the node:~
This is fairly easy. All you have to do is set the GUID of the object into the MouseOverGUID address and then send the interact with mouse-over key (that you hot-keyed in key-bindings manually)
Something like this:
~Conclusion:~Code:Func _GatherLoot($ObjGUID) $name = _GetObjectName($ObjGUID) MsgBox(0,"",$name) ;MouseoverGUID = 0x99C6A8 _MemoryWrite($WoWBase + 0x99C6A8, $Wow, $ObjGUID, "UINT64") ;params "_memorywrite(address, handle, data, type)" ;T is my interact with mouse-over key ControlSend("World of Warcraft", "", "", "{T}") EndFunc ;==>_GatherLoot
The code above is only example code. It is very incomplete and if taken would probably give lots of errors. It is there just to show you by example. If there is anything that is erroneous please tell me and i will fix it quickly.
Also a quick thanks for all the people that post in the dump thread! You guys are amazing!
Also if you do not understand what i am talking about in this thread please look at my other guide: http://www.mmowned.com/forums/world-...ete-newbs.html