Get Magic or better menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Diablo3Bot's Avatar Corporal
    Reputation
    3
    Join Date
    Jul 2012
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get Magic or better

    After a few weeks off from working on this I'm back at it. I got everything updated for the 1.04 patch (i believe).

    I am trying to find out if an item is magic or better. I think the problem is in my IterateActorAtribs function. I ported this from Autoit to C#. It got a little messy during testing, but what happens is the second time through the loop the pointers look screwed up.

    Am I doing this correctly, is there an easier way to findout if the item is magic or better?

    Code:
    private int IterateActorAtribs(uint GUID, ActorAttribute requirement)
            {
                List<ObjectDetails> localActors = new List<ObjectDetails>();
                int atribVal = -1;
                int cnt = (int)m_memoryReader.Readuint(ActorAtrib_Count);
                int ACDIndex = 0;
                uint currentOffset = ActorAtrib_4;
                uint ActorAtrib = 0;
                uint test = 0;
                uint data = 0;
                uint AtribData = 0;
    
                // get all of the local actors
                localActors = IterateLocalActor();
    
                // get the desired local actor
                for(int i = 0; i < localActors.Count; i++)
                {
                    if (localActors[i].GUID == GUID)
                    {
                        ACDIndex = i;
                        i = localActors.Count;
                    }
                }
                
                // go through each of the attributes
                for (int i = 0; i < cnt; i++)
                {
                    ActorAtrib = m_memoryReader.Readuint(currentOffset);
    
                    //see if this is the desired attribute
                    if (ActorAtrib == localActors[ACDIndex].Data1)
                    {
                        test = m_memoryReader.Readuint(currentOffset + 0x10);
                        currentOffset = test;
                        for (int j = 0; j < 825; j++)
                        {
                            data = m_memoryReader.Readuint(currentOffset);
                            currentOffset += 0x04;
                            if (data != 0x00)
                            {
                                // read the value of the attribute
                                AtribData = m_memoryReader.Readuint(data + 0x04);
                                if ((AtribData & 0xFFFFF000) == 0xFFFFF000)
                                {
                                    if ((AtribData & 0x00000FFF) == requirement.offset)
                                    {
                                        if (requirement.type == typeof(int))
                                        {
                                            atribVal = (int)m_memoryReader.Readuint(data + 0x08);
                                        }
                                        else
                                        {
                                            atribVal = (int)m_memoryReader.Readfloat(data + 0x08);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    currentOffset += ofs_ActorAtrib_StrucSize;
                }
    
                return (atribVal);
            }
    Thanks

    Get Magic or better
  2. #2
    Diablo3Bot's Avatar Corporal
    Reputation
    3
    Join Date
    Jul 2012
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am still struggling with the magic or better I have found a few different functions online but none of them seem to work. The code below is from d3adventure and should be faster than the one I posted above, but no matter the attribute I search for it always returns 0.
    Code:
    public static T GetAttributeShadwd<T>(uint FagGuid, uint attribute_index) where T : struct
            {
                IntPtr fagPtr = AcdToFAG((int) FagGuid);
                if (fagPtr == IntPtr.Zero) return default(T);
    
                IntPtr attrPtr = GetAttribute(fagPtr, attribute_index);
                if (attrPtr == IntPtr.Zero) return default(T);
    
                return mem.ReadMemory<T>(attrPtr);
            }
    
            private static IntPtr GetAttribute(IntPtr fagPtr, uint attribute_index)
            {
                attribute_index = attribute_index | 0xFFFFF000;
    
                int _38 = mem.ReadMemoryAsInt((uint) fagPtr + 0x38);
                int _c8 = mem.ReadMemoryAsInt((uint) fagPtr + 0xC8);
                var v4 = (int) (_c8 & (attribute_index ^ (attribute_index >> 0x10)));
                v4 = (_38 + 4*v4);
    
                v4 = mem.ReadMemoryAsInt((uint) v4);
                if (v4 != 0)
                {
                    while (mem.ReadMemoryAsUint((uint) (v4 + 4)) != attribute_index)
                    {
                        v4 = mem.ReadMemoryAsInt((uint) (v4));
                        if (v4 == 0)
                            goto NEXT_SCAN;
                    }
    
                    return (IntPtr) v4 + 8;
                }
    
                NEXT_SCAN:
                int _10 = mem.ReadMemoryAsInt((uint) (fagPtr + 0x10));
                int _8 = mem.ReadMemoryAsInt((uint) (_10 + 0x8));
                int _418 = mem.ReadMemoryAsInt((uint) (_10 + 0x418));
    
                var v5 = (int) (_418 & (attribute_index ^ (attribute_index >> 0x10)));
                int _res = (_8 + 4*v5);
                v5 = mem.ReadMemoryAsInt((uint) _res);
                if (v5 != 0)
                {
                    while (mem.ReadMemoryAsUint((uint) (v5 + 4)) != attribute_index)
                    {
                        v5 = mem.ReadMemoryAsInt((uint) (v5));
                        if (v5 == 0)
                            return IntPtr.Zero;
                    }
                    return (IntPtr) v5 + 8;
                }
    
                return IntPtr.Zero;
            }
    
            //These are direct translations of D3s lookup methods. This might need to stay in sync if they make code changes to it.
            //or if the structure offsets change.
            public static IntPtr AcdToFAG(int FagGuid)
            {
                int result = 0;
                uint objMgr = mem.ReadMemoryAsUint(Offsets.objectManager);
                uint ptr = mem.ReadMemoryAsUint(objMgr + (0x844));
                ptr = mem.ReadMemoryAsUint(ptr + 0x70);
    
    
                uint max = mem.ReadMemoryAsUint(ptr + 0x100);
                int size = 0x180;
    
                if ((FagGuid & 0xFFFF) < max)
                {
                    int _148 = mem.ReadMemoryAsInt(ptr + 0x148);
                    int _18c = mem.ReadMemoryAsInt(ptr + 0x18c);
    
                    int a = (_148 + 4*0);
                    int b = (size*(FagGuid & ((1 << _18c) - 1)));
    
                    int v3 = mem.ReadMemoryAsInt((uint) (a)) + b;
                    result = v3 & -1;
                }
    
                return (IntPtr) result;
            }
    Are some of the values wrong in this? I have stepped through it and followed the pointers etc with cheat engine, but I never seem to find the attribute data.

    This is the last thing I need for my bot, I have it working for every other process other wise. Currently it is looting every drop, and because of this my toon always seems to be running to town.

  3. #3
    infotech1's Avatar Member
    Reputation
    3
    Join Date
    Jan 2007
    Posts
    43
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure your passing the Correct GUID. and using the updated 1.0.4 attribute ID's.

  4. #4
    peterk's Avatar Private
    Reputation
    1
    Join Date
    Jul 2012
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you see post #5 in http://www.ownedcore.com/forums/diab...hp-1-04-a.html (Get monsters HP in 1.04) from AGPS?

    i also increased the loopcount from 0 - 825 (you only go to 824?) to 0 - 0x3e4 for the new Attributes in 1.04.

    Peter

  5. #5
    Diablo3Bot's Avatar Corporal
    Reputation
    3
    Join Date
    Jul 2012
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Infotech1 - I am pretty sure I have updated the addresses correctly for the 1.04 patch.
    Peterk – I did see that post and modified my code to follow it.

    My offsets etc are as follows: (I believe I have all of the address correct for the 1.04 patch)

    Code:
    private const uint mainCharID = 0x77BC0000;
    
            private const uint ofs_ObjectManger = 0x1543B9C;
            private const uint ofs_objmanagerActorOffsetA = 0x8b0;
            private const uint ofs_objmanagerActorCount = 0x108;
            private const uint ofs_objmanagerActorOffsetB = 0x148;
            private const uint ofs_objmanagerActorLinkToCTM = 0x380;
            private const uint objmanagerStrucSize = 0x428;
    
            private const uint ofs_Interact = 0x1543B84;
            private const uint ofs_interactOffsetA = 0xA8;
            private const uint ofs_interactOffsetB = 0x58;
            private const uint ofs_interactOffsetUNK1 = 0x7F20; // set to 777C
            private const uint ofs_interactOffsetUNK2 = 0x7F44; // set to 1 for NPC interaction
            private const uint ofs_interactOffsetUNK3 = 0x7F7C; // set to 7546 for NPC interaction, 7545 for loot interaction
            private const uint ofs_interactOffsetUNK4 = 0x7F80; // set to 7546 for NPC interaction, 7545 for loot interaction
            private const uint ofs_interactOffsetMousestate = 0x7F84; // mouse state 1 = clicked, 2 = mouse down
            private const uint ofs_interactOffsetGUID = 0x7F88; // set to the GUID of the actor you want to interact with
    
            private const uint LevelAreaId = 0x01717244;
            private const uint ofs_CurLevelID = 0x810;
    
            private const uint ofs_ActorAtrib_Base = 0x01544E54;
            private const uint ofs_ActorAtrib_ofs1 = 0x390;
            private const uint ofs_ActorAtrib_ofs2 = 0x2E8;
            private const uint ofs_ActorAtrib_ofs3 = 0x148;
            private const uint ofs_ActorAtrib_Count = 0x108;
    
            private const uint ofs_LocalActor_ofs1 = 0x378;
            private const uint ofs_LocalActor_ofs2 = 0x148;
            private const uint ofs_LocalActor_Count = 0x108;
            private const uint ofs_LocalActor_atribGUID = 0x120;
            private const uint ofs_LocalActor_StrucSize = 0x2D0;
    
            private const uint ofs_ObjManAtribGrpContainer = 0x844;
            private const uint ofs_ObjManACD = 0x850;
            private const uint ofs_ObjManCutScenes = 0x8A8;
            private const uint ofs_ObjManActor = 0x8B0;
            private const uint ofs_ObjManWorlds = 0x92C;
            private const uint ofs_ObjManAtribContainer = 0x70;
            private const uint ofs_ActorAtrib_StrucSize = 0x180;
    
                itrObjectManagerA = m_memoryReader.Readuint(ofs_ObjectManger);
                itrObjectManagerB = m_memoryReader.Readuint(itrObjectManagerA + ofs_objmanagerActorOffsetA);
                itrObjectManagerCount = itrObjectManagerB + ofs_objmanagerActorCount;
                itrObjectManagerC = m_memoryReader.Readuint(itrObjectManagerB + ofs_objmanagerActorOffsetB);
                itrObjectManagerD = m_memoryReader.Readuint(itrObjectManagerC);
                itrObjectManagerE = m_memoryReader.Readuint(itrObjectManagerD);
    
                itrInteractA = m_memoryReader.Readuint(ofs_Interact);
                itrInteractB = m_memoryReader.Readuint(itrInteractA);
                itrInteractC = m_memoryReader.Readuint(itrInteractB);
                itrInteractD = m_memoryReader.Readuint(itrInteractC + ofs_interactOffsetA);
                itrInteractE = itrInteractD + ofs_interactOffsetB;
    
                // get main char offset
                curOffset = itrObjectManagerD;
                cnt = (int)m_memoryReader.Readuint(itrObjectManagerCount);
                for (int i = 0; i < cnt; i++)
                {
                    GUID = m_memoryReader.Readuint(curOffset + 0x04);
                    if (GUID == mainCharID)
                    {
                        mainCharOffset = curOffset;
                        i = cnt;
                    }
                    curOffset += objmanagerStrucSize;
                }
    
                clickToMoveMain = m_memoryReader.Readuint(mainCharOffset + ofs_objmanagerActorLinkToCTM);
                clickToMoveRotation = clickToMoveMain + rotationOffset;
                clickToMoveCurX = clickToMoveMain + currentX;
                clickToMoveCurY = clickToMoveMain + currentY;
                clickToMoveCurZ = clickToMoveMain + currentZ;
                clickToMoveToX = clickToMoveMain + moveToXoffset;
                clickToMoveToY = clickToMoveMain + moveToYoffset;
                clickToMoveToZ = clickToMoveMain + moveToZoffset;
                clickToMoveToggle = clickToMoveMain + toggleMove;
                clickToMoveFix = clickToMoveMain + fixSpeed;
    
                ActorAtrib_Base = m_memoryReader.Readuint(ofs_ObjectManger);
                ActorAtrib_1 = m_memoryReader.Readuint(ActorAtrib_Base + ofs_ObjManAtribGrpContainer);
                ActorAtrib_2 = m_memoryReader.Readuint(ActorAtrib_1 + ofs_ObjManAtribContainer);
                ActorAtrib_3 = m_memoryReader.Readuint(ActorAtrib_2 + ofs_ActorAtrib_ofs3);
                ActorAtrib_4 = m_memoryReader.Readuint(ActorAtrib_3);
                ActorAtrib_Count = ActorAtrib_2 + ofs_ActorAtrib_Count;
    
                LocalActor_Base = m_memoryReader.Readuint(ActorAtrib_Base + ofs_ObjManACD);
                LocalActor_1 = m_memoryReader.Readuint(LocalActor_Base);
                LocalActor_2 = m_memoryReader.Readuint(LocalActor_1 + ofs_LocalActor_ofs2);
                LocalActor_3 = m_memoryReader.Readuint(LocalActor_2);
                LocalActor_Count = LocalActor_1 + ofs_LocalActor_Count;
    Here is what my memory looks like for a pair of magic pants on the ground in town (from iterating the object list using the address from itrObjectManagerD. –Im using address 0D00ACF4 for the id to the ACD (0x78A8009B)

    https://www.dropbox.com/s/4yym1xvwz1...ectListmem.PNG

    In the ACDToFAG function above I pass in fagGuid = 0x78A8009B. It returns the pointer to location 0x1C96E880 shown in the picture linked below:

    https://www.dropbox.com/s/luqwn5y16i...FAGPointer.PNG

    In the GetAttribute function I pass in fagPtr = 0x1C96E880, attribute_index = 0x138 (item_quality_level)
    _38 = 0x1C96E8C4
    _C8 = 0x0000001F
    V4 = 0x1C96E8E0
    After using this as a pointer
    V4 = 0x00000000

    something must be off because v4 should not be going to 0 can be seen in the memory shot above. Any idea where I’m going wrong?

  6. #6
    peterk's Avatar Private
    Reputation
    1
    Join Date
    Jul 2012
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can try my LocalActor class. No need for IterateLocalActor to copy an already existing List.
    If you try to read life in the Menu (Game not started) you get an Exception, you will want to use try/catch
    My next step: create a bunch of funktions like public float CUR_HITPOINTS { get { return atribFloat(0x71); } }


    Usage:
    // read Life
    localActor me = new localActor(0x77bc0000);
    GUI_life.Text = me.atribFloat(0x71).ToString();

    // read Gold
    localActor gold = new localActor("GoldCoin-");
    GUI_gold.Text = gold.atribInt(0x146).ToString();

    // qualitiy level 3-5->magic, 6-8 rare, >9 leg.
    localActor item = new localActor(theIdOfTheItem or theNameOfTheItem);
    System.Diagnostics.Debug.WriteLine(item.atribInt(0x138));


    Code:
    class localActor
        {
            int address;
            
            public localActor(int id)
            {
                int count = GLOBALS.ReadInt(Offsets.LocalActor_Count);
                address = Offsets.LocalActor_3;
                for (int i = 0; i <= count; i++)
                {
                    if (this.id == id)
                    {
                        return;
                    }
                    address += Offsets.ofs_LocalActor_StrucSize;
                }
                throw new Exception("local Actor ID=" + id + " nicht gefunden");
            }
    
            public localActor(string name)
            {
                int count = GLOBALS.ReadInt(Offsets.LocalActor_Count);
                address = Offsets.LocalActor_3;
                for (int i = 0; i <= count; i++)
                {
                    if (this.name.Contains(name))
                    {
                        return;
                    }
                    address += Offsets.ofs_LocalActor_StrucSize;
                }
                throw new Exception("local Actor NAME=" + name + " nicht gefunden");
            }
    
            public int id
            {
                get { return GLOBALS.ReadInt(address); }
            }
    
            public string name
            {
                get { return GLOBALS.ReadString(address + 0x04); }
            }
    
            public int atrib_id
            {
                get { return GLOBALS.ReadInt(address + Offsets.ofs_LocalActor_atribGUID); }
            }
            
    
    
            public float atribFloat(uint req)
            {
                int address = atribAddress(req);
                return GLOBALS.ReadFloat(address);
            }
    
            public int atribInt(uint req)
            {
                int address = atribAddress(req);
                return GLOBALS.ReadInt(address);
            }
    
            public int atribAddress(uint req)
            {
                int count = GLOBALS.ReadInt(Offsets.ActorAtrib_Count);
                int currentOffset = Offsets.ActorAtrib_4;
                int atrib_id = this.atrib_id;
    
                for (int i = 0; i <= count; i++)
                {
                    int actorAtrib = GLOBALS.ReadInt(currentOffset);
                    if (actorAtrib == atrib_id)
                    {
                        currentOffset = GLOBALS.ReadInt(currentOffset + 0x10);
                        for (int j = 0; j <= 0x34E; j++)
                        {
                            int data = GLOBALS.ReadInt(currentOffset);
                            currentOffset += 4;
                            if (data != 0)
                            {
                                uint atribData = GLOBALS.ReadUint(data + 0x4);
                                if (atribData == (0xfffff000 | req))
                                {
                                    return data + 0x08;
                                }
                            }
                        }
                        throw new Exception("local Actor hat dieses Attribut nicht");
                    }
                    currentOffset += Offsets.ofs_ActorAtrib_StrucSize;
                }
                throw new Exception("keine Attributliste für local Actor gefunden");
            }
        }

  7. #7
    Diablo3Bot's Avatar Corporal
    Reputation
    3
    Join Date
    Jul 2012
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Peterk Thanks for posting that. I will try it this weekend and let you know how it goes!

  8. #8
    Diablo3Bot's Avatar Corporal
    Reputation
    3
    Join Date
    Jul 2012
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Finally got a chance to play with this again last night. Still no luck, I am going to try breaking this out into it's own project and post it here for others to look at. Not sure when I'll get the chance though.

Similar Threads

  1. Getting magic schools via WOW API
    By G0tha in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 04-10-2014, 04:22 PM
  2. (Useless) Get casting bar while casting magic broom
    By SneakyKinky in forum World of Warcraft Exploits
    Replies: 12
    Last Post: 11-05-2008, 04:50 AM
  3. Howto get better earthshield ticks :)
    By Geniz in forum World of Warcraft Guides
    Replies: 6
    Last Post: 03-06-2008, 06:29 AM
  4. Rickety magic broom mount to Ravenlord + rep to anyone who gets it.
    By SR802 in forum WoW ME Questions and Requests
    Replies: 9
    Last Post: 10-27-2007, 01:57 PM
All times are GMT -5. The time now is 07:24 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search