Thread Tools Display Modes
02-11-07, 12:42 PM   #1
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
Saved Variables

is it possible to access the save varaibles of one addon from another addon dependent on the first one if so how?
  Reply With Quote
02-11-07, 02:23 PM   #2
rte
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2005
Posts: 6
yes, saved variables are just like any other variable, so you can access them directly from wherever, all you need to know to do that is the name of such variable.
For example:
Addon A has a variable called varA;
Your addon B wants to access the data stored in varA, all you need to do is:
local myVar = varA;
now you have a copy of the variable varA in your local variable myVar
  Reply With Quote
02-12-07, 09:43 AM   #3
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
Thanks for the reply works beautifully and I feel like a nub

also another question i know how to search through my bags but how do i make a script that searches though my bank when it is opened?
  Reply With Quote
02-12-07, 03:34 PM   #4
Karrion
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Oct 2006
Posts: 23
Originally Posted by yssaril
Thanks for the reply works beautifully and I feel like a nub

also another question i know how to search through my bags but how do i make a script that searches though my bank when it is opened?
Code:
for i=5, 10 do
    bagSlots = GetContainerNumSlots(i);
    bagId = BankButtonIDToInvSlotID(i, 1);
    if (bagSlots > 0) then
        for j=1, bagSlots do
            itemLink = GetContainerItemLink(i, j);
        -- etc
If you also want to know the type of bags in the expansion slots, use
Code:
GetInventoryItemLink("player", bagId)
  Reply With Quote
02-12-07, 05:50 PM   #5
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
thank you for that info but that only gives me acces to the bags in my bank how do i search through the default initial slots?
  Reply With Quote
02-12-07, 06:03 PM   #6
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
figured it out insted of having a number the orignial bank space containerid = BANK_CONTAINER

  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Saved Variables


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