AutoInterrupt plugin for TheNoobBot menu

User Tag List

Results 1 to 6 of 6
  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)

    AutoInterrupt plugin for TheNoobBot

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

    You will be able to load it using TheNoobBot (General Settings > Plugins Manager) in the next release of TheNoobBot that should go out in less than 12 hours from now.

    You can see that I added a delay before kick, it really make it looks "leggit"/"by a real player" since it will interrupt at arround 20% of the cast bar.

    Also, because the plugins system works out of the CombatClass, you can use it as standalone (run the bot without starting any product).

    If you use it with a product (and then with CombatClass activated), it will even improve your kick possibility because most of the kicks works out of GCD, so CombatClass may miss some kicks the plugins will make sure to interrupt.

    I will add "List of spells to don't interrupt (ignore)" for the update of the bot.

    Code:
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using System.Windows.Forms;
    using nManager.Helpful;
    using nManager.Plugins;
    using nManager.Wow.Class;
    using nManager.Wow.Enums;
    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()
        {
            MyPluginClass.ShowConfiguration();
        }
    
        public void ResetConfiguration()
        {
            MyPluginClass.ResetConfiguration();
        }
    
        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 = "AutoInterrupt";
        public static string TargetVersion = "3.0";
        public static string Version = "1.0.2";
        public static string Description = "Interrupt automatically when our target is casting or channeling a spell.";
    
        private static readonly List<Spell> AvailableInterruptersPVP = new List<Spell>();
        private static readonly List<Spell> AvailableInterruptersPve = new List<Spell>();
        private static readonly MyPluginSettings MySettings = MyPluginSettings.GetSettings();
    
        public static void Init()
        {
            GetAllAvailableInterrupters();
            if (AvailableInterruptersPVP.Count <= 0 && AvailableInterruptersPve.Count <= 0)
            {
                Logging.WriteDebug(Name + ": No spell capable of interrupt has been found.");
                return;
            }
            MainLoop();
        }
    
        public static void MainLoop()
        {
            while (InternalLoop)
            {
                CheckToInterrupt();
                Thread.Sleep(1);
            }
        }
    
        public static void CheckToInterrupt()
        {
            if (ObjectManager.Me.Target <= 0 || ObjectManager.Target.IsDead)
                return;
            if (ObjectManager.Target.Type == WoWObjectType.Player)
                InterruptPVP();
            if (ObjectManager.Target.Type == WoWObjectType.Unit)
                InterruptPve();
        }
    
        public static bool IsTargetEnnemyPlayer()
        {
            if (ObjectManager.Target is WoWPlayer)
            {
                var p = ObjectManager.Target as WoWPlayer;
                if (p.PlayerFaction != ObjectManager.Me.PlayerFaction)
                    return true;
            }
            return false;
        }
    
        public static void InterruptPVP()
        {
            if (!IsTargetEnnemyPlayer())
                return;
            if (ObjectManager.Target.CanInterruptCurrentCast && !IsSpellInIgnoreList())
            {
                var rnd = new Random();
                int sleepTime = rnd.Next(100, 400);
                Thread.Sleep(sleepTime); // Wait randomly between 70ms to 400ms before interrupt for account safety reason.
                while (ObjectManager.Target.CanInterruptCurrentCast && !IsSpellInIgnoreList())
                {
                    foreach (Spell kicker in AvailableInterruptersPVP)
                    {
                        if (ObjectManager.Target.GetDistance > kicker.MaxRangeHostile)
                            continue; // We are too far for this spell, try another one ASAP.
                        if (ObjectManager.Target.GetDistance < kicker.MinRangeFriend)
                            continue; // We are too close for this spell, try another one ASAP.
                        if (!kicker.IsSpellUsable)
                            continue; // This spell is on cooldown.
                        kicker.Launch();
                        Logging.Write(ObjectManager.Target.Name + " interrupted.");
                    }
                }
            }
        }
    
        public static void InterruptPve()
        {
            if (!ObjectManager.Target.InCombatWithMe)
                return; // We don't wanna pull creatures.
            if (ObjectManager.Target.CanInterruptCurrentCast && !IsSpellInIgnoreList())
            {
                var rnd = new Random();
                int sleepTime = rnd.Next(100, 400);
                Thread.Sleep(sleepTime); // Wait randomly between 70ms to 400ms before interrupt for account safety reason.
                while (ObjectManager.Target.CanInterruptCurrentCast && !IsSpellInIgnoreList())
                {
                    foreach (Spell kicker in AvailableInterruptersPve)
                    {
                        if (ObjectManager.Target.GetDistance > kicker.MaxRangeHostile)
                            continue; // We are too far for this spell, try another one ASAP.
                        if (ObjectManager.Target.GetDistance < kicker.MinRangeFriend)
                            continue; // We are too close for this spell, try another one ASAP.
                        if (!kicker.IsSpellUsable)
                            continue; // This spell is on cooldown.
                        kicker.Launch();
                        Logging.Write(ObjectManager.Target.Name + " interrupted.");
                    }
                }
            }
        }
    
        public static bool IsSpellInIgnoreList()
        {
            string[] spellListPVP = MySettings.DontInterruptSpellList.Split(',');
            foreach (string sId in spellListPVP)
            {
                if (sId.Contains(ObjectManager.Target.CastingSpellId.ToString()))
                {
                    return true;
                }
            }
            return false;
        }
    
        public static void GetAllAvailableInterrupters()
        {
            string[] spellListPVP = MySettings.SpellListPVP.Split(',');
            foreach (string sId in spellListPVP)
            {
                uint id = Others.ToUInt32(sId.Trim());
                var spell = new Spell(id);
                if (spell.Name != "" && spell.KnownSpell)
                {
                    if (MySettings.ActivateInterruptPVP)
                        AvailableInterruptersPVP.Add(spell);
                    if (MySettings.ActivateInterruptPve)
                        AvailableInterruptersPve.Add(spell);
                }
            }
            if (!MySettings.ActivateInterruptPve)
                return;
            string[] spellListPve = MySettings.SpellListPve.Split(',');
            foreach (string sId in spellListPve)
            {
                uint id = Others.ToUInt32(sId.Trim());
                var spell = new Spell(id);
                if (spell.Name != "" && spell.KnownSpell)
                {
                    AvailableInterruptersPve.Add(spell);
                }
            }
        }
    
        public static void ResetConfiguration()
        {
            string currentSettingsFile = Application.StartupPath + "\\Plugins\\Settings\\" + Name + ".xml";
            var currentSetting = new MyPluginSettings();
            currentSetting.ToForm();
            currentSetting.Save(currentSettingsFile);
        }
    
        public static void ShowConfiguration()
        {
            string currentSettingsFile = Application.StartupPath + "\\Plugins\\Settings\\" + Name + ".xml";
            var currentSetting = new MyPluginSettings();
            if (File.Exists(currentSettingsFile))
            {
                currentSetting = Settings.Load<MyPluginSettings>(currentSettingsFile);
            }
            currentSetting.ToForm();
            currentSetting.Save(currentSettingsFile);
        }
    
        [Serializable]
        public class MyPluginSettings : Settings
        {
            public bool ActivateInterruptPVP = true;
            public bool ActivateInterruptPve = true;
            public string DontInterruptSpellList = "";
            public string SpellListPVP = "106839, 78675, 147362, 34490, 2139, 116705, 31935, 96231, 1766, 57994, 19647, 115782, 6552, 47528";
            public string SpellListPve = "15487, 47476";
    
            public MyPluginSettings()
            {
                ConfigWinForm(Name + " Spells Management");
                AddControlInWinForm("List of spells to not interrupt (ignore) :", "DontInterruptSpellList", Name + " Spells Management", "List");
                AddControlInWinForm("Auto Interrupt in PVP", "ActivateInterruptPVP", Name + " Spells Management");
                AddControlInWinForm("List of spells that can interrupt in PVP :", "SpellListPVP", Name + " Spells Management", "List");
                AddControlInWinForm("Auto Interrupt in PVE", "ActivateInterruptPve", Name + " Spells Management");
                AddControlInWinForm("List of spells that can only interrupt in PVE (will complete the PVP list in PVE) :", "SpellListPve", Name + " Spells Management", "List");
            }
    
            public static MyPluginSettings CurrentSetting { get; set; }
    
            public static MyPluginSettings GetSettings()
            {
                string currentSettingsFile = Application.StartupPath + "\\Plugins\\Settings\\" + Name + ".xml";
                if (File.Exists(currentSettingsFile))
                {
                    return CurrentSetting = Load<MyPluginSettings>(currentSettingsFile);
                }
                return new MyPluginSettings();
            }
        }
    }
    
    #endregion
    [F] 16:05:57 - Cast Rebuke
    [S] 16:05:58 - Manifestation of Pride interrupted.
    [F] 16:06:43 - Cast Rebuke
    [S] 16:06:44 - Vestige of Pride interrupted.
    [F] 16:07:11 - Cast Rebuke
    [S] 16:07:11 - Vestige of Pride interrupted.
    [F] 16:07:35 - Cast Rebuke
    [S] 16:07:36 - Manifestation of Pride interrupted.
    [F] 16:08:06 - Cast Rebuke
    [S] 16:08:07 - Quid interrupted.
    [F] 16:08:22 - Cast Rebuke
    [S] 16:08:23 - Manifestation of Pride interrupted.
    Last edited by VesperCore; 04-28-2014 at 02:37 PM.

    AutoInterrupt plugin for TheNoobBot
  2. #2
    manylol's Avatar Sergeant
    Reputation
    8
    Join Date
    Apr 2014
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey, some pre purchase questions
    is it working in arena ?
    is it working on target/focus/arena1/arena2/arena3 ?
    is it working with pet interrupt spell ? Optical Blast - Spell - World of Warcraft

  3. #3
    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)
    Hello, thanks you for your questions that will make me able to improve this plugin.

    It is working in Arena, you just have to launch the bot (release tonight) activate the plugin by going into General Settings => Plugins Management System.

    For the moment, this plugin is only working on your current target, but I may add a check for targets in range.

    Yes, I added both pet spell in the spellList, it will works with both pet interrupt.

    Last: As the plugin is OpenSource, any of you can modify it to add very custom things like focus priority, etc..

    I will do my best staying in the "general purpose" way of working (by adding settings for them for example), you will need a code edit if you want to add something "very very specific".


    Edit: I added the support for the setting "Ignore Spell" earlier than I though. // Edited the plugin posted to version 1.0.2.
    Last edited by VesperCore; 04-28-2014 at 11:48 AM.

  4. #4
    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)
    Hello, thanks you for your questions that will make me able to improve this plugin.

    First of all, I updated TheNoobBot and included TnbAutoInterrupt 1.0.2 in it, you can see it in action with your own eyes by using our free trial. (20mins allowed per sessions: unlimited restart)

    Second, the answers:

    It is working in Arena, you just have to launch the bot and activate the plugin by going into General Settings => Plugins Management System.

    As of 1.0.2, the plugin can only kick your target. But It's a good idea to add a focus system (with advanced settings) of all target in kick range.

    Yes, both pet spells for Warlock are supported. (For the Fellhunter and Observer)

    I will do my best staying in the "general purpose" way of working, I cannot code things too specific without a strong settings management for them.

    If you want to add something special to the code, you are free to modify the source code to add very very specific things. (and don't forget to load the .cs file instead of the .dll)

    As of 1.0.2, the setting "Ignore Spell" have been implemented earlier than I though.

  5. #5
    xXK1ll3rXx's Avatar Member
    Reputation
    2
    Join Date
    Nov 2009
    Posts
    221
    Thanks G/R
    1/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by VesperCore View Post
    Hello, thanks you for your questions that will make me able to improve this plugin.

    First of all, I updated TheNoobBot and included TnbAutoInterrupt 1.0.2 in it, you can see it in action with your own eyes by using our free trial. (20mins allowed per sessions: unlimited restart)

    Second, the answers:

    It is working in Arena, you just have to launch the bot and activate the plugin by going into General Settings => Plugins Management System.

    As of 1.0.2, the plugin can only kick your target. But It's a good idea to add a focus system (with advanced settings) of all target in kick range.

    Yes, both pet spells for Warlock are supported. (For the Fellhunter and Observer)

    I will do my best staying in the "general purpose" way of working, I cannot code things too specific without a strong settings management for them.

    If you want to add something special to the code, you are free to modify the source code to add very very specific things. (and don't forget to load the .cs file instead of the .dll)

    As of 1.0.2, the setting "Ignore Spell" have been implemented earlier than I though.
    Would be reaaaaally awesome if you could add focus makro support! Also, do you think its possible to add the option to change when the bot interrupts a spell ? For example instead of interrupt at 20% you could set it to 50%.

  6. #6
    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)
    Hello, the question is : Why would you want this ?

    I mean, I'm not "interrupting at 20%", I'm interrupting randomly between 70 ms and 400ms that is a fair player's reaction and will interrupt mainly at 0.25 sec (so 25% of a 1sec spell).


    For the Focus Macro, could you be more explicit ? I mean, I can remove the delay if you switch to a new target that was already casting (so it interrupt immediatly), but I can just switch on any target that is casting a spell (and would look suspicious to me actually:

    imagine you are full bursting focus 1, focus 2 cast a big spell => switch to interrupt and go back on initial focus. Event with the account safety delay, it would look very wierd, as even top player aren't doing this often with all god sake macros :P
    Last edited by VesperCore; 04-28-2014 at 10:07 PM.

Similar Threads

  1. AutoEquipper plugin for TheNoobBot
    By VesperCore in forum WoW Bot Maps And Profiles
    Replies: 0
    Last Post: 04-28-2014, 02:42 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 03:57 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