Adding Questing to my bot... menu

User Tag List

Results 1 to 5 of 5
  1. #1
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Adding Questing to my bot...

    I added the quest cache reader that Tom posted and can get the quest objectives but it is only partial information. I am having some challenges turning that info into useful information. Basically there are a couple of different catagories of quest types and was interested in hearing from people on how they implement them in their bots.

    1. Go kill a specific mob [this works fine, the questcache info gives you the mob id]

    2. Go kill a group of mob types [killing 14 ghosts in tol pvp zone] the quest cache gives you a unit id that i cannot find in wowhead. When i look at the ghosts and the workers that count towards the quest, they do not have the id that questcache identifies but they have the same factiontemplate 0x14. I looked through all of the fields in the questcache but do not see 0x14 called out anywhere. I was trying to see if the id given is some kind of mask to be applied to the actual mod id resulting in 0x14 but have not come up with anything. I handle these quests but look to see if the mob name is rendered [for yellow or red mobs] by looking at [[address + 0xc8] + 0x18] if this is 8 the name is shown and I conclude it is a kill target. I kill one and check to see if i got credit, if not i blacklist the Id. If it is 3 the name is not shown and I avoid it. Is there a better way to do this?

    3. Use an item near and object [magnet quest in tol pvp zone], have not figured out how to automate these other than scripting them.

    4. Collect and item from a "chest" type object [barrell of rum quest in tol pvp]. The questcache info gives you the end object item ID, not the id of the gameobject you need to gather. I currently go to the zone and crete a list of the gameobjects in the quest area and naviagate to one and mouse over it and see if i get the correct cursor to gather. If so i gather it and check the looted item id to see if it is the one i am looking for. If it is not i blacklist the gameobject type. Basically a trial and error AI code section. Is there a better way to do this?

    I am begining to think it would be easier to just set up an xml scheme for Quests and manually enter the specific info to grind out dailies or to lvl toons.

    Thoughts?

    -counted
    Last edited by counted; 03-19-2012 at 10:27 AM.

    Adding Questing to my bot...
  2. #2
    miceiken's Avatar Contributor Authenticator enabled
    Reputation
    209
    Join Date
    Dec 2007
    Posts
    401
    Thanks G/R
    7/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about grabbing one of those databases that the emulators use?

  3. #3
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Good idea thanks.

    I do not know much about the emulators. I will do some searching to find out about them and thier databases.

    -counted

  4. #4
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Here is what I have gotten so far:

    1. Installed MySQL Community server
    2. Installed MySQL .Net Connectors
    3. Installed Heidi SQL Client
    4. Grabbed arkDB from Arkania Files repository

    Note: this data base has a lot of other useful info in it. If anyone knows of a better or more complete database please post in this thread.

    5. Created arkdb,auth, and characters tables in MySQL
    6. Ran the arkdb install batch file for a fresh database install.

    Used the following code to generate QuestNpc and QuestGameObject Ids.

    Code:
    class QuestObjectiveTracker
        {
            public static List<int> QuestGameObjects;
            public static List<int> QuestNpcs;
    
            private static Dictionary<int, QuestObjectiveEntry> m_questDict = new Dictionary<int, QuestObjectiveEntry>();
    
            private static Thread m_thread;
    
            private static bool m_bRunning;
    
            public class QuestObjectiveEntry
            {
                public PlayerQuest Quest;
                public QuestCache Cache;            // I am using TomRus's QuestCache reader and code
            }
    
            // I grabbed Apoc's FSM engine thread code and used it here
    
            public static void Start(int sleepTime)
            {
                // We want to round a bit here.
    
                m_bRunning = true;
    
                m_questDict = new Dictionary<int, QuestObjectiveEntry>();
    
                // Leave it as a background thread. This CAN trail off
                // as the program exits, without any issues really.
    
                m_thread = new Thread(Run) { IsBackground = true };
                m_thread.Start(sleepTime);
            }
    
            private static void Run(object sleepTime)
            {
                try
                {
                    while (m_bRunning)
                    {
    
                        Pulse();
                        Thread.Sleep((int)sleepTime);
                    }
                }
                finally
                {
                    // If we exit due to some exception,
                    // that isn't caught elsewhere,
                    // we need to make sure we set the Running
                    // property to false, to avoid confusion,
                    // and other bugs.
                    m_bRunning = false;
                }
            }
    
            public static void Stop()
            {
                if (!m_bRunning)
                {
                    // Nothing to do.
                    return;
                }
                if (m_thread.IsAlive)
                {
                    m_thread.Abort();
                }
                // Clear out the thread object.
                m_thread = null;
    
                QuestGameObjects = null;
                QuestNpcs = null;
                m_questDict = null;
    
                // Make sure we let everyone know, we're not running anymore!
                m_bRunning = false;
            }
    
            private static void Pulse()
            {
                var questGameObjects = new List<int>();
                var questNpcs = new List<int>();
    
                for (var x = 0; x <= 0x32; x++)
                {
                    var quest = Quest.Get(x);
    
                    if (quest.ID == 0) continue;
    
                    if (quest.ID == 27046)   // used to debug add what quest ID you want to debug 
                    {
                        var b = 1;                        
                    }
    
                    if (m_questDict.ContainsKey(quest.ID))
                    {
                        QuestObjectiveEntry entry;
    
                        var result = m_questDict.TryGetValue(quest.ID, out entry);
    
                        if (!result) continue;
    
                        if (entry.Cache.CollectItemId == null) continue;
    
                        if (entry.Cache.Id == 27047) // used to debug add what quest ID you want to debug 
                        {
                            var b = 1;
                        }
    
                        if (entry.Cache.CollectItemId[0] > 0)
                        {
                            var current =
                                   TC.Mem.Read<short>(
                                       TC.Mem.Read<uint>(
                                            Manager.Instance.Me.Address + Offsets.DescriptorFields) 
                                            + (uint)ePlayerField.PLAYER_QUEST_LOG_1_3 + (uint)(0x14 * x));
    
                            if (entry.Cache.CollectItemCount[0] > current )
                            {                          
                                {
                                    var commandString =
                                        string.Format("select entry from arkdb.gameobject_template where questItem1 = {0}",
                                                      entry.Cache.CollectItemId[0]);
    
                                    var idList = ArkDbQuerry(commandString);
    
                                    if (idList != null && idList.Count > 0)
                                    {
                                        foreach (var id in idList)
                                        {
                                            questGameObjects.Add(id);
                                        }
                                    }
                                }
                                {
                                    var commandString =
                                        string.Format("select entry from arkdb.creature_template where questItem1 = {0}",
                                                      entry.Cache.CollectItemId[0]);
    
                                    var idList = ArkDbQuerry(commandString);
                                    if (idList != null && idList.Count > 0)
                                    {
                                        foreach (var id in idList)
                                        {
                                            questNpcs.Add(id);
                                        }
                                    }
                                }
    
                            }
    
                        }
    
                        if (entry.Cache.ReqCreatureOrGOId[0] > 0)
                        {
                            var current =
                                TC.Mem.Read<short>(
                                    TC.Mem.Read<uint>(
                                        Manager.Instance.Me.Address + Offsets.DescriptorFields)
                                        + (uint) ePlayerField.PLAYER_QUEST_LOG_1_3 + (uint) (0x14*x));
    
                            if (entry.Cache.ReqCreatureOrGOIdCount[0] > current)
                            {
                                {
                                    var commandString =
                                        string.Format(
                                            "select entry from arkdb.creature_template where entry = {0} or KillCredit1 = {0}",
                                            entry.Cache.ReqCreatureOrGOId[0]);
    
                                    var idList = ArkDbQuerry(commandString);
    
                                    if (idList != null && idList.Count > 0)
                                    {
                                        foreach (var id in idList)
                                        {
                                            questNpcs.Add(id);
                                        }
                                    }
                                }
                                {   
                                    var commandString =
                                        string.Format("select entry from arkdb.gameobject_template where data1 = {0} or questItem1 = {1}",
                                                      entry.Quest.ID, entry.Cache.ReqCreatureOrGOId[0]);
                                    var idList = ArkDbQuerry(commandString);
    
                                    if (idList != null && idList.Count > 0)
                                    {
                                        foreach (var id in idList)
                                        {
                                            questGameObjects.Add(id);
                                        }
                                    }
                                }
                            }
                        }
                        continue;
                    }
    
                    var questCache = WowCache.GetQuestCachebyId(quest.ID);
    
                    var qe = new QuestObjectiveEntry { Quest = quest, Cache = questCache };
    
                    m_questDict.Add(quest.ID, qe);
                }
                QuestGameObjects = questGameObjects;
                QuestNpcs = questNpcs;
            }
    
            private static List<int> ArkDbQuerry(string commandString)
            {
                var resultList = new List<int>();
    
                const string myConString = "SERVER=quadcore;" + "DATABASE=arkdb;" + "UID=root;" + "PASSWORD=harl3y;";
    
                var connection = new MySqlConnection(myConString);
    
                var command = connection.CreateCommand();
    
                connection.Open();
    
                command.CommandText = commandString;
    
                var reader = command.ExecuteReader();
    
                while (reader.Read())
                {
                    for (var i = 0; i < reader.FieldCount; i++)
                    {
                        var s = reader.GetValue(i);
                        if (s == null) continue;
                        var data = Convert.ToInt32(s);
                        resultList.Add(data);
                    }
                }
                reader.Close();
                return resultList;
            }
        }
    
     [StructLayout(LayoutKind.Sequential)]
        public struct PlayerQuest
        {
            public int ID;
            public int State;
            [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
            public short[] ObjectiveRequiredCounts;
            public int Time;
    
            public enum eStateFlag : uint
            {
                NONE = 0,
                COMPLETE = 1,
                FAILED = 2
            }
        }
    
        public static class Quest
        {
            private static readonly uint m_questBase = TC.Mem.Read<uint>(Manager.Instance.Me.Address + Offsets.DescriptorFields) + (uint)ePlayerField.PLAYER_QUEST_LOG_1_1;
            
            public static PlayerQuest Get(int index)
            {
                return TC.Mem.ReadStruct<PlayerQuest>(m_questBase + (uint)index * 0x14);
            }
    
            public static void Dump()
            {
                uint n;
                var qList = new List<PlayerQuest>();
    
                for (n = 0; n < 0x32; n++)
                {
                    var questData = TC.Mem.ReadStruct<PlayerQuest>((m_questBase + 0x14 * n));
                   
                    qList.Add(questData);
                    
                    
                }           
            }
        }
    I this works for most quests where you have to kill something or collect something.

    I am working on more complex quests now like "Underground Economy" and or " Magnets, How do they work".

    Also not sure how I am going to handle "The Restless Brood"

    Hope this helps someone else...

    -counted
    Last edited by counted; 03-30-2012 at 12:50 PM.

  5. #5
    counted's Avatar Contributor Authenticator enabled
    Reputation
    203
    Join Date
    Mar 2008
    Posts
    183
    Thanks G/R
    11/108
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Tables that I found in the database that are interesting are:

    creature
    creature_template
    gameobject
    gameobject_template
    item_template
    quest_poi
    quest_poi_points
    quest_template
    transports

    -counted

Similar Threads

  1. WTS 1-80 Quest/PVP/Gather bot
    By ~OddBall~ in forum Members Only Accounts And CD Keys Buy Sell
    Replies: 15
    Last Post: 11-17-2009, 04:15 AM
  2. Adding Quests into Arcemu Database
    By ardtard76 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 11-08-2008, 04:40 PM
  3. Adding quests to AC web repacks!!
    By kreegoth in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 07-02-2008, 11:39 AM
  4. Lvling Tips for Botting/Questing/Grinding
    By Jaske53211 in forum World of Warcraft Guides
    Replies: 3
    Last Post: 03-18-2007, 01:44 AM
  5. 20+ Bots/Hacks Lot (Private Server - No Wait/Ads)
    By mantalcore in forum World of Warcraft Bots and Programs
    Replies: 24
    Last Post: 09-30-2006, 07:23 PM
All times are GMT -5. The time now is 02:53 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search