Jump to content
This site uses cookies! Learn More

This site uses cookies!

By continuing to use this site, you agree to allow us to store cookies on your computer. :)

  • Code doesnt stop fighting complete.


    Smokie
    • Product: WRobot General Type: Bug Status: Unconfirmed

    Hello @Droidz

    while i am making a fightclasses and using a EscapeProtocol, i found that this code doesnt completely stop the fight. it will still fight if attacked. i cant seem to get it to stop attack when attacked for a fightclass C#

    wManager.Wow.Helpers.Fight.StopFight();

     




    User Feedback

    Recommended Comments

    Hello, this stop fight, but bot probably try to attack again target, to skip all combat you need to use code like:

            wManager.Events.FightEvents.OnFightStart += delegate(WoWUnit unit, CancelEventArgs cancelable)
                {
                    cancelable.Cancel = true;
                    if (unit.IsValid)
                        ObjectManager.BlackListGetUnitAttackPlayerGuidTime.Add(unit.Guid, DateTime.Now + TimeSpan.FromMinutes(10));
                };

     

    Share this comment


    Link to comment
    Share on other sites
    On 5/1/2019 at 9:28 AM, Droidz said:

    Hello, this stop fight, but bot probably try to attack again target, to skip all combat you need to use code like:

            wManager.Events.FightEvents.OnFightStart += delegate(WoWUnit unit, CancelEventArgs cancelable)
                {
                    cancelable.Cancel = true;
                    if (unit.IsValid)
                        ObjectManager.BlackListGetUnitAttackPlayerGuidTime.Add(unit.Guid, DateTime.Now + TimeSpan.FromMinutes(10));
                };

     

    i know this is gonna sound like a stupid question but can you give some advice or some help with my code i am working on for my quester? i am trying to black list all mobs in a area for 5 mins

    Thread Water = new Thread(() =>
                {
                    
                    Logging.Write("[Water]: Water Search Initialized");
                    List<WoWUnit> attackers = ObjectManager.GetUnitAttackPlayer();
                    while (Conditions.ProductIsStarted || Conditions.ProductInPause)
                    {
                        var unit = ObjectManager.GetWoWUnitAttackables().Where(x => x.Position.DistanceTo(ObjectManager.Me.Position) <= 30);
                           
                        if (ObjectManager.Me.BreathTimerLeft <= 2000)
                        {
                            ObjectManager.BlackListGetUnitAttackPlayerGuidTime.Add(unit.ToArray(WoWUnit), DateTime.Now + TimeSpan.FromMinutes(5));
                            wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP, 5000);
                            
                        }
                        Thread.Sleep(12000);
                    } 
                    Logging.Write("[Water]: Water Search Disposed");
                });
                Water.Start();

     

    Share this comment


    Link to comment
    Share on other sites
            Thread Water = new Thread(() =>
            {
                Logging.Write("[Water]: Water Search Initialized");
                while (Conditions.ProductIsStarted)
                {
                    try
                    {
                        if (!Conditions.ProductInPause && ObjectManager.Me.BreathTimerLeft <= 2000)
                        {
                            var unit = ObjectManager.GetWoWUnitAttackables().Where(x => x.Position.DistanceTo(ObjectManager.Me.Position) <= 30);
                            foreach (var u in unit)
                            {
                                if (!ObjectManager.BlackListGetUnitAttackPlayerGuidTime.ContainsKey(u.Guid))
                                    ObjectManager.BlackListGetUnitAttackPlayerGuidTime.Add(u.Guid, DateTime.Now + TimeSpan.FromMinutes(5));
                            }
                            wManager.Wow.Helpers.Keybindings.PressKeybindings(wManager.Wow.Enums.Keybindings.JUMP, 5000);
    
                        }
                    }
                    catch (Exception e)
                    {
                        Logging.WriteError("[Water] ERROR: " + e);
                    }
                    Thread.Sleep(12000);
                }
                Logging.Write("[Water]: Water Search Disposed");
            });
            Water.Start();

     

    Share this comment


    Link to comment
    Share on other sites

    @Droidz Any advice on why my abort isnt working? trying to work on it so i can post it in the code snips as a call for using c# but i am gonna try to add a data base for flying, also if there a method to check if player is flying to?

        public class fly
        {
            public static void flying()
            {
                var zone = Lua.LuaDoString<string>("return GetZoneText()");
                Thread flying = new Thread(() =>
                {
                    Logging.Write("[Flight]: Has initialized");
    
                    while (Conditions.ProductIsStarted && zone != "Orgrimmar")
                    {
                        var position = new Vector3(-6810.2f, 841.704f, 49.66529f);
                        int npcEntryId = 15178;
                        var Zon= Lua.LuaDoString<string>("return GetZoneText()");
    
                        if (!ObjectManager.Me.IsOnTaxi && Zon != "Orgrimmar")
                        {
                            if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))
                            {
                                int node;
                                Usefuls.SelectGossipOption(GossipOptionsType.taxi);
    
                                node = wManager.Wow.Helpers.Lua.LuaDoString<int>("for i=0,30 do if string.find(TaxiNodeName(i),'Orgrimmar') then return i end end");
    
                                wManager.Wow.Helpers.Lua.LuaDoString("TakeTaxiNode(" + node + ")");
                            }
                        }
                        Thread.Sleep(1000);
                        
                    }
                    
                });
                if (zone != "Orgrimmar")
                {
                    flying.Start();
                }
                else
                if (zone == "Orgrimmar")
                {
                    Logging.Write("[Flight]: has disposed");
                    flying.Abort();
                }
    
            }
        }

     

    Share this comment


    Link to comment
    Share on other sites


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...