Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Stop ObjectManager updates?

Featured Replies

Hey Droidz,

I noticed sometimes ObjectManager is updated while I iterate it in my rotation. If I use a lot of checks on units in the ObjectManager, it can slow down my rotations a lot.
Sometimes iterations jump from 50ms to 500ms ("randomly") I noticed especially on TBC, this is because the ObjectManager in game gets huuuuge and wRobot takes a "long" time on every update.
I noticed (I think) ObjectManager gets locked during these updates and the lock makes my thread wait. Sometimes, this lock can happen two or three times during one iteration, if I get unlucky. 

One way to prevent this would be to deepcopy the entire ObjectManager (or use my own implementation, reading directly from memory with wRobot API). Both of this would be a loooot of work.
Therefore I have a question, something that would be way easier:

Can I stop ObjectManager from behind updated manually? Pseudo code here:

ObjectManager.DisablesUpdates();
for(spell in spells)
{
  if(spell.AllConditionsTrue())
  {
    spell.Cast();
	break;
  }
}
ObjectManager.EnableUpdates();

 

Hello,

In next update lock object will be public (wManager.Wow.ObjectManager.ObjectManager.Locker)

But it is hard to tell if it is the problem, you lock wow frame when you run this code (wManager.Wow.Memory.WowMemory.LockFrame();)? (500ms seem a lot to refresh objectmanager), you can try to use program like JetBrains dotTrace to check.

And I think the best for you is to request object list one time like:

Quote

try
{
    wManager.Wow.Memory.WowMemory.LockFrame();
    var units = ObjectManager.GetObjectWoWUnit();
    var players = ObjectManager.GetObjectWoWPlayer();
    for (spell in spells)
    {
        if (spell.AllConditionsTrue(ref units, ref player))
        {
            spell.Cast();
            break;
        }
    }
}
catch (Exception e)
{
}
finally
{
    wManager.Wow.Memory.WowMemory.UnlockFrame();
}

 

  • Author

I was locking frames before, that's why it confused me, that sometimes iterations took 400ms+.
Currently rewriting my rotation framework for TBC. Will try locking frames again and let you know. I think storing all units by reference is a good idea. I will look into that. 

If I still have any problems after next update, I will get back to you. Thanks!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.