The very first reason is that vanilla WoW is probably the only game I stil play in my spare time. Its a part of my childhood and in conclusion associated with many good memories. Things were more time consuming and rewarding. It wasnt designed to give even the biggest noob a feeling of success. Flying mounts werent implemented which is a big plus for me since I love world PvP. There was no dungeon finder nor teleports to dungeon. It was more about the community to organise things and not some mechanism like LFR doing all the work. Since you actually need to travel in vanilla WoW the whole world feels more populated and not only centered around a few zones like it is on retail.
In general: "hard" games > casual games
Beside from all those gameplay related arguments there are also some reasons why I choose to write the tutorial for 1.12.1:
Retail WoW is constantly evolving. Writing a long tutorial about coding a bot for an executable which is constantly changing is just a waste:
People cant work with the code snippets provided after an update since many memory addresses aswell mechanics change with patches.
I dont expect that this tutorial series would be done within one patch which would mean updating old posts over and over again to make them fit with the newest update. Using 1.12.1 we have all time we need (me with writing those posts aswell you understanding what is happening)
There are dozen projects (like Kronos) running a server supporting the 1.12.1 client.
With that being said: Im not a professional programmer so dont expect my solutions to be the best. Just take it as a inspiration to do it better :).
Lets get started?
My bot basically consists of two parts:
One thread obtaining all informations (Cooldowns, Objects around the player etc.)
Another thread evaluating the obtained infos and choosing what to do depending on whats going on (resting, fighting, ghost walking, searching a new target, vendoring, going to the next target etc.)
Today we will learn how to obtain informations about objects around the player or to be more exact: Items, containers, units, players, gameobjects, dynamicobjects and corpses.
Every object around our player is an object in memory. The objectmanager is basically a list holding pointers to all those objects. Each object contains fields about informations belonging to the object like the x, y and z coordinates aswell the type of the object and a pointer to the next object.
So what we do? Read the objectmanager from the first to the last object and save them.
1. Addresses we need to know (those are obtained with a alpha patchdiff):
4. Now that we obtained the first object in the list we can read its type and decide what to do next depending on the result:
uint curObjType = BmWrapper.mem.ReadByte(curObj + objType);
switch (curObjType)
{
case (byte)ObjTypes.OT_CONTAINER:
// Do something
break;
case (byte)ObjTypes.OT_PLAYER:
// Do something
break;
case (byte)ObjTypes.OT_UNIT:
// Do something
break;
case (byte)ObjTypes.OT_GAMEOBJ:
// Do something
break;
case (byte)ObjTypes.OT_CORPSE:
// Do something
break;
}
5. After processing the first object its time to get the next in line. If the pointer to the next object is 0 or equal to the pointer to the current object we arrived at the end of the list:
while (curObj != 0 && (curObj & 1) == 0)
{
// Do stuff with current object here
nextObj = BmWrapper.mem.ReadUInt(curObj + nextObjPtr);
if (nextObj == curObj)
{
break;
}
else
{
curObj = nextObj;
}
}
6. The current code doesnt fulfill any need: We dont process the objects nor we save them but thats not important for the moment. This post is just proof of concept or better said a showcase how we iterate over the objectmanager.
In the next few episodes we will learn what we can do with all those objects.
Final words:
I will release a sample command line program every new post to demonstrate the current progress.
With the current state we can archiv a basic output:
A sample ObjectManager by http://zzuks.blogspot.ch
Attaching to pid: 3044
Starting ObjectManager ...
Found a object of type OT_ITEM at 0x19AC0008
Found a object of type OT_ITEM at 0x19AC049C
Found a object of type OT_ITEM at 0x19AC0930
Found a object of type OT_ITEM at 0x19AC0DC4
Found a object of type OT_CONTAINER at 0x15950008
Found a object of type OT_ITEM at 0x19AC1258
Found a object of type OT_CONTAINER at 0x15950A7C
Found a object of type OT_CONTAINER at 0x159514F0
Found a object of type OT_CONTAINER at 0x15951F64
Found a object of type OT_ITEM at 0x19AC16EC
Found a object of type OT_ITEM at 0x19AC1B80
Found a object of type OT_ITEM at 0x19AC2014
Found a object of type OT_CONTAINER at 0x159529D8
Found a object of type OT_CONTAINER at 0x1595344C
Found a object of type OT_PLAYER at 0x14CD8008
Found a object of type OT_GAMEOBJ at 0x130F0008
Found a object of type OT_GAMEOBJ at 0x130F0318
Found a object of type OT_GAMEOBJ at 0x130F0938
Found a object of type OT_UNIT at 0x18CC0008
Found a object of type OT_GAMEOBJ at 0x130F0C48
Found a object of type OT_GAMEOBJ at 0x130F0F58
Found a object of type OT_GAMEOBJ at 0x130F1268
Found a object of type OT_GAMEOBJ at 0x130F1578
Found a object of type OT_GAMEOBJ at 0x130F1888
Found a object of type OT_GAMEOBJ at 0x130F1B98
Found a object of type OT_UNIT at 0x18CC3C08
Found a object of type OT_UNIT at 0x18CC5008
Found a object of type OT_UNIT at 0x18CC6408
Found a object of type OT_UNIT at 0x18CC7808
Found a object of type OT_UNIT at 0x18CC8C08
Found a object of type OT_GAMEOBJ at 0x130F1EA8
Found a object of type OT_GAMEOBJ at 0x130F21B8
Found a object of type OT_GAMEOBJ at 0x130F24C8
Found a object of type OT_GAMEOBJ at 0x130F27D8
Found a object of type OT_UNIT at 0x18CCB408
Found a object of type OT_GAMEOBJ at 0x130F2AE8
Found a object of type OT_GAMEOBJ at 0x130F2DF8
Found a object of type OT_GAMEOBJ at 0x130F3108
Found a object of type OT_GAMEOBJ at 0x130F3418
Found a object of type OT_GAMEOBJ at 0x130F3728
Found a object of type OT_UNIT at 0x18CCDC08
Found a object of type OT_UNIT at 0x18CCF008
Found a object of type OT_UNIT at 0x18CD0408
Found a object of type OT_UNIT at 0x18CD1808
Found a object of type OT_UNIT at 0x18CD2C08
Found a object of type OT_UNIT at 0x18CD4008
Found a object of type OT_CORPSE at 0x16238008
Found a object of type OT_GAMEOBJ at 0x130F3A38
Found a object of type OT_GAMEOBJ at 0x130F3D48
Found a object of type OT_GAMEOBJ at 0x130F4058
Found a object of type OT_GAMEOBJ at 0x130F4368
Found a object of type OT_GAMEOBJ at 0x130F4678
Found a object of type OT_GAMEOBJ at 0x130F4988
Found a object of type OT_GAMEOBJ at 0x130F4C98
Found a object of type OT_GAMEOBJ at 0x130F4FA8
Found a object of type OT_GAMEOBJ at 0x130F52B8
Found a object of type OT_GAMEOBJ at 0x130F55C8
Found a object of type OT_GAMEOBJ at 0x130F58D8
Found a object of type OT_UNIT at 0x18CD5408
Found a object of type OT_UNIT at 0x18CD6808
Found a object of type OT_UNIT at 0x18CD7C08
Found a object of type OT_UNIT at 0x18CD9008
Found a object of type OT_UNIT at 0x18CDA408
Found a object of type OT_UNIT at 0x18CDB808
Found a object of type OT_UNIT at 0x18CDCC08
Found a object of type OT_CORPSE at 0x16238370
Found a object of type OT_GAMEOBJ at 0x130F5BE8
Found a object of type OT_GAMEOBJ at 0x130F5EF8
Found a object of type OT_GAMEOBJ at 0x130F6208
Found a object of type OT_GAMEOBJ at 0x130F6518
Found a object of type OT_GAMEOBJ at 0x130F6828
Found a object of type OT_GAMEOBJ at 0x130F6B38
Found a object of type OT_GAMEOBJ at 0x130F6E48
Found a object of type OT_GAMEOBJ at 0x130F7158
Found a object of type OT_GAMEOBJ at 0x130F7468
Found a object of type OT_GAMEOBJ at 0x130F7778
Found a object of type OT_GAMEOBJ at 0x130F7A88
Found a object of type OT_GAMEOBJ at 0x130F7D98
Found a object of type OT_UNIT at 0x18CDE008
Found a object of type OT_UNIT at 0x18CDF408
Found a object of type OT_GAMEOBJ at 0x130F80A8
Found a object of type OT_GAMEOBJ at 0x130F83B8
Found a object of type OT_UNIT at 0x18CE0808
Found a object of type OT_GAMEOBJ at 0x130F86C8
Found a object of type OT_GAMEOBJ at 0x130F89D8
Found a object of type OT_UNIT at 0x18CE1C08
Found a object of type OT_GAMEOBJ at 0x130F8CE8
Found a object of type OT_GAMEOBJ at 0x130F8FF8
Found a object of type OT_GAMEOBJ at 0x130F9308
Found a object of type OT_GAMEOBJ at 0x130F9618
Found a object of type OT_GAMEOBJ at 0x130F9928
Found a object of type OT_GAMEOBJ at 0x130F9C38
Found a object of type OT_GAMEOBJ at 0x130F9F48
Found a object of type OT_PLAYER at 0x1B3D58A0
Found a object of type OT_PLAYER at 0x1B3D84EC
Found a object of type OT_PLAYER at 0x1B3DDD84
Found a object of type OT_PLAYER at 0x1B3E361C
Found a object of type OT_PLAYER at 0x1B401D60
Found a object of type OT_PLAYER at 0x1B4049AC
Found a object of type OT_PLAYER at 0x1B4075F8
Found a object of type OT_PLAYER at 0x1B40A244
Found a object of type OT_UNIT at 0x18CE5808
Found a object of type OT_CORPSE at 0x162386D8
Found a object of type OT_CORPSE at 0x16238A40
Found a object of type OT_CORPSE at 0x16238DA8
Found a object of type OT_CORPSE at 0x16239110
Found a object of type OT_CORPSE at 0x16239478
Found a object of type OT_PLAYER at 0x1B41AC0C
Found a object of type OT_PLAYER at 0x1B4230F0
Found a object of type OT_PLAYER at 0x1B425D3C
Found a object of type OT_PLAYER at 0x1B430E6C
Found a object of type OT_PLAYER at 0x1B436704
Found a object of type OT_UNIT at 0x18CE8008
Found a object of type OT_PLAYER at 0x1B43BF9C
Found a object of type OT_CORPSE at 0x162397E0
Found a object of type OT_PLAYER at 0x1B3F6C30
Found a object of type OT_PLAYER at 0x1B441834
Found a object of type OT_PLAYER at 0x1B3E6268
Found a object of type OT_UNIT at 0x18CF2008
Found a object of type OT_PLAYER at 0x1B47E6BC
Found a object of type OT_PLAYER at 0x1B3EBB00
Found a object of type OT_PLAYER at 0x1B45D32C
Found a object of type OT_UNIT at 0x18CEE408
Found a object of type OT_UNIT at 0x18CED008
Found a object of type OT_UNIT at 0x18CE6C08
Found a object of type OT_UNIT at 0x18CEA808
Found a object of type OT_PLAYER at 0x1B3F3FE4
Found a object of type OT_PLAYER at 0x1B47358C
Found a object of type OT_PLAYER at 0x1B3EE74C
Found a object of type OT_PLAYER at 0x1B478E24
Found a object of type OT_PLAYER at 0x1B3D2C54
Found a object of type OT_PLAYER at 0x1B454E48
Found a object of type OT_PLAYER at 0x1B46B0A8
Found a object of type OT_PLAYER at 0x1B3FC4C8
Found a object of type OT_PLAYER at 0x1B465810
Found a object of type OT_PLAYER at 0x1B3D0008
Found a object of type OT_PLAYER at 0x1B4470CC
Found a object of type OT_PLAYER at 0x1B46DCF4
Found a object of type OT_PLAYER at 0x1B45FF78
Found a object of type OT_PLAYER at 0x1B449D18
Found a object of type OT_PLAYER at 0x1B462BC4
Found a object of type OT_PLAYER at 0x1B3E8EB4
Found a object of type OT_PLAYER at 0x1B3FF114
Found a object of type OT_PLAYER at 0x1B44C964
Found a object of type OT_PLAYER at 0x1B47BA70
Found a object of type OT_UNIT at 0x18CC1408
Found a object of type OT_PLAYER at 0x1B43EBE8
Found a object of type OT_PLAYER at 0x1B45A6E0
Found a object of type OT_UNIT at 0x18CF3408
Found a object of type OT_PLAYER at 0x1B44F5B0
Found a object of type OT_GAMEOBJ at 0x130F0628
Found a object of type OT_PLAYER at 0x1B417FC0
Found a object of type OT_PLAYER at 0x1B428988
Found a object of type OT_PLAYER at 0x1B3F1398
Found a object of type OT_UNIT at 0x18CCA008
Found a object of type OT_UNIT at 0x18CEBC08
Found a object of type OT_PLAYER at 0x1B4204A4
Found a object of type OT_PLAYER at 0x1B457A94
Found a object of type OT_GAMEOBJ at 0x130FA258
Found a object of type OT_UNIT at 0x18CF4808
Found a object of type OT_GAMEOBJ at 0x130FA878
Found a object of type OT_PLAYER at 0x1B412728
Found a object of type OT_PLAYER at 0x1B46845C
Keine Kommentare:
Kommentar veröffentlichen