AutoEquipper plugin for TheNoobBot menu

User Tag List

Results 1 to 1 of 1
  1. #1
    VesperCore's Avatar Contributor
    Reputation
    127
    Join Date
    Feb 2012
    Posts
    392
    Thanks G/R
    2/17
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AutoEquipper plugin for TheNoobBot

    Hello, I release here an AutoEquipper plugin for TheNoobBot, you can also use it as SDK for your own plugins !

    You must load it using TheNoobBot (General Settings > Plugins Manager) (as .cs file or .dll, not both).

    It will parse your whole inventory once on plugin start and auto equipp the best item value for the target inventory slot.

    Then it will register to TheNoobBot LootStatistics (that is a function that return the latest loots "you recieve loot XXXX x1"),
    every time you loot a new item, it will parse it and check if it's equippable and best than what you got already.

    If you are dead/in combat/in loading screen, it will simply stand by until you get back alive out of combat, then do its job.

    Source code:

    Code:
    using System;
    using System.Collections.Generic;
    using System.Threading;
    using System.Windows.Forms;
    using nManager;
    using nManager.Helpful;
    using nManager.Plugins;
    using nManager.Wow.Class;
    using nManager.Wow.Helpers;
    using nManager.Wow.ObjectManager;
    
    #region Interface Implementation - Edition Expert only
    
    public class Main : IPlugins
    {
        private bool _checkFieldRunning;
    
        public bool Loop
        {
            get { return MyPluginClass.InternalLoop; }
            set { MyPluginClass.InternalLoop = value; }
        }
    
        public string Name
        {
            get { return MyPluginClass.Name; }
        }
    
        public string Author
        {
            get { return MyPluginClass.Author; }
        }
    
        public string Description
        {
            get { return MyPluginClass.Description; }
        }
    
        public string TargetVersion
        {
            get { return MyPluginClass.TargetVersion; }
        }
    
        public string Version
        {
            get { return MyPluginClass.Version; }
        }
    
        public bool IsStarted
        {
            get { return Loop && !_checkFieldRunning; }
        }
    
        public void Dispose()
        {
            Loop = false;
        }
    
        public void Initialize()
        {
            Logging.WriteDebug(string.Format("The plugin {0} is loading.", Name));
            Initialize(false);
        }
    
        public void ShowConfiguration()
        {
            // If you have a configuration form, please create/call MyPluginClass.ShowConfiguration();
            Logging.WriteDebug(string.Format("The plugin {0} don't implement any settings system.", Name));
            MessageBox.Show(string.Format("The plugin {0} don't need to be configured.", Name));
        }
    
        public void ResetConfiguration()
        {
            // If you have a configuration form, please create/call MyPluginClass.ResetConfiguration();
            Logging.WriteDebug(string.Format("The plugin {0} don't implement any settings system.", Name));
            MessageBox.Show(string.Format("The plugin {0} don't need to be configured.", Name));
        }
    
        public void CheckFields() // do not edit.
        {
            _checkFieldRunning = true;
            Loop = true;
            while (Loop)
            {
                Thread.Sleep(1000); // Don't do any action.
            }
        }
    
        public void Initialize(bool configOnly, bool resetSettings = false)
        {
            try
            {
                if (!configOnly && !resetSettings)
                    Loop = true;
                MyPluginClass.Init();
            }
            catch (Exception e)
            {
                Logging.WriteError("IPlugins.Main.Initialize(bool configOnly, bool resetSettings = false): " + e);
            }
            Logging.Write(string.Format("The plugin {0} has stopped.", Name));
        }
    }
    
    #endregion
    
    #region Plugin core - Your plugin should be coded here
    
    public static class MyPluginClass
    {
        public static bool InternalLoop = true;
        public static string Author = "Vesper";
        public static string Name = "AutoEquipper";
        public static string TargetVersion = "3.0";
        public static string Version = "1.0.0";
        public static string Description = "Always check the inventory on new loot for a better item for our class/specialization.";
    
        private static readonly object ParseItemLock = new object();
    
        public static void Init()
        {
            // Do some init stuff here.
            if (!nManagerSetting.CurrentSetting.ActivateLootStatistics)
            {
                Logging.WriteDebug(string.Format("The plugin {0} needs ActivateLootStatistics to be activated in General Settings.", Name));
                return;
            }
            while (Others.ItemStock.Count <= 0)
            {
                Thread.Sleep(100); // wait for LootStatistics to finish its first run.
            }
            foreach (var itemStock in Others.ItemStock)
            {
                ParseItemStock(itemStock, new EventArgs()); // Parse the inventory once before subscribing to new loots.
            }
            Others.ItemStockUpdated += ParseItemStock; // Subscribe to TheNoobBot event OnLoot, return the every single new loots.
            MainLoop();
        }
    
        private static void ParseItemStock(object sender, EventArgs e)
        {
            lock (ParseItemLock)
            {
                if (!(sender is KeyValuePair<int, int>))
                    return;
                var itemStock = (KeyValuePair<int, int>) sender;
                string itemName = ItemsManager.GetItemNameById(itemStock.Key);
                ItemInfo itemInfo;
                if (ItemSelection.EvaluateItemStatsVsEquiped(itemName, out itemInfo) < 0)
                {
                    if (itemInfo != null)
                    {
                        while (!Usefuls.InGame || ObjectManager.Me.InCombat || ObjectManager.Me.IsDeadMe || ObjectManager.Me.InTransport)
                        {
                            Thread.Sleep(100); // We wait until we are free to equipp the item.
                        }
                        Logging.WriteDebug(Name + ": Equipp " + itemName);
                        ItemsManager.EquipItemByName(itemName); // Equipp now and we will reEquipp each better items till the ends of new loots.
                        Thread.Sleep(100);
                    }
                }
            }
        }
    
        public static void MainLoop()
        {
            while (InternalLoop)
            {
                Thread.Sleep(100);
            }
        }
    }
    
    #endregion
    I'm waiting for your questions/requests on what I can do to improve it.

    TODO: Improve the stat weight check system for class/spec, currently not optimized for high level characters.

    AutoEquipper plugin for TheNoobBot

Similar Threads

  1. AutoInterrupt plugin for TheNoobBot
    By VesperCore in forum WoW Bot Maps And Profiles
    Replies: 5
    Last Post: 04-28-2014, 09:53 PM
  2. [Plugin][Honorbuddy] Project Sn0wbuddy - A Sn0wball plugin for Honorbuddy.
    By Thunderofnl in forum WoW Bot Maps And Profiles
    Replies: 6
    Last Post: 05-16-2012, 04:27 PM
  3. [Bot] Archaeology Plugin For Honorbuddy
    By Aicd in forum World of Warcraft Bots and Programs
    Replies: 82
    Last Post: 01-10-2011, 04:48 PM
  4. Pattern verifier plugin for IDA
    By ostapus in forum WoW Memory Editing
    Replies: 7
    Last Post: 11-11-2009, 05:55 PM
  5. [Plugin whit tut] A little plugin for Photoshop i just found.[Big pic]
    By Lord-kapser in forum Art & Graphic Design
    Replies: 3
    Last Post: 12-03-2007, 04:15 PM
All times are GMT -5. The time now is 01:11 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