Jump to content

Zer0

Elite user
  • Posts

    213
  • Joined

  • Last visited

Posts posted by Zer0

  1. For some reason, even turning wManagerSetting.CurrentSetting.BlackListIfNotCompletePath to false (and in the UI) doesn't do the trick and the vendor still gets blacklisted.

    I've found a workaround though. It's a bit shaky but so far it's working as intended. Works for both Vendor and Repair. Maybe there's a way to hook blacklist events directly? If not I'll clean up the code and use this for now.

        private string vendorNpc = "";
    
    	// Manage blacklist (inside Initialize())
        robotManager.Events.LoggingEvents.OnAddLog += delegate (Logging.Log log)
        {
        	ManageNpcBlacklist(log);
        };
    
        private void ManageNpcBlacklist(Logging.Log log)
        {
            if (log.Text.Contains("[ToTown] Go to vendor"))
            {
                vendorNpc = log.Text.Substring(22);
                vendorNpc = vendorNpc.Remove(vendorNpc.Length - 9);
            }
    
            if (inRadarCombat && log.Text.Contains("[ToTown] Unable to reach the vendor, blacklist it 120 minutes (you can disable this NPC in NPC DB tab 'Tools')."))
            {
                foreach (var n in NpcDB.ListNpc)
                {
                    if (n.Name == vendorNpc)
                    {
                        Logging.WriteDebug("Removing " + n.Name + " from vendor Blacklist");
                        n.BlackList(-1);
                    }
                }
            }
        }

     

  2. 26 minutes ago, Marsbar said:

    Ah, well I see that it takes the general setting wManagerSetting.CurrentSetting.BlackListIfNotCompletePath into account so maybe turn that off temporarily?
    That is, if that setting is what's causing the blacklists

    I will try that and let you guys know how it went. Thank you both!

  3. 1 hour ago, Matenia said:

    Check for looting events and currently running the totown state and deactivate your radar for the time being. 

    That would indeed fix the issue, but also kill the purpose of the plugin. I really like the idea that the radar is still on when a toTown or looting event is on. So far it's only inactive when the player is flagged in combat or on a taxi.

  4. Ok, so I'll keep posting here for updates in case anyone's around and is willing to provide a little help.

    I've made it into a plugin and it's working very well so far, although it still needs a lot of testing. Basically the plugin creates a background task which updates every 500ms and checks for close units. I've made the Range of the radar, the lvl of the enemies and the option to attack passive enemies into settings. The detection works very well and the bots enters combat without issue, now. So far the bugs I have are :

    - When the bot is on its way to a NPC vendor in Town and is interrupted by a fight caused by a radar detection, the bot then states that "the NPC couldn't be reached" and then blacklists the vendor. I'm clearing the blacklist when it happens as a quick fix but it's ugly and potentially harmful. Any idea?

    - Same problem with looting. When the bot is on its way to loot a corps and is interrupted by a radar detection, it states that it can't reach the corpse and blacklists it. I don't think it's the worst bug, but I'd like to get it fixed anyway.

  5. Hey, thanks for the quick answer.

    The problem was that I didn't know you could pass a WowUnit.Guid argument to the overloaded StartFight function. Now I feel stupid :). Also I'm new to C# and decompiling dll, so don't judge me too harshly.

    I do have a filter and it works pretty well so far. So now the detection works, but there's still bugs to fix. Especially when looting nearby hostiles, the bot will start moving erratically between 'I wanna go loot" and "I wanna start a fight". I'll look into it tomorrow.

    Quick question : I put the detection into a method ( private void AggroRadar() ), that is executed every 500ms.
    If I instantiate an object inside my method ( WoWUnit closestUnit = new WoWUnit(1234); ), is it destroyed once the method is over, or am I causing a memory leak?

    Thanks a lot for your help!

  6. Related to the bug

     

    This bug annoys me to no end. The bot , when on its way to quest enemies/objectives just basically runs into other hostile mobs which not only is very bot-like in terms of behavior, but also stress-inducing to watch ?.

    Since I'm working on a Fight Class in C#, I thought I might as well give it a try and fix it directly in the FC for now. I've created a simple radar which is able to detect the closest hostile units around every 500ms. When the closest unit is under a certain distance, I target it. But then I can't seem to start a fight. Fight.StartFight(); doesn't work (it says that the Target is not valid), I've tried a lot of other stuff, like manually setting Fight.InFight to true, but nothing seems to work and the bot keeps walking. Is there a way for me to interrupt the pathing and start a fight? Any help would be very appreciated.

×
×
  • Create New...