Thread Tools Display Modes
05-21-10, 06:57 PM   #21
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Hmm very weird. Are you using the file I attached ? Just in case the files aren't talking to each other.

And you're opening the guild bank frame ?
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 05-21-10 at 06:59 PM.
  Reply With Quote
05-21-10, 07:01 PM   #22
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
yes i do both, i play aroudn with ur coding, but when i go back sometimes i re extract ur lua file to try new things

at the moment i cleared and pasted ur new code in the lua file.. nothing seams to happen.. no errors but
  Reply With Quote
05-21-10, 07:11 PM   #23
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ok i added it to previous code and it works
but did we look at it displaying data after a new transaction has happens

because i am assuming if the script reads bank slot changed, cant we ask it to do the same thing when it find the bank window open
ill look at it myself but u are providing the most amazing help. thank you
i wish i could give u a forum honor point u def deserve it
  Reply With Quote
05-21-10, 07:18 PM   #24
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
you deleted the whole lua file contents and replaced with my last code block ?

Add the local lines from the old code and the evframe lines you need those as well as that new block of code.

My apologies if I am confusing you This should be what the file should look like with the new changes.

Opening the GuildBankFrame should trigger the OPENED event and start the query run. Any event that involves a change in the guild bank sets up another query run. The Query run itself triggers the GUILDBANKLOG_UPDATE event which then outputs the information you want. Or should do

Code:
local tType, tName, itemLink, count, tab1, tab2, year, month, day, hour;
local queryCount = 0;


local function refreshLogInfo()
  queryCount = 0;
  for tab = 1,GetNumGuildBankTabs() do
    QueryGuildBankLog(tab);
    QueryGuildBankTab(tab);
  end		
  QueryGuildBankLog(MAX_GUILDBANK_TABS+1);
end



