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

ObjectManager.GetObjectsOfType<WoWPlayer>

Venus112

New Member
Joined
Jun 17, 2010
Messages
1,509
Reaction score
13
From what i can gather, the objectmanager is not bound by range, is it?

As some may know, i was rewriting the entire objectmanager and it seemed to work quite fine, but somehow it's broken now

It was set to check for class (if there was another paladin or a druid and buff BoM accordingly) and that everybody didn't have MOTW before buffing BoK.

But now, if druid or paladin has used portal and is out of range from me (because of this), i'll start buffing BoK and i'll spam it now. Untill i stop bot, go through portal to the group and then i'll buff BoM again when near them.

So as i asked : is objectmanager bound by range?

I've added the code involved if anybody would like to see what i'm trying to do (i'm sure it worked fine earlier -.-, but i can't seem to find the error)

Thank you for your time
Venus112
 

Attachments

in MOST cases your limited to the objects that the server spawns, for example if your looking for a node, the server wont spawn it till your in a certain range. same deal with just about everything else.

if they are in range of you, you'll get all the information from them, but lets say a player is out of sight and far away, not all the information is going to be available, like buffs for instance.
 
Ah, so i should stop trying to make this work?
I can't really see how i could make this work then with a problem like that? (Amature coder really)

Maybe i should just change it, so players can set a buff through GUI then...

----------------
edit: or is it possible to add a range check so objectmanager only checks players within 40 yards?
That way i'll always return it true at least if all others have zoned?
 
Last edited:
I am pretty sure that information about both party and raid members is available at "all" times and not bound by distance. However if it's shared in another manner then by the typical object manager i cant tell. (Just look at any team member in a regular team, as long as your in team/raid with a person you can see what zone they are in, where they are(location wise), what buffs they have. health, mana, energy and so on... Again this is team and raid members.)


And by the looks it seems like what your trying to do is checking team/raid.


I would try making WoWPlayer list, add each player whom are in your team / raid. Then use this list to do those checks, then you update the list on a pulse. adding players that way, and simply remove them by "!raidorteammember.IsInMyPartyOrRaid"
 
Last edited:
I don't see any faults in your code.

From what I remember when I was messing with ObjectManager.GetObjectsOfType<WoWPlayer> it is limited to a range of about 200 yards. Pretty much the maximum view distance you'd be able to see another player in game (with a high end spec pc and the graphics settings at max). My guess would be that if a player ports, GetObjectsOfType<WoWPlayer> will not include them in the list, as in effect, they will no longer be in the same zone/continent. Maybe build a list of players in your group and then look for any members leaving or joining the group may be another route to investigate.

Good luck
 
They are bound by range. It's like 80 meters
 
They are bound by range. It's like 80 meters

Ah bugger!
Was hoping that information was available at all times -.-

Guess i'll have to delete that code.
Dont really see any other way of doing it (there can be one, but i dont see it)..

Unless there's some way of adding a timer, so that 1 minute will pass when someone "leaves" our sight, before buffing again or something (getting into dangerous territory here, i dont see how it can be done)
 
Well if a ingame addon such as Healbot can know what buffs someone not in anyway near me have, there must be a way to do the same with Honorbuddy.
 
Code:
  List<WoWPlayer> PlrNearList2 = (from p in ObjectManager.GetObjectsOfType<WoWPlayer>() let d = p.Distance where d <= 40 && !p.IsFriendly orderby d ascending select p).ToList();
that will get you all friendly players who are less then 40 yards from you.
 
PHP:
System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
sw.Start();
if (sw.ElapsedMilliseconds >= 60000) {*do my stuff*}
This is how I do my stuff that needs timing
 
Well if a ingame addon such as Healbot can know what buffs someone not in anyway near me have, there must be a way to do the same with Honorbuddy.

There may well be through lua, I've never looked at that.

Don't give up there are many more avenues to try Venus112
 
There may well be through lua, I've never looked at that.

Don't give up there are many more avenues to try Venus112

Hehe there probably is, but i'm getting at the point, where it's getting too complicated for a amature like me :)
Dont know how to use the list or the timer that has been suggested in this thread anyways :D

What i've done so far, is add ability to turn off auto buffing in my GUI. That way people wont be getting spammed with buffing so far

------
Edit:

Buf if a player gets out of range, shouldn't the objectmanager exclude what buffs he has and then look at people remaining instead?
Asking this, as i have made my CC check that if there's a MOTW buff active, it should not buff BoK
 
