Thread Tools Display Modes
05-22-10, 11:00 AM   #41
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
tName would contain the name of the person that handled that transaction so just putting [tName] would trigger a record for that name.

Unfortunately we can't create events out of the air. There is an event called GUILDBANK_UPDATE_WITHDRAWMONEY but not one called GUILDBANK_UPDATE_WITHDRAWITEM.

If you want to read up on what is currently available - they usually keep it well updated - visit http://www.wowwiki.com/Portal:Interface_customization. It is what I use most of the time and definitely in the early stages of addon development. Another good one I use alot is http://wowprogramming.com/. Both sites together will demonstrate the possibilities.

Hopefully at a later date Blizzard will work on these events so that they actually hold information for you to work with instead of having to go around the houses.

And, I hope this addon code will start you off to investigate things further and get a workable addon for what you want until they do fix things there.
__________________


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-22-10, 12:53 PM   #42
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ok thank you , i have realized to a couple of solutions to my problem

is there anyways i can make a function like display text of transaction(1,1)/(tab,transaction) when function ItemDepositGuildBank() (like i said i am not in good condition to research and work on the addon but i am throwing ideas, and hoping for some responses)

also do you think if istead of the GUILDBANK_SLOTCHANGED, we could use BAG_SLOTCHANGED (not sure proper event but i am sure it exist) would we experience the same problem where it keeps on refreshing?
  Reply With Quote
05-22-10, 01:08 PM   #43
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
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.
__________________


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-22-10, 02:13 PM   #44
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
somewhat understand, i am sorry if i seem a little out of touch(familly event)

i am sort of in confuddlement, does it really matter where i find the change in slots when i am trying to react to event. because id figure weather the change in slots in guild vault or the personal bags doesnt really matter because i believe it would produce the same transaction unless they were to create from trade goods to final product or something using professions, but then if that was to happen the last transaction would still be the same

so my questions are, does it matter where i scan, and wheather it will still cause the same loop effect as in guild bank slot chnge

(also i think the slot change command doesnt cause loop, but it may scan each slot for variables the 1st time around. i am somewhat trying to reserch for how many varibles does the scan requier. so if that is a case maybe i can make a count each time each slot has been fired the event, so maybe then i can create something like a cast bar to tell me or officers when the scan is complete.. but it does seam like a lot of trouble

so i am thinking of making an addon that makes a seperate window, that has guild tabs included with items in it but in text and its own function to withdraw, and its own bag tab for itas own deposit functions.
is it possibke?

if it is it maybe the simplest solution in game, but i know its difficult programing wise but i am willing to go the extra mile)
  Reply With Quote
05-22-10, 02:41 PM   #45
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
yes, it will matter which event you watch as the your bag change event triggers often and whenever you receive an item whether via trade, loot, craft etc. Even from your own bank to your bags will trigger the event. It also triggers several times when you first log in similar to the guildbank bag update event which is why I suspect it will be just as likely to cause repeating problems but perhaps not to the extent of the guild bank due to less slots ?

As to writing a complete bank control addon. Theoretically possible but I personally wouldn't have a clue how to go about that part of things without research as I haven't touched container based addons to see how they work.

And yes counting the times the event is called may be the best option. i use it for the LOGUPDATE event so that I only work on the transactions when all the bank tabs have been queried. With so little documentation on this part of the game it will be all trial and error to see how things 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-22-10, 02:43 PM   #46
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
"BAG_UPDATE"
Category: Item


Fired when a bags inventory changes. Bag zero, the sixteen slot default backpack, may not fire on login. Upon login (or reloading the console) this event fires even for bank bags. When moving an item in your inventory, this fires multiple times: once each for the source and destination bag. If the bag involved is the default backpack, this event will also fire with a container ID of "-2" (twice if you are moving the item inside the same bag).

arg1
container ID

i wonder if this event, fires when the bag slots change
  Reply With Quote
05-22-10, 02:48 PM   #47
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
alright, thank you again crystal. or should i say Xrystal
so, i guess i shall have to figure out what to do when i get back
this situation is fun yet frusturating, and like u i like to get things done, and because i want this so, i am not willing to surrender. i belive there is a loop whole somewhere, there is always in programing. and nothing is impossible

but i will look at some events and see if i understand and use them, i dont knwo if i should make a new post or continue posting them due to the fact that they relate to my current problme
  Reply With Quote
05-22-10, 02:50 PM   #48
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Only when you first login it will include your personal bank bags. Whether it will include the guild bank bags I don't know.

Sounds like a test for you. But seeing as it fires multiple times anyway you would have to count and see if it coincidently fires for each bag you carry with you and in the bank and in the guild bank. The question then is how do you identify which is which ? bagID perhaps but that could be simply 1 to x where x is the total number of bags it has found.