local function getLogInfo()
  queryCount = queryCount + 1;
  if queryCount == GetNumGuildBankTabs() + 1 then
    for tab = 1, GetNumGuildBankTabs() do
      local maxTabTrans = GetNumGuildBankTransactions(tab);
        -- For each transaction in the current tab extract the information required.
        for trans = 1,maxTabTrans do
          tType, tName, itemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab, trans);
            -- If this is the last transaction then we want to display it in some form
            if trans == maxTabTrans then
              if ( tab1 ) then tab1 = GetGuildBankTabInfo(tab1); end
              if ( tab2 ) then tab2 = GetGuildBankTabInfo(tab2); end
              print("Last Item Transaction: ",tab,maxTabTrans,tType, tName, itemLink, count, tab1, tab2, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
            end
         end
      end
      -- Now repeat the same process for the money log
      local maxMoneyTrans = GetNumGuildBankMoneyTransactions();
      for trans = 1,maxMoneyTrans do
        tType, tName, amount, years, months, days, hours = GetGuildBankMoneyTransaction(trans);
        if ( trans == maxMoneyTrans ) then
          print("Last Money Transaction: ",maxMoneyTrans,tType, tName, amount, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
       end
     end
  end
end


local function onEvent(self,event,...)

             -- Only work if the Guild Bank Frame is open 
	if ( not GuildBankFrame:IsVisible() ) then
		return;
	end

	if ( event == "GUILDBANKFRAME_OPENED" ) then
                  refreshLogInfo();

            elseif ( event == "GUILDBANKBAGSLOTS_CHANGED" ) then
                  refreshLogInfo();

            elseif ( event == "GUILDBANK_ITEM_LOCK_CHANGED" ) then
                  refreshLogInfo();

            elseif ( event == "GUILDBANK_UPDATE_MONEY" ) then
                  refreshLogInfo();

            elseif ( event == "GUILDBANK_UPDATE_TABS" ) then
                  refreshLogInfo();

            elseif ( event == "GUILDBANK_UPDATE_TEXT" ) then
                  refreshLogInfo();

            elseif ( event == "GUILDBANK_UPDATE_WITHDRAWMONEY" ) then
                  refreshLogInfo();

	elseif ( event == "GUILDBANKLOG_UPDATE" ) then
                  getLogInfo();

	end
end



local evFrame = CreateFrame("Frame","evFrame",UIParent);
evFrame:SetScript( "OnEvent", onEvent );
evFrame:RegisterEvent( "PLAYER_LOGIN" );
evFrame:RegisterEvent( "GUILDBANKLOG_UPDATE" );
evFrame:RegisterEvent( "GUILDBANKFRAME_OPENED" );
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-21-10, 07:20 PM   #25
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Originally Posted by clowcadia View Post
ok i added it to previous code and it works
but did we look at it displaying data after a new transaction has happens

because i am assuming if the script reads bank slot changed, cant we ask it to do the same thing when it find the bank window open
ill look at it myself but u are providing the most amazing help. thank you
i wish i could give u a forum honor point u def deserve it

I haven't tested the new code myself to confirm what happens but theoretically it should work. If you want to double check if the LOGUPDATE event is called add print(event,...) just after the local function onEvent line to tell it to print each event as it is triggered. If you see the LOGUPDATE event trigger but no print out something is going a bit crazy as it should be reading through your transactions for the tabs and printing the latest one.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-21-10, 07:24 PM   #26
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
thank you, its ok lol i understood after a moment

i am trying it now, but moving items doesnt seam to make it print out any thing new
  Reply With Quote
05-21-10, 07:34 PM   #27
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
wow, i like that idea of pritning events.
but yes the print even function works
but aperantly the only event that it responds too is startup of the add on and the bank window open
  Reply With Quote
05-21-10, 07:38 PM   #28
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
local evFrame = CreateFrame("Frame","evFrame",UIParent);
evFrame:SetScript( "OnEvent", onEvent );
evFrame:RegisterEvent( "PLAYER_LOGIN" );
evFrame:RegisterEvent( "GUILDBANKLOG_UPDATE" );
evFrame:RegisterEvent( "GUILDBANKFRAME_OPENED" );
evFrame:RegisterEvent( "GUILDBANKBAGSLOTS_CHANGED" ); --added that

and addind that when i went on to test what i does, i open guild vault and with out any changes it keeps running the event and the guild log update even with it
  Reply With Quote
05-21-10, 07:42 PM   #29
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
I suspect that new event only gets triggered when you move items around. They are newish events that wowwiki doesn't have documented well so I would have to play around to see which event gets triggered when you do stuff and go from there.

With some more testing I probably would be able to get more idea of what happens when.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-21-10, 07:47 PM   #30
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
thank you, and i am sorry for the trouble
  Reply With Quote
05-21-10, 08:27 PM   #31
voodoodad
Large, Friendly Letters!
 
voodoodad's Avatar
Join Date: Oct 2008
Posts: 1,632
Originally Posted by clowcadia View Post
thank you, and i am sorry for the trouble
Lol, I doubt there's any need to be sorry. Xrystal loves this stuff!

Thank GOD she left that evil boyfriend and came back to WoW!

What? She didn't lea...

Gotta go! Cat's got a furball!
__________________

~ no need to make the message completely obnoxious - Cairenn
  Reply With Quote
05-21-10, 09:42 PM   #32
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
rofl voodoo .. nope, I haven't left him but he decided wow was too content full to ignore for too long. We had a nice 6 month break.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-21-10, 10:16 PM   #33
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i am trying a new way to the addon
could i use GUILDBANKFRAME_OPENED as function, gonna try anyways but will be good to know the reasons why or why not
  Reply With Quote
05-21-10, 11:16 PM   #34
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
I don't know. I have always coded my addons the way I wrote this one. So I don't know if you can turn an event into a function.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-21-10, 11:55 PM   #35
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
lol, hmm i am getting the book "world of warcraft pramming" ish so happy very soon

so crystal this addon is very complicated? i didn't realizes the idea would be so complicated

i wonder if this would be easier the reason i am trying to do this, is do to the fact i am trying to give my officers and my co-gm unlimited power, but still have a special credit system
i am trying to make an addon to give to them, so evrytime they do something in guild vault it would record into saved variables and by the end of the week id receive it and see their progress

i have not learned about the saved variable files yet, i dont know if i should. but maybe its easier to have that doen then reacting on the chat box
  Reply With Quote
05-22-10, 01:15 AM   #36
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
SavedVariables are local to the client machine, so your officers could open them with a text editor and change them to anything they wish.

As for "using an event as a function", you make a frame register to listen for the specified event - when the event occurs, the specified function is called.

Example:
Code:
local MyFrame = CreateFrame("Frame", nil, UIParent)

MyFrame:SetScript("OnEvent",
		  function(self, event, ...)
			  if self[event] then
				  return self[event] (self, event, ...)
			  end
		  end)
MyFrame:RegisterEvent("GUILDBANKFRAME_OPENED")

function MyFrame:GUILDBANKFRAME_OPENED()
        DoStuffHere()
end
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.
  Reply With Quote
05-22-10, 02:39 AM   #37
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i understand the fact that its insecure, but i dont mind, i have trust issues and ppl who are my officers i know in real life and known for years and i am very picky with guildies i have
so i dont mind, and i am sure i can find a glitch one way or another
  Reply With Quote
05-22-10, 08:24 AM   #38
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
If you wanted to see who did what when to the guild bank you don't need to give the addon to anyone else. As GM you have unlimited power and should thus see every transaction that exists.

Unfortunately you are limited to manually checking the transaction or at least parking yourself by the bank waiting for an event to trigger. So, the best option is to every day/week etc you use the OPENED event to get the current transaction history and deal with it as you see fit.

The Name variable is the name of the character that did the transaction so you could perhaps work a data history based on user transaction.

EG.

tType, tName, itemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab,trans);
SavedVars[tName].Items = { .... };


tType, tName, amount, years, months, days, hours = GetGuildBankMoneyTransaction(trans);
SavedVars[tName].Money = { };

These lines would in essence record the last transaction per name or you could use the tinsert function to have a growing transaction history per name.

As to complexity. Apart from the limitations these functions seem to have this is a pretty simple addon

Edit: Well, added the extra event tests and the addon went wild and crashed me out of wow.. Maybe not a good idea to do it the way I coded at the moment .. rofl.

Edit2 : GuildBankUpdate_Tabs - Triggers on login but doesn't give you any information whatsoever. Even calling the query function doesn't trigger the log update function so we could do a tab by tab test *sigh*.

Edit2 : GUILDBANK_UPDATE_WITHDRAWMONEY - Triggers the LogUpdate after someone withdraws or deposits or uses the money. One to use.

Edit3 : I am starting to wonder if the GUILDBANK events are not quite finished yet. None of them contain arguments which doesn't make sense and some of them trigger other events several times for no apparent reason.
EG.
GUILDBANK_ITEM_LOCK_CHANGED is called twice when you remove an item but not at all when you add it. But in both cases it calls GUILDBANKBAGSLOTS_CHANGED 4 times and despite unregistering GUILDBANKBAGSLOTS_CHANGED to stop it looping it still loops repeatedly until I close the GUILDBANK window. But if you don't register this event at all it doesn't allow you to track an item change. And if you leave it registered it will disconnect you from the game for self spamming rofl.

The functionality currently available seems to make me wonder if you are better off just using the double for loop code I had running and keep a record of the last 25 transactions on a user by user basis.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 05-22-10 at 10:05 AM.
  Reply With Quote
05-22-10, 10:34 AM   #39
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i totaly agree with you
it seams that the bank slot change event over loops the action for me too, and maybe just saving the variable at start and end of the bank window sessions would just make it possible

it is too bad that the game seams to loop that specific event, although to my suprise you have taught me very well how to understand and code my own addon.
still will put ur reply to the test, but so far things u have showed me i used and played with and it works well to my advantage when it comes to posibility with the game, seams that its imposible to work one event that loops itself over and over

RESPONCE TO GUILD LOG MANAGEMENT: as for managing the log, there is only 25 entries available to me , and the fact that my main guys the officers are very actiive in the guild. we each put in or take out evryday atleast 10-20 stacks or items 2-4 times a day.

RESPONCE TO SAVING VARIABLES: hmm, thank you i think that would work, i am happy but there maybe available improovement to what i want since i cant react to the item slot changed
is there a way to filter through players names to select transactions that are based upon the character who is at the bank
say me "bloodcredit"

tType, tName, itemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab,trans);
SavedVars["bloodcredit"].Items = { .... };
  Reply With Quote
05-22-10, 10:38 AM   #40
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
also i got an idea, i cant test it myself atm. i am not asking u to bother with it, but maybe ull find it entresting as well so maybe u wanna try too
but either way when i come back ill try this impliment an event
do something like this

GUILDBANK_UPDATE_WITHDRAWMONEY

->GUILDBANK_UPDATE_WITHDRAWITEM
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trying to see guild bank transaction information


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off