Jump to content

Node search radius


scsfl

Recommended Posts

Hi! 2 noob questions from me :)

1) How can I check is there any lootable node (felslate for example) in specific radius? Center of the circle is a bot.

2) Can I check a condition when some player put me in target? In other words i need to do some action when i've been selected by another player.

Link to comment
Share on other sites

Hello,

1: 

        float radius = 50;
        foreach (var o in ObjectManager.GetObjectWoWGameObject())
        {
            if (o.IsValid && o.GetDistance < radius && o.CanOpen)
            {
                // your code here
            }
        }

2:

        foreach (var o in ObjectManager.GetObjectWoWPlayerTargetMe())
        {
            if (o.IsValid)
            {
                // your code here
            }
        }

or 

        foreach (var o in ObjectManager.GetObjectWoWPlayer())
        {
            if (o.IsValid && o.IsTargetingMe) // o.IsTargetingMeOrMyPet
            {
                // your code here
            }
        }

 

Link to comment
Share on other sites

Thank you so much! So for felslate it's gonna look something like this:

 float radius = 50;
        foreach (var o in ObjectManager.GetObjectWoWGameObject())
        {
            if (o.IsValid && o.GetDistance < radius && o.CanOpen && o.Name == "Felslate Deposit")
            {
                // your code here
            }
        }

Right?

Link to comment
Share on other sites

  • 3 weeks later...

One more question. Is there way to detect stuck nodes? Yeah, I know there is an option in wrobot for this, but I need to do it manually in my plugin. Thanks :)

 

update: got it. U have to add following condition

!wManager.wManagerSetting.IsBlackListedAllConditions()
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...