Play with the events and code a bit and when it looks like you have got your problem somewhat sorted update the thread in case others are reading it for their own inspiration
__________________


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-22-10, 04:00 PM   #49
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ok will do thank you crystal
  Reply With Quote
05-22-10, 04:45 PM   #50
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
hmm found a function that could be the answear to a probleme
but i dont know how to use it properly

PickupGuildBankItem(tab, slot)

is there a way to make this function an event?
  Reply With Quote
05-22-10, 04:48 PM   #51
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
also to get back to our other theory, how do i create a messege after a specific event fires that counts it like
event = 1
event = 2
  Reply With Quote
05-22-10, 04:55 PM   #52
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
hmm found a function that could be the answear to a probleme
but i dont know how to use it properly

PickupGuildBankItem(tab, slot)

is there a way to make this function an event?

That function is the same as 2 GUILDBANKBAGSLOTS_CHANGED events. It basically tells the addon to pick up the item in tab/slot and hold it in the hand waiting for step two to drop it in another slot in another tab/bag etc.
__________________


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-22-10, 04:57 PM   #53
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
ooo..
this is more coming to an idea that i may make a new ui addon
  Reply With Quote
05-22-10, 05:06 PM   #54
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
also to get back to our other theory, how do i create a messege after a specific event fires that counts it like
event = 1
event = 2
at the top of the lua file put local varCounter = 0; This creates a variable that is accessable by the whole file and until you reset it to 0 will keep counting up wherever you add the line varCounter = varCounter + 1. of course you can use whatever word you want instead of varCounter ( except reserved words that is ).

Then it would be the case of saying

if varCounter > lastNumber then
do some code here
end

Then whenever varCounter is higher than lastNumber it will execute the code.
__________________


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-22-10, 05:43 PM   #55
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
odly enough, i got back hime loaded the lua file fresh and now i get this error that i didnt face yesturday

Code:
Message: ...dOns\GuildBankTransactions\GuildBankTransactions.lua:47: attempt to index global 'GuildBankFrame' (a nil value)
Time: 05/22/10 19:40:13
Count: 1
Stack: ...dOns\GuildBankTransactions\GuildBankTransactions.lua:47: in function <...dOns\GuildBankTransactions\GuildBankTransactions.lua:44>

Locals: self = evFrame {
 0 = <userdata>
}
event = "PLAYER_LOGIN"
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'GuildBankFrame' (a nil value)"
refreshLogInfo = <function> defined @Interface\AddOns\GuildBankTransactions\GuildBankTransactions.lua:5
getLogInfo = <function> defined @Interface\AddOns\GuildBankTransactions\GuildBankTransactions.lua:16
lua code is here
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" );
quoted from post #24
  Reply With Quote
05-22-10, 05:45 PM   #56
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,929
Hmm very weird. Sounds like the GuildBankUI is a load on demand addon and doesn't load until you open the guild bank window. So perhaps PLAYER_LOGIN not a good idea to do that part of the code in.
__________________


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-22-10, 06:29 PM   #57
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
deleted this line
evFrame:RegisterEvent( "PLAYER_LOGIN" );
and yet the same errors shows up
  Reply With Quote
05-22-10, 06:32 PM   #58
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i deleted this and the add on ran like u meant it too
local evFrame = CreateFrame("Frame","evFrame",UIParent);
evFrame:SetScript( "OnEvent", onEvent );
evFrame:RegisterEvent( "PLAYER_LOGIN" );
evFrame:RegisterEvent( "GUILDBANKLOG_UPDATE" );
evFrame:RegisterEvent( "GUILDBANKFRAME_OPENED" );
maybe thats what i forgot to read beforee i started to do that
maybe u can explain to me what they were meant to do and why it screwd it up
(i dont know how to put a please in there lol but i ask with all sencerety and no expectation or demand)
  Reply With Quote
05-22-10, 06:44 PM   #59
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
found something entresting
am applying it code now but what do u think crystal
i think it would stop the looping

You can register your Frame-derived widget to receive an event using the frame:RegisterEvent("eventName") function. When the events occur, they will be delivered to the OnEvent script handler, which can be set using frame:SetScript("OnEvent", handlerFunc). To unregister an event, use frame:UnregisterEvent("eventName").
  Reply With Quote
05-22-10, 06:50 PM   #60
clowcadia
A Chromatic Dragonspawn
Join Date: Apr 2010
Posts: 186
i feel retarded, i wouldnt be suprised if u started ignoring this anyways
not gonna saywhat i did wrong or did right, because i have no idea
but ill play around abit till i get somthign concrete to say
  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