What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Blacklist node feauture?

Braken

Member
Joined
Dec 3, 2011
Messages
84
Reaction score
4
My bot gets stuck in the Crimson badlands trying to get non-existant nodes indefinitely, I checked the refresh objects and there was no node found nearby me at all, the closest was 60 feet away. I was wondering if there is a way to blacklist a node after x seconds of not harvesting it! Anyone know?

Edit: seems to happen after successfully harvesting a node. I haven't noticed this in the grimvaults but in the crimson badlands for sure.
 
Last edited:
Could add their Actor.Guid and a TimeSpan.FromSeconds(x) to a List class for easy blacklisting reference? :)
 
I have a little college programming experience but never got to classes, just one class on it. I could definitely figure out adding it to a list for x seconds with the guid if that's a way to do it :) I'm not sure how to make the class ignore what gets added to it. May be abit over my head for now atleast!
 
I haven't tested, but it compiles okay and seems like it should work well for the ten minutes I put into it (haha)

Code:
using Buddy.Wildstar.Game.Actors;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SuperUltraGigaPotato
{
    class BlackList
    {
        // Attributes.
        private List<BlacklistEntry> blacklist;

        // Constructor.
        public BlackList()
        {
            blacklist = new List<BlacklistEntry>();
        }

        // Methods.
        public void Add(Actor actor, int duration)
        {
            uint guid;
            DateTime time;

            // Sanity check.
            if (actor == null || !actor.IsValid)
                return;

            // If it's already in, update it instead.
            if (this.Get(actor) != null)
            {
                this.Get(actor).time = DateTime.Now.AddSeconds(duration);
                return;
            }

            // Isn't in, lets add it.
            guid = actor.Guid;
            time = DateTime.Now.AddSeconds(duration);

            blacklist.Add(new BlacklistEntry(guid, time));
        }

        public void Remove(Actor actor)
        {
            // Sanity check.
            if (actor == null || !actor.IsValid)
                return;

            // Make sure it exists so we can remove it.
            if (this.Contains(actor))
                blacklist.Remove(Get(actor));

        }

        public bool Contains(Actor actor)
        {
            return this.blacklist.Any(o => o.guid == actor.Guid);
        }

        public BlacklistEntry Get(Actor actor)
        {
            return this.blacklist.FirstOrDefault(o => o.guid == actor.Guid);
        }
    }




    class BlacklistEntry
    {
        internal uint guid;
        internal DateTime time;

        public BlacklistEntry(uint guid, DateTime time)
        {
            this.guid = guid;
            this.time = time;
        }
    }
}
 
So where would I put that class in? Thanks for the help I really appreciate it!
 
Usage:


Code:
BlackList ignoredNodes = new BlackList();


actor = GameManager.Actors.Values.Where(a => a.Name.Contains('Tree') && !blacklist.Contains(a)).OrderBy(a => a.Distance).FirstOrDefault();
if(actor != null)
{
    // Gather code here.

    blacklist.Add(actor, 60);
}
 
So where would I put that class in? Thanks for the help I really appreciate it!

You can change the namespace to whatever you wish to, then add a 'using <namespace> to your current work, and you'll be able to access the class.



I also just realized my implementation completely ignores the time duration on it (hahaha), so some tweaking required!
 
Ahh okay add it as a header file I gotcha now :) I'll let ya know how it goes!
 
I'm going to be able to get to it sometime tonight, if you're interested I have a crimson badlands and a grimvault gathering profiles that I'd be more than willing to share with you :)
 
You can change the namespace to whatever you wish to, then add a 'using <namespace> to your current work, and you'll be able to access the class.



I also just realized my implementation completely ignores the time duration on it (hahaha), so some tweaking required!
I can't seem to figure out the syntax to add the class to my profile. I have the class you wrote saved as an XMl doc is that right?
 
Oh, that's awkward!

It's actually a piece of C# code, so would have to be saved as .cs, and a LOT more fiddling would be required to actually integrate it into your gathering profiles if you're using ProfileBot (which I am now assuming is true)
 
Back
Top