StrangerThanFiction
New Member
- Joined
- Nov 24, 2012
- Messages
- 241
- Reaction score
- 3
Not sure if this is going to be core DB or Trinity Caching...
Trying to fix a glitch in the AutoEquipper CheckMerchant and BuyPotion methods...
Essentially when you issue the
method you can not immediately find the item in your backpack....
In the case of potions:
But get a null result.... Same thing happens with items..
However after waiting 1-2 pulses it will finally return an ACDItem....
I can think of 2 ways around this..
1) Wait for 2 pulses before continuing (Current Solution, But is very ugly [Sometimes results in an exception -_-])
2) Force an update...
Tried using the Update method but no dice...
The only other thing I can think of is that the method itself locks the memory.. And that a memory update would not take place until the method is finished....
See this in a exception when I try to let it run with a null
Am at a loss
Trying to fix a glitch in the AutoEquipper CheckMerchant and BuyPotion methods...
Essentially when you issue the
Code:
ZetaDia.Actors.Me.Inventory.BuyItem
In the case of potions:
Code:
ZetaDia.Me.Inventory.Backpack.Where(i => (i.IsPotion) && (i.RequiredLevel <= ZetaDia.Me.Level)).OrderByDescending(p => p.ItemStackQuantity).FirstOrDefault()
But get a null result.... Same thing happens with items..
However after waiting 1-2 pulses it will finally return an ACDItem....
I can think of 2 ways around this..
1) Wait for 2 pulses before continuing (Current Solution, But is very ugly [Sometimes results in an exception -_-])
2) Force an update...
Tried using the Update method but no dice...
Code:
using (ZetaDia.Memory.AcquireFrame())
{
ZetaDia.Actors.Update();
}
The only other thing I can think of is that the method itself locks the memory.. And that a memory update would not take place until the method is finished....
See this in a exception when I try to let it run with a null
Code:
[GilesEquipper 1.7.5.3] System.NullReferenceException: Object reference not set to an instance of an object.
at Zeta.MemoryManagement.FrameLock.Dispose()
at GilesEquipper.GilesEquipper.CheckPotions()
at GilesEquipper.GilesEquipper.OnPulse()
Am at a loss

Last edited: