updated bank balances
Anyone know of a way to "update" current bank balances data after depositing? Currently I'm having to add previous balance to deposited balance for correct numbers because this returns previous balance before depositing for example:
Code:
amount = GetBankedCurrencyAmount(CURT_TELVAR_STONES) <<<< if this was 100 |
Are you calling this the second time in response to an event? It may just be that you're calling it too early.
There's a few events that could be of interest: Code:
EVENT_TELVAR_STONE_UPDATE |
no event for it... other than openbank which calls the rest of the function but at the end it checks balance then deposits telvar and outputs to chat the sum of balance and deposit becase if i check balance again after its the same as before deposit.
I dont see why this wont work: Code:
local amount = GetCarriedCurrencyAmount(CURT_TELVAR_STONES) |
What I mean is that after depositing you need to wait for an event to fire before you can retrieve the updated balance.
|
Ahh.. Well ive managed to get it working with an event and a variable switch because i want the bank balances to display when opeing the bank but also when depositing and withdrawing so the switch disables the bank open display during my auto telvar deposit function and only allowed the currency event to display it. Seems to be working well so far in testing.
MORE IMPORTANTLY MAYBE I also noticed the new "live" api notes are incorrect. Code:
* EVENT_BANKED_CURRENCY_UPDATE (*[CurrencyType|#CurrencyType]* _currency_, *integer* _newValue_, *integer* _oldValue_) the variable positions are off.. it is actually(possibly old value but wildly incorrect, currency, newvalue). I sense a shift in the force here and it may not be functioning properly. As an example the "possibly old value" was returing a number in the 135,000 range when moving 10000 telvar in and out of bank when i have 160000. There was a missing 15000ish from what it was returning. The oldvalue could only have been 150000ish and 160000ish maybe the ZOS super powers will read this and get it fixed up if something is wrong with it :) |
The first parameter for all events is actually the event id, so that documentation is slightly misleading if you don't realise that. In this case, it's actually:
Code:
EVENT_BANKED_CURRENCY_UPDATE (*integer* _eventId_, *[CurrencyType|#CurrencyType]* _currency_, *integer* _newValue_, *integer* _oldValue_) |
oh! damn! I thought i discovered something useful there haha. thankyou ill get the _ in my code for that.
|
Ive managed to re-write it and eliminate the "EVENT_BANKED_CURRENCY_UPDATE" by passing variables from one function to the other which I should have thought of in the 1st place. Im trying to keep it as light weight as possible and I only needed it on bank open and telvar auto deposit so this works better for me.
|
All times are GMT -6. The time now is 05:24 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI