Thread Tools Display Modes
05-26-10, 09:15 AM   #221
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
Originally Posted by clowcadia View Post
also i thinki i did this right to reset the message count i had(i changed its name)

Code:
-- If the GUILDBANKLOG_UPDATE event has been triggered due to refreshing the Log Info then process the Log Information we now have
	elseif ( event == "GUILDBANKLOG_UPDATE" ) then
	    ggbbscCount = 0;
		logCount = logCount + 1;
		getLogInfo(logCount);
	end
Yep, whenever you want to start from a new counter you do just that when you need it
__________________


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-26-10, 09:28 AM   #222
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
lol well here i got this

Code:
	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "GUILDBANKBAGSLOTS_CHANGED" ) then
	guildBankSlotsChanged = true;
	if ( bagUpdate ) then
		if ( GuildBankFrame:IsVisible() ) then
		ggbbscCount = ggbbscCount + 1;
		if ( ggbbscCount < 2 ) then
		print(event)
			refreshLogInfo(maxTabs+1);
			end
		end
	end
		
	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "BAG_UPDATE" ) then
	bagUpdate = true;
	if ( guildBankSlotsChanged ) then
		if ( GuildBankFrame:IsVisible() ) then 
			refreshLogInfo(maxTabs+1);
		end
	end
although it doestn seam to work, but i think i know why the last post where i put that reset.. it was a bad idea because it started looping again so i think it belongs somewhere else
  Reply With Quote
05-26-10, 09:34 AM   #223
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
Originally Posted by clowcadia View Post
lol well here i got this

Code:
	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "GUILDBANKBAGSLOTS_CHANGED" ) then
	guildBankSlotsChanged = true;
	if ( bagUpdate ) then
		if ( GuildBankFrame:IsVisible() ) then
		ggbbscCount = ggbbscCount + 1;
		if ( ggbbscCount < 2 ) then
		print(event)
			refreshLogInfo(maxTabs+1);
			end
		end
	end
		
	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "BAG_UPDATE" ) then
	bagUpdate = true;
	if ( guildBankSlotsChanged ) then
		if ( GuildBankFrame:IsVisible() ) then 
			refreshLogInfo(maxTabs+1);
		end
	end
although it doestn seam to work, but i think i know why the last post where i put that reset.. it was a bad idea because it started looping again so i think it belongs somewhere else
Try the reset in guildbankframeopened event and see if that does what you want. I think that would be the safest bet as you would most likely want to start afresh when you open the guildbankframe.
__________________


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-26-10, 09:37 AM   #224
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
good idea, but a set back the probleme is to intergate those 2 functions i think they need a reset
ut i got an idea
  Reply With Quote
05-26-10, 09:40 AM   #225
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ok the problem we had is that we made a loop with out the refresh and i think i managed it , well i know i did
lol you are an awsome teacher

Code:
	elseif ( event == "GUILDBANKFRAME_OPENED" ) then
		-- reset the tabProcessing status whenever we open the frame
		ggbbscCount = 0;
		tabProcessed = {};
		tabCount = tabCount + 1;
		logCount = 0;
		refreshLogInfo(tabCount);

	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "GUILDBANKBAGSLOTS_CHANGED" ) then
	ggbbscCount = 0;	
	guildBankSlotsChanged = true;
	if ( bagUpdate ) then
		if ( GuildBankFrame:IsVisible() ) then
		ggbbscCount = ggbbscCount + 1;
		if ( ggbbscCount < 2 ) then
		print(event)
			refreshLogInfo(maxTabs+1);
			end
		end
	end
		
	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "BAG_UPDATE" ) then
	ggbbscCount = 0;
	bagUpdate = true;
	if ( guildBankSlotsChanged ) then
		if ( GuildBankFrame:IsVisible() ) then 
			refreshLogInfo(maxTabs+1);
		end
	end
  Reply With Quote
05-26-10, 09:41 AM   #226
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
one in guild bank slot should be there
need to find a place for it
  Reply With Quote
05-26-10, 09:50 AM   #227
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
if ( ggbbscCount < 2 ) then
how can i have a function doing something like
if ( ggbbscCount = 2 ) then

and i looked around for sign information for lua , i saw it befre but completely lost it
  Reply With Quote
05-26-10, 10:13 AM   #228
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i seam to have no controll over how many time it seams to want to update
so i think our best solution if we find that it duplicated it in tables is to remove table that has been duplicated
  Reply With Quote
05-26-10, 10:26 AM   #229
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
okay, looked at the function date("*t") and it returns a table like thus:

currentDateTime = date("*t")

if we wrote currentDateTime to the wtf file it would show as thus
currentDateTime = {
hour = 17,
min = 6,
day = 26,
month = 5,
year = 2010,
sec = 40,
... and some others
}

And using the theory I had to get the timedate difference may have worked .. would need some further testing to be on the safe side but here goes..

Current DateTime : 2010:05:26:17
Transaction DateTime : 0:0:0:15
Difference DateTime : 2010:05:26:02

So, when I look at my log record for that tab and look at the last transaction it should show that it is 15 hours old at most and thus created at 2am this morning rofl.

Yep, 15 hrs ago someone withdrrew something

Anyway heres the code for you to play with now

At top of lua file
Code:
local diffYear, diffMonth, diffDay, diffHour
local currentDateTime
In either ProcessTransaction or updateTransactionHistory or updateLastPlayerTransaction function depending on when you want to use it
Code:
diffYear = currentDateTime.year - year;
diffMonth = currentDateTime.month - month;
diffDay = currentDateTime.day - day;
diffHour = currentDateTime.hour - hour;

-- Convert to string for printing		
cdtString = currentDateTime.year .. ":".. currentDateTime.month..":"..currentDateTime.day..":"..currentDateTime.hour;
tdtString = year..":"..month..":"..day..":"..hour;
ddtString = diffYear..":"..diffMonth..":"..diffDay..":"..diffHour;
I put this in getLogInfo so that the currentDateTime for the moment you do the extraction of data it would be as close to the current time as possible.
Code:
currentDateTime = date("*t");
__________________


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-26-10, 10:28 AM   #230
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
Originally Posted by clowcadia View Post
i seam to have no controll over how many time it seams to want to update
so i think our best solution if we find that it duplicated it in tables is to remove table that has been duplicated
Yeah annoying huh

Hopefully it will get to the point where you can easily identify if a transaction has already been extracted and ignore it.
__________________


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-26-10, 10:34 AM   #231
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hehe thanks crystal
(frustrating, yet fun how odd)
ok i have some questions thoough

is there a way to filter tables? like matching a table with another say
table{} == table{}

then is this possible example form but id like to know the ral thing i know it doesnt work
if ( blah = 2 )
i am actually guessing it is if ( blah == 2 )
and can i do this if i dont want to reset but stateits new number
blah = 1;
  Reply With Quote
05-26-10, 11:06 AM   #232
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
Originally Posted by clowcadia View Post
hehe thanks crystal
(frustrating, yet fun how odd)
ok i have some questions thoough

is there a way to filter tables? like matching a table with another say
table{} == table{}

then is this possible example form but id like to know the ral thing i know it doesnt work
if ( blah = 2 )
i am actually guessing it is if ( blah == 2 )
and can i do this if i dont want to reset but stateits new number
blah = 1;
Yep, == means compare and = means assign.

variable1 == variable2 ... is variable1 the same as variable2
variable1 ~= variable2 .. is variable1 not the same as variable2

table comparison hmm .. table1 == table2 won't compare as they have different IDs . print(table1) print(table2) will show this.

This I think is where that pairs thing comes into play.

-- assume matched table until one element is reached that doesn't exist or match
-- Loop through table t1 until all elements have been compared with table t2. One single difference will mean it is different. You may have to use tolower(value) I think to convert character types to a consistent case.
Code:
local function compareTables(t1,t2)
       for i1,v1 in pairs(t1) do
           for i2,v2 in pairs(t2) do
                lastMatch = false;   -- assume match is false
                if ( i1 == i2 and v1 == v2 ) then
                   lastMatch = true;
                   break;
               end
               -- If we couldn't find a match in t2 then they dont match so break out now
               if ( lastMatch == false ) then 
                  break;
              end
          end
      end
end
-- use this where you want the compare loop to start
Code:
compareTables(table1,table2)
if ( lastMatch ) then 
   table1 is the same as table2 so do stuff accordingly
else
   they don't match so do something else
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-26-10, 12:15 PM   #233
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
man lol i cant seam to get it right, evrytime i try to make a transaction so it can write new entry in personal tab its an item late or 2
would u be able to help me figure the problme
Code:
-- Lines beginning with '--' are comments.  
-- These help you to place descriptions about the functions you are using to help you months down the line when you need to change things.

-- These are values that once set are available throughout the addon, set them when you need to and then use them anywhere afterwards
local tType, tName, tItemLink, count, tab1, tab2, year, month, day, hour;
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice;
local queryCount = 0;
local messageCount= 0;
local transactionLine = {};
local maxTabTransactions = 0;
local maxTabs = 0;
local maxMoneyTransactions = 0;
local currentDate = date("%m-%d-%y")
local pName;
local tabCount = 0;
local refreshCount = 0;
local logCount = 0;
local tabProcessed = {};
local Queried = false;
local transNumCount = 0;

GuildBankTransactionsHistory = GuildBankTransactionsHistory or {}
GuildBankTransactionsTabs = GuildBankTransactionsTabs or {}
GuildBankTransactionsMoney = GuildBankTransactionsMoney or {}

-- The following is a block comment and allows for large segments to be comments instead of a line by line basis
--[[  Functions and their uses

Functions you can change to suit your requirements
=====================================================================================================================================
updateTransactionHistory(tab,index) - You use this to write to the GuildBankTransactionsHistory saved variable table specifically for tab transactions
updateMoneyTransactionHistory(index) - You use this to write to the GuildBankTransactionsHistory saved variable table specifically for money transactions
updateLastPlayerTransaction(tab) - You use this to write to the GuildBankTransactionsTabs saved variable table if you made the last tab transaction
updateLastPlayerMoneyTransaction() - You use this to write to the GuildBankTransactionsMoney saved variable table if you made the last money transaction

Functions you can change if you want to change what to store on each transaction line
=====================================================================================================================================
processTransaction(tab,index) - You use this to grab the information you want to store from the tab log in the saved variable table and when 
processMoneyTransaction(index) - You use this to grab the information you want to store from the money log into the saved variable tables and when

Functions you can change as you see fit
=====================================================================================================================================
displayMessages() - This is your function to display a message to you the user

Functions you should no longer need to change as they do every they need and passes the information onto another function to process
=====================================================================================================================================
processMoneyLog() - This function grabs every information it can from the money log transaction ready for you to use
processTabLogs() - This function grabs every information it can from the tab logs transactions ready for you to use
refreshLogInfo() - This function queries the log so that the transaction information is ready for us to use
getLogInfo() - This function gets us ready to use the data we just queried
onEvent(self,event,...) - This is the addons main frames event function and is the starting point of any addon process

--]]

-- This is the function that will update the relevant SavedVariables table
local function updateTransactionHistory(tab,index)    
	-- For this we are using GuildBankTransactionsHistory table
	
	-- Use the existing table or create a new one
	GuildBankTransactionsHistory = GuildBankTransactionsHistory or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsHistory[tab] = GuildBankTransactionsHistory[tab] or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsHistory[tab][currentDate] = GuildBankTransactionsHistory[tab][currentDate] or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsHistory[tab][currentDate][index] = GuildBankTransactionsHistory[tab][currentDate][index] or {};
	
	-- Add the transaction
	GuildBankTransactionsHistory[tab][currentDate][index] = transactionLine;
	
end

-- This is the function that will update the relevant Saved Variables table
local function updateMoneyTransactionHistory(index)
	-- For this we are using GuildBankTransactionsHistory table
	
	-- Use the existing table or create a new one
	GuildBankTransactionsHistory = GuildBankTransactionsHistory or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsHistory["Money"] = GuildBankTransactionsHistory["Money"] or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsHistory["Money"][currentDate] = GuildBankTransactionsHistory["Money"][currentDate] or {}

	-- Use the existing sub table or create a new one
	GuildBankTransactionsHistory["Money"][currentDate][index] = GuildBankTransactionsHistory["Money"][currentDate][index] or {};
	
	-- Add the transaction
	GuildBankTransactionsHistory["Money"][currentDate][index] = transactionLine;
end

-- This is the function that will update the relevant SavedVariables table
local function updateLastPlayerTransaction(tab)
	-- For this we are using GuildBankTransactionsTabs to hold information

	-- Use the existing table or create a new one
	GuildBankTransactionsTabs = GuildBankTransactionsTabs or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsTabs[tab] = GuildBankTransactionsTabs[tab] or {}
	
	-- Use the existing sub table or create a new one
	GuildBankTransactionsTabs[tab][pName] = GuildBankTransactionsTabs[tab][pName] or {};
	
	-- If you made this transaction then store the details or store another message
	if ( tName == pName ) then
	
	--number of transaction
	GuildBankTransactionsTabs[tab][pName][transNumCount] = GuildBankTransactionsTabs[tab][pName][transNumCount] or {};
	    -- this inserts a new table to privious once
		tinsert( GuildBankTransactionsTabs[tab][pName][transNumCount], transactionLine );
	else
		GuildBankTransactionsTabs[tab][pName] = { "You didn't make the last transaction" };
	end
	
end

-- This is the function that will update the relevant SavedVariables table
local function updateLastPlayerMoneyTransaction()
	-- We are using GuildBankTransactionsMoney as a SavedVariables table to hold the money transactions for your player
	
	-- Use the existing table or create a new one
	GuildBankTransactionsMoney = GuildBankTransactionsMoney or {}
	
	-- Use the existing table or create a new one
	GuildBankTransactionsMoney[pName] = GuildBankTransactionsMoney[pName] or {}
	
	-- If you made this transaction then store the details or store another message
	if ( tName == pName ) then
	    -- this inserts a new table to privious once
		tinsert( GuildBankTransactionsMoney[pName], transactionLine );
	else
		GuildBankTransactionsMoney[pName] = { "You didn't make the last transaction" };
	end
	
end

-- This is the function we can use to process the last tab transaction line read 
local function processTransaction(tab,index)

	-- If tab1 and tab2 have valid values then get their names for clarity
	if ( tab1 ) then tab1 = GetGuildBankTabInfo(tab1); end
	if ( tab2 ) then tab1 = GetGuildBankTabInfo(tab2); end       
	
	-- Record the transaction line in a table for easier insertion into main table
	transactionLine = { 
		["Transaction Type"] = tType,
		["Tab"] = tab,
		["Players Name"] = tName,
		["Item"] = itemLink,
		["Item Selling Value"] = itemSellPrice,
		["Item Count"] = count,
		["Transaction Time"] = hour,
	};
	
	-- We want to update the transaction history regardless of who or which transaction it is
	updateTransactionHistory(tab,index);
	
	-- If this is the last transaction for the tab then see if it was yours
	if ( index == maxTabTransactions ) then 
		updateLastPlayerTransaction(tab); 
	end
end

-- This is the function we can use to process the last money transaction line read.
local function processMoneyTransaction(index)

	-- Because the data is in memory since the last read we can just format the information we want into a transaction line
	transactionLine = { 
		["Transaction Type"] = tType,
		["Player's Name"] = tName,
		["Amount"] = amount,
		["Transaction Time"] = hour,
	};
	
	-- Store transaction history for the Money Log
	updateMoneyTransactionHistory(index);
	
	-- If this is the last transaction then we want to see if you the player made it
	if ( index == maxMoneyTransactions ) then
		updateLastPlayerMoneyTransaction();
	end
end

-- Once you have the functions below doing what you want you shouldn't need to touch them anymore.  
-- Just adjust the functions above to change what you want to do with the data

-- This is the function that will process the Money Logs
local function processMoneyLog()

	-- if we have processed this tab already then no need to do it again
	if ( tabProcessed[maxTabs+1] ) then return end

	-- Get the maximum number of transaction that the money log contains
	maxMoneyTransactions = GetNumGuildBankMoneyTransactions();
	
	-- Give us a debug message of how many transactions there are... you will know if it is wrong :D
	print("processMoneyLog : maxMoneyTransactions = ", maxMoneyTransactions);
	
	-- For each line in the transactions we want to process them
	for index = 1,maxMoneyTransactions do
	
		-- Get the details for the transaction line
		tType, tName, amount, years, months, days, hours = GetGuildBankMoneyTransaction(index);
		
		-- Process the transaction as we see fit
		processMoneyTransaction(index);
		
	end
	
	-- If there were transactions or we have read all the tabs then we must have processed this log already
	if ( maxMoneyTransactions > 0 or queryCount > maxTabs ) then
		tabProcessed[maxTabs+1] = true;
	end
	
end

-- This is the function that you use to get the information out of the tabs
local function processTabLogs()
	
	-- Get your player name for testing later on
	pName = GetUnitName("player");
	
	-- For each tab in the guild bank we want to process the transactions
	for tab = maxTabs, 1, -1 do
	
		-- Set the current tab we want to work with ( its seems to like us to do this :D )
		SetCurrentGuildBankTab(tab);
	
		-- Get the maximum number of transactions this tab contains
		maxTabTransactions = GetNumGuildBankTransactions(tab);
		
		-- If this tab has not been processed yet and it has transactions then process it
		if ( not tabProcessed[tab] and maxTabTransactions > 0 ) then
			
			-- Give us a debug message of how many transactions on the current tab there are... you will know if it is wrong :D
			print("ProcessTabLogs : tab = ", tab, " maxTabTransactions = ", maxTabTransactions);
				
			-- For each line in the transactions we want to process the information
			for index = 1, maxTabTransactions do       
			
				-- Get the values for this transaction
				tType, tName, tItemLink, count, tab1, tab2, year, month, day, hour = GetGuildBankTransaction(tab, index);
				    
				    --For each Item in the transactions we want to process the Selling to Vendor Value
				    itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(tItemLink); 
				
				-- process the transaction we have now retrieved
				processTransaction(tab,index);
			end

		end
		
		-- If there were transactions or we have read all the tabs then we must have processed this tab already
		if ( maxTabTransactions > 0 or queryCount > maxTabs ) then
			tabProcessed[tab] = true;
		end
		
	end
	SetCurrentGuildBankTab(1);
end

-- This is the function that will refresh the log information
local function refreshLogInfo(tabCount)
	-- Get the maximum number of bank tabs the guild bank currently has
	maxTabs = GetNumGuildBankTabs();
	queryCount = 0;
	
	-- We have been incrementing tabCount to ensure we get all the information
	-- But if the tabCount is more than there are tabs then we have all the information at hand so query the whole lot
	if ( tabCount > maxTabs ) then
		QueryGuildBankLog(MAX_GUILDBANK_TABS+1);
		for tab = 1,maxTabs do
			SetCurrentGuildBankTab(tab);
			QueryGuildBankLog(tab);
			QueryGuildBankTab(tab);
		end
		
		-- Then reset back to the original tab and reset the tabCount
		SetCurrentGuildBankTab(1);
		tabCount = 0;
	end
	
end

-- This is the function that starts the information gathering off
local function getLogInfo()
	queryCount = queryCount + 1;
	processTabLogs();	
	processMoneyLog();	
end

-- This is the function that the frame will use to process the events as they happen
local function onEvent(self,event,...)
	
	-- When this addon is loaded make sure the Blizzard GuildBank UI is loaded
	if ( event == "ADDON_LOADED" ) then
		if ( arg1 == "GuildBankTransactions" ) then
			if ( not IsAddOnLoaded("Blizzard_GuildBankUI") ) then
				LoadAddOn("Blizzard_GuildBankUI");
			end
			tabCount = 0;
			logCount = 0;
		end

	-- If you have just opened the guild bank frame then refresh the Log Information
	elseif ( event == "GUILDBANKFRAME_OPENED" ) then
		-- reset the tabProcessing status whenever we open the frame
		tabProcessed = {};
		tabCount = tabCount + 1;
		logCount = 0;
		refreshLogInfo(tabCount);
		
		if ( event == "GUILDBANKBAGSLOTS_CHANGED" ) then
		if ( GuildBankFrame:IsVisible() ) then
		guildBankSlotsChanged = true;
		end
		end

	-- If your bag has had an update and the guild bank frame is open then refresh the Log Info just in case it was a guild bank transaction too
	elseif ( event == "BAG_UPDATE" ) then	  
		if ( GuildBankFrame:IsVisible() ) then 
			if ( guildBankSlotsChanged ) then
			refreshLogInfo(maxTabs+1);
			end
			end
		
		
	-- When the blizzard GuildBankUI is loaded it processes each tab so lets use that to get our info
	-- It also does this when you first open the frame 
	elseif ( event == "GUILDBANK_UPDATE_TABS" ) then
		tabCount = tabCount + 1;
		refreshLogInfo(tabCount);
		
	-- If the GUILDBANKLOG_UPDATE event has been triggered due to refreshing the Log Info then process the Log Information we now have
	elseif ( event == "GUILDBANKLOG_UPDATE" ) then
		logCount = logCount + 1;
		transNumCount = transNumCount + 1;
		getLogInfo(logCount);
	end
end


-- Create the Frame that will handle any events, it currently has no physical form but it is in memory
local evFrame = CreateFrame("Frame","evFrame",UIParent);

-- Inform the frame that it will process several events
evFrame:SetScript( "OnEvent", onEvent );

-- Inform the frame which events it will process
evFrame:RegisterEvent( "ADDON_LOADED" );
evFrame:RegisterEvent( "BAG_UPDATE" );
evFrame:RegisterEvent( "GUILDBANKLOG_UPDATE" );
evFrame:RegisterEvent( "GUILDBANKFRAME_OPENED" );
evFrame:RegisterEvent( "GUILDBANK_UPDATE_TABS" );
  Reply With Quote
05-26-10, 12:39 PM   #234
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
lol i think i have to make event such as guild vault close and ui restart or something to run it properly
  Reply With Quote
05-26-10, 01:12 PM   #235
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hehe item lock event is worse then bag update that i find, it only tells actions like move nothignt o do with another interface like guild
  Reply With Quote
05-26-10, 01:53 PM   #236
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
also i got a question, how do u force events to happen? since the reall update of this addon happens at the very beginign when the vault opens but after that u do other functions but they dont trigger it
  Reply With Quote
05-26-10, 02:25 PM   #237
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
I don't know what triggers some of those functions yet as they are relatively new. Usually the descirption is enough. Moving an item from tab to tab will usually trigger an event opening and closing triggers another. moving an item from bank to bag and the reverse. It's just learning how to deal with it. Usually those type of functions have parameters that help you work out which item moved from which slot in which bag etc but these functions for the guild bank haven't got those parameters for some reason so all we can do is track the last group of transactions to see if any match anything we can get from another event that got triggered.

EG.

A movement from bank tab to bank tab ... hard to say as all we can do is look read the transactions for all tabs and see which two tabs had a movement transaction between them.
tab1 transaction will show tab1=tab1 and tab2=tab2 and
tab2 transaction will show tab1=tab1 and tab2=tab2 etc
with type being movement

if we use BAG_UPDATE as an event trap it will tell us what bag updated but not what slot so hard to say but when used in conjunction with BANKBAG_UPDATE to find out if that had an update we will know it may be a transaction in the bank, so we check the transactions to find out if there was a withdrawal or deposit. If it was a withdrawal you should be able to confirm by checking the bagID for your bag and see if an item in one of the slots match the item that was withdrawn.

Also, might be worth checking to see what the values of tab1 and tab2 are in each transaction line if you deposit, or withdraw perhaps one will hold nil or maybe the bagID that it was withdrawn to.
__________________


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-26-10, 02:43 PM   #238
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hmm make sense
in this add on u trap it at guild bank log updates, i think its a good idea. but it only traps it at the beginning. is there somehow we can trap the complete query at the bag update or guild slot changed event. they act upon each-other but i am sure lll figure it out sometime next week . haven't had sleep tonight so i a a lil funny minded

but i think thats the biggest issue i have at the moment anything else we can combat lol
we made this cool add-on ^^ thank you
  Reply With Quote
05-26-10, 03:22 PM   #239
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,962
Originally Posted by clowcadia View Post
hmm make sense
in this add on u trap it at guild bank log updates, i think its a good idea. but it only traps it at the beginning. is there somehow we can trap the complete query at the bag update or guild slot changed event. they act upon each-other but i am sure lll figure it out sometime next week . haven't had sleep tonight so i a a lil funny minded

but i think thats the biggest issue i have at the moment anything else we can combat lol
we made this cool add-on ^^ thank you
At the moment guild bank log update is triggered when guild bank tab updates which happens once for each tab when you log in but we cant do anything then and then once again when you open the guild bank, hence we run the query when the guild bank is open. Sometimes however the guild bank tab doesn't update all the time hence sometimes it triggers once and gets all the tab information .. so not a problem or it triggers it once for each tab and only gets information for tabs up to that point.

EG.
If it triggers 4 times for 4 tabs :
1: tab1 trans count = 25, tab2 trans count = 0, tab3 trans count = 0, tab4 trans count = 0
2: tab1 trans count = 25, tab2 trans count = 25, tab3 trans count = 0, tab4 trans count = 0
3: tab1 trans count = 25, tab2 trans count = 25, tab3 trans count = 25, tab4 trans count = 0
4: tab1 trans count = 25, tab2 trans count = 25, tab3 trans count = 25, tab4 trans count = 25
and then we we want to force the read of the money log which currently shows as 0 as when it was triggered before the log hadn't been read

This is why sometimes we have to wait until it has triggered 4 times and sometimes it triggeres once and all 4 tabs will get updated. I still haven't figured out why that is. It may be a bug or the fact the feature hasn't been finished rofl. So, maybe down the line you may find the addon will need to get tweaked to suit changes related to the guild bank system.
__________________


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-27-10, 05:28 AM   #240
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hey crystal i relaised what it is i think
it has something do do with ur counts on when to process the new information what the bag update hits
i am working with the new original file at the moment. and nothing i seem to play with allows bag update to process new information
we had dont it before with the basic one
ji just dont know why i cant seam to make it work here
(reason i am trying this is that i want it to make more tables for every time a bag change happens

i will also input guild bank slot change just to clarify the process but that is later
  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