Last edited:
Hehe there probably is, but i'm getting at the point, where it's getting too complicated for a amature like me :)
That's the best way to become a non-amateur. You don't know how to do something, figure it out. It makes you better.

Dont know how to use the list or the timer that has been suggested in this thread anyways :D

That's what learning is all about. Don't give up.
 
That's the best way to become a non-amateur. You don't know how to do something, figure it out. It makes you better.

That's what learning is all about. Don't give up.

I wont give up just yet, but i can't find any place to learn how to use these?
Everything i've found in the API documentation, is utter jibberish to me.
 
Code:
        public bool Havebuff(string BuffName)
        {
            string Buff = string.Format("local name = UnitBuff(\"raid\", \"{0}\"); " +
                                                 "return name", BuffName);
            string BuffNameLua = Lua.GetReturnValues(Buff)[0];

            return BuffNameLua == BuffName;
        }

The Lua Way to get them :)
 
Last edited:
Well if a ingame addon such as Healbot can know what buffs someone not in anyway near me have, there must be a way to do the same with Honorbuddy.

That's a derivative data: healbot or whatever can't actually see the buffs on people away from your sight, but it remembers if they have been seen recently and haven't died in the mean while.

In any case I'd play with the party/raid frame.
 
Code:
        public bool Havebuff(string BuffName)
        {
            string Buff = string.Format("local name = UnitBuff(\"raid\", \"{0}\"); " +
                                                 "return name", BuffName);
            string BuffNameLua = Lua.GetReturnValues(Buff)[0];

            return BuffNameLua == BuffName;
        }

The Lua Way to get them :)

Any way to use one Lua to look at both raid and party?

I've added the lua code, one for party and one for raid.

But currently i'm seeing it spamming BoM or BoK.

Added my buff section again, with the updated code.

Can't find the flaw that makes it go crazy wanting to keep buffing.


Also, could anyone give me a answer on what a static bool is? And how is it used here?

For instance

Code:
public static bool CheckForBuff(WoWPlayer Player, string SpellName)

It's not quite a simple as a public bool, as from that i would just have to do "if CheckForBuff == true then we'll do this", But it doesn't seem that simple here
 

Attachments

Last edited:
Code:
       public bool HaveBuffR(string BuffName)
        {
            string Buff = string.Format("local name = UnitBuff('player', \"{0}\", nil, 'RAID')); " +
                                                 "return name", BuffName);
            string BuffNameLua = Lua.GetReturnValues(Buff)[0];

            return BuffNameLua == BuffName;
        }

        public bool HaveBuffP(string BuffName)
        {
            string Buff = string.Format("local name = UnitBuff('player', \"{0}\", nil, 'GROUP')); " +
                                                 "return name", BuffName);
            string BuffNameLua = Lua.GetReturnValues(Buff)[0];

            return BuffNameLua == BuffName;
        }

try this
 
1) Object manager is limited to 100yds. (For all intents and purposes, just assume you can only see up to 100yds. This isn't always true, but 99% of the time it is.)

2) You can pull buffs from raid/party members regardless of where they are. Currently, its not wrapped in the HB API. (If they're within 100yds, you can do it via the WoWPlayer/WoWUnit class wrappers, otherwise, Me.RaidMemberInfos will provide you the data [excluding buffs, as its not wrapped in the HB API yet])

3) NEVER EVER USE SPELL NAMES IN LUA. If you plan on localizing the spell names, feel free. Otherwise, don't fuggin do it.
 
1) Object manager is limited to 100yds. (For all intents and purposes, just assume you can only see up to 100yds. This isn't always true, but 99% of the time it is.)

2) You can pull buffs from raid/party members regardless of where they are. Currently, its not wrapped in the HB API. (If they're within 100yds, you can do it via the WoWPlayer/WoWUnit class wrappers, otherwise, Me.RaidMemberInfos will provide you the data [excluding buffs, as its not wrapped in the HB API yet])

3) NEVER EVER USE SPELL NAMES IN LUA. If you plan on localizing the spell names, feel free. Otherwise, don't fuggin do it.

So what you're saying is, it's not possible to get further distances through some way?
WoWPlayer/WoWunit wrappers wont function because of range and Me.RaidMemberInfos wont provide buffs?
 
Last edited:
Back
Top