Thread Tools Display Modes
05-22-10, 07:12 PM   #61
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ok i think this is a valid try at a code, and i seam to have failed
Code:
elseif ( event == "GUILDBANK_ITEM_LOCK_CHANGED" ) then
                  QueryGuildBankLog(tab1);
                  local maxTabTrans = GetNumGuildBankTransactions(tab1);
                    for trans = 1,maxTabTrans do
                    tType, tName, itemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab, trans);
                      if trans == maxTabTrans then
                        if ( tab1 ) then tab1 = GetGuildBankTabInfo(tab1); end
                        print("Last Item Transaction: ",tab,maxTabTrans,tType, tName, itemLink, count, tab1, tab2, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
  Reply With Quote
05-22-10, 11:01 PM   #62
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
rofl, wasn't ignoring you .. just playing so not been on the forums.

Yeah I tried the unregister but the guildframe itself tracks the event for its own use and I try to avoid changing event rules for blizz frames.

And yeah I tried the query and use the info in one go before and it didn't work .. the query seems to trigger the logupdate event which is when you can look at the info. From what I have seen so far anyway.

One thing that I cant see from that code is whether tab1 is a variable set with a value that is available in that elseif block. If it isn't then that would explain it not working, crashing you out of wow etc as it would be a nil value and some functions absolutely hate nil values.
__________________


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-23-10, 12:14 AM   #63
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
Originally Posted by Xrystal View Post
if the BAG_SLOTCHANGED event exists it would be for your own inventory and not the guild itself. One event that does exist is ITEM_PUSH which tells you that you have received an item, whether by looting, trading, buying or grabbing from the bank.

I tried a direct transaction test and it wouldn't work at all. The only way I have ever got this working is doing a full tab by tab transaction by transaction read.

"BAG_UPDATE" argument ( bagID ) - This is called alot so yes, similar to that troublesome one we came across.

"ITEM_PUSH" arguments ( bagID, iconPath ) - Fired when an item is pushed onto the "inventory-stack". For instance when you manufacture something with your trade skills or picks something up.

In either case you would have to use a for loop to check each bag slot and use something like GetContainerItemLink(bagID, slotID) to get an ItemLink but this would not know where you received it from. You would have to track each event and then see if an ITEM_PUSH or BAG_UPDATE happened before or after a guildbank event and see if the itemLink matches the last transaction for each tab which itself would need a double for loop as a direct link to the last transaction doesn't seem to work. At least when I tried it earlier.
i dont think it really matters to the idea i have for the BAG_UPDATE event

i am still trying to fix privious error keep screwingup on somethign lol

but my idea is,
when guild vault open
when inventory open
when inventory change(BAG UPDATE)
read and print newest guild vault transaction end
end
end
  Reply With Quote
05-23-10, 12:57 AM   #64
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
btw thanks for not abandoning me-.-'' just really got into this and i a learning just slowly
  Reply With Quote
05-23-10, 01:54 AM   #65
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
so i achieved my goal for the first part of this basic addon, using the BAG Update

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("===")
              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("$$$")
          print("Last Money Transaction: ",maxMoneyTrans,tType, tName, amount, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
          print("=>End of Transactions<=")
       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 == "BAG_UPDATE" ) 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" );
evFrame:RegisterEvent( "BAG_UPDATE" );

Last edited by clowcadia : 05-23-10 at 02:03 AM.
  Reply With Quote
05-23-10, 03:14 AM   #66
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
playing aroudn with this

Code:
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 = { };
but still have no idea where to put it

also it seams that
MyAddOnSavedVariableFileName =
can actually record data, but i dotn know how to insert the trnasaction data after it has been given to me
  Reply With Quote
05-23-10, 03:35 AM   #67
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
part of the lua file, nothing changed accept this and i am not doing it right, i get an error. any suggestions?
atm i dont care who transaction it is, i just want the text that gets displayed in chat box when we enter the vault to appear in the saved variable file
cant rush this, because its good too well^^
Code:
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("===")
              print("Last Item Transaction: ",tab,maxTabTrans,tType, tName, itemLink, count, tab1, tab2, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
              tType, tName, itemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab,trans);
              GuildBankTransactions[tName].Items = { .... }
            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("$$$")
          print("Last Money Transaction: ",maxMoneyTrans,tType, tName, amount, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
          print("=>End of Transactions<=")
       end
     end
  end
end
  Reply With Quote
05-23-10, 05:48 AM   #68
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
Okay, to get a saved variables table up and running you need to give it a name in the toc file. You should see a SavedVariables line in there.

Now in the lua file you want to use the same table name to update it.

EG.

TOC file
SavedVariables : SavedVars

LUA file
SavedVars = SavedVars or {} -- Use existing table or create a new one

SavedVars[ID] = SavedVars[ID] or {} -- Use existing sub table or create one

SavedVars[ID].Value = aValue -- Create a value component and assign it

SavedVars[ID] = { val1 = 10, val2 = "Info", val3 = true } -- Create and assign a set of table values

Hopefully that will be enough to give you an idea of how things can work.
__________________


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-23-10, 10:21 AM   #69
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
is there something wrong in this table
Code:
 GuildBankTransactions = {              
              ["Transaction Type"] = tType
              ["Item Name"] = tName
              ["Item Count"] = count
              ["Transaction Time"] = RecentTimeDate(year, month, day, hour)
              }
i ty to fit it under
Code:
if ( trans == maxMoneyTrans ) then
          print("$$$")
          print("Last Money Transaction: ",maxMoneyTrans,tType, tName, amount, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
          print("=>End of Transactions<=")
Code:
elseif ( event == "GUILDBANKLOG_UPDATE" ) then
                  getLogInfo();
  Reply With Quote
05-23-10, 10:32 AM   #70
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
so lost
Code:
if trans == maxTabTrans then
              if ( tab1 ) then tab1 = GetGuildBankTabInfo(tab1); 
              do GuildBankTransactions = Tab1{                              
              ["Transaction Type"] = tType,
              ["Item Name"] = tName,
              ["Item Count"] = count,
              }
              end
              if ( tab2 ) then tab2 = GetGuildBankTabInfo(tab2); 
              do GuildBankTransactions = Tab2{                              
              ["Transaction Type"] = tType,
              ["Item Name"] = tName,
              ["Item Count"] = count,
              }
              end
              print("===")
              print("Last Item Transaction: ",tab,maxTabTrans,tType, tName, itemLink, count, tab1, tab2, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");       
           
            end
  Reply With Quote
05-23-10, 11:10 AM   #71
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ok anothing thing working
doesnt seam to work
i added at the begining of the lua
local messageCount= 0;

and made this code so since i some reason need to reload the bank frame 2s for my info i need to appear i made a message to appear the 1st time it open and the second time not appear
(i get errors on this code )
(this is within a working lua that seams to make the probleme)
Code:
if ( event == "GUILDBANKFRAME_OPENED" ) then
                  refreshLogInfo();
                  messageCount = messageCount + 1;
                  if messageCount = messageCount() + 1 then
                  message("Please Reload Me")
                  end
                  if messageCount < messageCount() + 1 end
  Reply With Quote
05-23-10, 11:10 AM   #72
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
You were almost correct there. You need to add commas at the end of each element in the table.
Code:
 GuildBankTransactions = {              
              ["Transaction Type"] = tType,
              ["Item Name"] = tName,
              ["Item Count"] = count,
              ["Transaction Time"] = RecentTimeDate(year, month, day, hour),
              }


Originally Posted by clowcadia View Post
is there something wrong in this table
Code:
 GuildBankTransactions = {              
              ["Transaction Type"] = tType
              ["Item Name"] = tName
              ["Item Count"] = count
              ["Transaction Time"] = RecentTimeDate(year, month, day, hour)
              }
i ty to fit it under
Code:
if ( trans == maxMoneyTrans ) then
          print("$$$")
          print("Last Money Transaction: ",maxMoneyTrans,tType, tName, amount, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
          print("=>End of Transactions<=")
Code:
elseif ( event == "GUILDBANKLOG_UPDATE" ) then
                  getLogInfo();
__________________


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-23-10, 11:17 AM   #73
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
You shouldn't need the messageCount value here as you only open the frame once after closing it. So you want that block of code to occur all the time.

EG.
At top of the lua
local messageCount = 0;

When you open the guildbankframe
messageCount = 0;

When the logupdate event happens
messageCount = messageCount + 1;
if ( messageCount > someNumberYouWantToTestFor ) then
useYourFunctionalityHere
end

When you have set up the code to execute when the messageCounter number is reached then reset the counter again .
messageCount = 0;

That way it is only executed the one time, you carry out the functionality you want at that point. Then you restart the counter and wait for it to happen again.


Originally Posted by clowcadia View Post
ok anothing thing working
doesnt seam to work
i added at the begining of the lua
local messageCount= 0;

and made this code so since i some reason need to reload the bank frame 2s for my info i need to appear i made a message to appear the 1st time it open and the second time not appear
(i get errors on this code )
(this is within a working lua that seams to make the probleme)
Code:
if ( event == "GUILDBANKFRAME_OPENED" ) then
                  refreshLogInfo();
                  messageCount = messageCount + 1;
                  if messageCount = messageCount() + 1 then
                  message("Please Reload Me")
                  end
                  if messageCount < messageCount() + 1 end
__________________


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-23-10, 11:39 AM   #74
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
awsome to evrything
but about saved varioobles
how do i print out in the saved variable file (i have 2 tabs in guild) both of my tabs, or more when i get more, and my money log together
also how do i keep adding the data rather then replacing it
  Reply With Quote
05-23-10, 11:52 AM   #75
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
Originally Posted by clowcadia View Post
awsome to evrything
but about saved varioobles
how do i print out in the saved variable file (i have 2 tabs in guild) both of my tabs, or more when i get more, and my money log together
also how do i keep adding the data rather then replacing it
The quickest way to print a table out is to recurse through it:

Code:
local function PrintTableContents(t)
  for i,v in pairs(t) do
    if ( type(v) == "table" ) then
      PrintTableContents(v);
    else
      print(i,v);
    end
  end
end

local function PrintSavedVariablesTable()
  PrintTableContents(GuildBankTransactions);
end
To keep the saved variables from overwriting each other before you write anything to the table tell it to use the values currently available and then tinsert the new values at the end. However, this may repeat information you already have unless you add tests in to see if they exist already.


Code:
-- Create a single transaction line table
local Transaction =  {              
              ["Transaction Type"] = tType,
              ["Item Name"] = tName,
              ["Item Count"] = count,
              ["Transaction Time"] = RecentTimeDate(year, month, day, hour),
              };

-- Use the existing table if it exists or create a new one
GuildBankTransactions = GuildBankTransactions or {};

-- Insert the transaction line into the Bank Transactions Table
tinsert(GuildBankTransactions,Transaction);
__________________


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-23-10, 01:26 PM   #76
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i am looking around for tutorials but nothign seams to explain the variables in what u had shown me
Code:
local function PrintTableContents(t)
  for i,v in pairs(t) do
    if ( type(v) == "table" ) then
      PrintTableContents(v);
    else
      print(i,v);
    end
  end
end

local function PrintSavedVariablesTable()
  PrintTableContents(GuildBankTransactions);
end
i am assuming i should leave PrintTableContents
but what does (t) contain
then i know i is index but how do i highlight the index and what is it index of
v is variable and i am assuming its the tables i have, but how do i highlight them to be paired
Code:
if ( type(v) == "table" ) then
      PrintTableContents(v);
and also dont know what this function should do
Code:
print(i,v);
(i think i sort of understand it but it be nice to understand)
  Reply With Quote
05-23-10, 01:47 PM   #77
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
Okay, here are some links you might find useful. It's where I learnt most of this stuff myself. It is worth sitting down and finding the different functions I used in there and see what they do and hopefully it will help you understand it somewhat. It might be a bit daunting to you if you are not a programmer but you will soon get to grips with it.

http://www.wowwiki.com/API_pairs
http://www.wowwiki.com/Lua_functions
http://www.wowwiki.com/Portal:Interface_customization


If you imagine you have a table set up as follows:
Code:
myTable = {
   value1 = { subvalue1 = 1, subvalue2 = "two", subvalue3 = false, ["subvalue4"] = "1" },
   value2 = 21,
   ["value3"] = "twenty three",
};
This code block would cycle through the outer table and output whatever information it comes across. if you print(i,v) you will see that v probably will show some 'table:123456' value or something similar. This is why we need the other function to repeat the process until the whole table is read. It took me a while to figure it out but it helped just to see what values were input.
Code:
for i,v in pairs(myTable)
  print(i,v);
end
If you change print(i,v) to something more information like the following it may help you further:
Code:
print(type(v),i,v);
This will print out the type of variable v is which will explain why I then use if ( type(v) == "table") then lines to break down the information further.

The PrintTableContents is a function you can use for any table. It will check to see if it contains an inner table and call itself to process the new table repeatedly until the whole table is read. The value t is a table value you pass to it. In this case you would call PrintTableContents whenever you want to print a table's contents like I did by calling PrintTableContents(GuildBankTransactions). If there is nothing there nothing will print or the word nil will be printed.
__________________


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-23-10, 02:35 PM   #78
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hehe it is kinda hard
well here i tryd and i dont think it did anything new, in here i renamed my tables for each tab after it has been querried and was ready to do the messege in the chat box and i think it did

but on the buttom i pasted ur functions to pair them up. but when i lanched the wow and launched the add on properly evrything ran fn and i got info in chat box, but when i quit i looked at the saved variables and it only printed on tab info

Code:
local tType, tName, itemLink, count, tab1, tab2, year, month, day, hour;
local queryCount = 0;
local messageCount = 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);              
              GuildBankTransactionsTab1 = {              
              ["Transaction Type"] = tType,
              ["Item Name"] = tName,
              ["Item Count"] = count,
              ["Transaction Time"] = RecentTimeDate(year, month, day, hour),
              }               
              end                
              if ( tab2 ) then tab2 = GetGuildBankTabInfo(tab2);              
              GuildBankTransactionsTab2 = {              
              ["Transaction Type"] = tType,
              ["Item Name"] = tName,
              ["Item Count"] = count,
              ["Transaction Time"] = RecentTimeDate(year, month, day, hour),
              }                           
              end   
              print("===")
              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("$$$")
          print("Last Money Transaction: ",maxMoneyTrans,tType, tName, amount, year, month, day, hour, "Time Conversion = (", RecentTimeDate(year, month, day, hour),")");
          print("=>End of Transactions<=")
       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();                  
                  messageCount = messageCount + 1;                  
                  if ( messageCount > 2 ) then
                  print("^^^")                                                   
                  elseif ( messageCount > 1 ) then
                  message("LogUpdated")  
                  elseif ( messageCount > 0 ) then
                  message("Reload Vault to make sure Addon Works Properly")                
                  end
                  
            elseif ( event == "BAG_UPDATE" ) 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 function PrintTableContents(t)
  for i,v in pairs(t) do
    if ( type(v) == "table" ) then
      PrintTableContents(v);
    else
      print(i,v);
    end
  end
end

local function PrintSavedVariablesTable()
  PrintTableContents(GuildBankTransactions);
end


local evFrame = CreateFrame("Frame","evFrame",UIParent);
evFrame:SetScript( "OnEvent", onEvent );
evFrame:RegisterEvent( "PLAYER_LOGIN" );
evFrame:RegisterEvent( "GUILDBANKLOG_UPDATE" );
evFrame:RegisterEvent( "GUILDBANKFRAME_OPENED" );
evFrame:RegisterEvent( "BAG_UPDATE" );
  Reply With Quote
05-23-10, 02:54 PM   #79
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,936
Ah see, for every separate table you want to have as a saved variable you need to add it to the TOC file's SavedVariables line.

EG.

SavedVariables: GuildBankTransactionTab1, GuildBankTransactionTab2

This example would allow you to use the tables GuildBankTransactionTab1 and GuildBankTransactionTab2 to store information in the WTF files.
__________________


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-23-10, 02:57 PM   #80
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
would it be the same file, i was thinking of it too but i dont really want seperate files atm
  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