Thread Tools Display Modes
09-30-09, 03:34 PM   #1
todd0168
A Frostmaul Preserver
 
todd0168's Avatar
Join Date: Mar 2009
Posts: 290
Mage Portal Infopanel Plugin

Hey just wanted to let you know that on my lvl 4 mage I keep getting this error.

Message: ...terface\AddOns\nUI_InfoPanel_MagePorts\MagePorts.lua:410: table index is nil
Time: 09/30/09 14:33:08
Count: 3
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
(tail call): ?
[C]: ?
...terface\AddOns\nUI_InfoPanel_MagePorts\MagePorts.lua:410: in function <...terface\AddOns\nUI_InfoPanel_MagePorts\MagePorts.lua:396>
...terface\AddOns\nUI_InfoPanel_MagePorts\MagePorts.lua:486: in function <...terface\AddOns\nUI_InfoPanel_MagePorts\MagePorts.lua:472>

Locals: Confirmed = nil
ReagentVendor = false
ReagentsLow = false
RestockList = <table> {
}
PlayerLevel = 4
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
1 = <table> {
}
2 = <table> {
}
}
(for control) = 1
i = 1
reagent = <table> {
max = 10
level = 20
item = 17031
}
name = nil
qty = 0
(*temporary) = 17031
(*temporary) = 0
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "table index is nil"
ReagentDB = <table> {
1 = <table> {
}
2 = <table> {
}
}
__________________
 
10-01-09, 01:06 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Hmm, strange, I'll take a gander at it later on when I've had some sleep

Ah, taking a quick look I can see I am not validating values before using them. Perhaps the database isn't quite set up right.

This is the block of code in question:
Code:
	-- Create a list of Reagents to Restock	
	for i,reagent in pairs(ReagentDB) do
		local name = GetItemInfo(reagent.item);
		local qty = GetItemCount(reagent.item);
		RestockList[name] = false;
		if ( qty < reagent.max ) then 
			ReagentsLow = true;
			if ( PlayerLevel > ( reagent.level - 1 ) ) then
				RestockList[name] = true;
			end
		end
	end
It looks like GetItemInfo(reagent.item) is returning a nil value which I wasn't expecting.

Can you take a look at the top of the file and copy out the InitReagentDB Function in its entirety so I can see if there is something they are expecting to see.

Code:
local function MagePorts_InitReagentDB()
	ReagentDB = {};
	table.insert(ReagentDB, { item = 17031, max = MagePorts_Defaults.MaxRestockQty, level = 20 } );	-- Teleport Runes
	table.insert(ReagentDB, { item = 17032, max = MagePorts_Defaults.MaxRestockQty, level = 35 } );	-- Portal Runes
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
 
10-01-09, 08:58 AM   #3
todd0168
A Frostmaul Preserver
 
todd0168's Avatar
Join Date: Mar 2009
Posts: 290
Yeah, mine is a little different. I had asked how to be able to stock arcane powder and you linked some code to add. Mine looks like this:

Code:
local function MagePorts_InitReagentDB()
	ReagentDB = {};
	table.insert(ReagentDB, { item = 17031, max = MagePorts_Defaults.MaxRestockQty, level = 20 } );	-- Teleport Runes
	table.insert(ReagentDB, { item = 17032, max = MagePorts_Defaults.MaxRestockQty, level = 35 } );	-- Portal Runes
	table.insert(ReagentDB, { item = 17020, max = MagePorts_Defaults.MaxRestockQty * 2, level = 50 } ); -- Arcane Powder
end
__________________
 
10-01-09, 09:07 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Hmm, maybe the player level test needs to be done before. Seeing as you have something to test it with can you change the code to this and see if it makes a difference.


Code:
	-- Create a list of Reagents to Restock	
	for i,reagent in pairs(ReagentDB) do
  	     if ( PlayerLevel > ( reagent.level - 1 ) ) then
		local name = GetItemInfo(reagent.item);
		local qty = GetItemCount(reagent.item);
		RestockList[name] = false;
		if ( qty < reagent.max ) then 
		    ReagentsLow = true;
		    RestockList[name] = true;
		end
	     end
	end
This should then not even validate the reagent restocking requirement unless you need to use that item. So any character under 20 ( with Arcane Powder reagent in the list ) should never need the restocking done.

Let me know if it works and I'll make the change.
__________________


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
 
10-01-09, 10:00 AM   #5
todd0168
A Frostmaul Preserver
 
todd0168's Avatar
Join Date: Mar 2009
Posts: 290
Ok, I'm at work now but I can test it at lunch and let you know how it goes. Thanks again.

__________________
 
10-02-09, 11:51 AM   #6
todd0168
A Frostmaul Preserver
 
todd0168's Avatar
Join Date: Mar 2009
Posts: 290
Ok, took me a while to remember to check this but, yes, it seems to have removed the error when I talk to any vendor. Thanks and I would go ahead and push this out to your live version.
__________________
 
10-02-09, 02:19 PM   #7
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Tis done, thanks for finding this and helping me correct 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
 
10-02-09, 02:39 PM   #8
todd0168
A Frostmaul Preserver
 
todd0168's Avatar
Join Date: Mar 2009
Posts: 290
My pleasure. I love this infopanel plugin and am wondering if anyone could put together something like it but basically just for reagents. Kind of like the profession plugin. Have it useable by everyone but only for those items that you actually use. Then I would have a much easier time restocking my priest and eventually my pally and drood as well.

Just a thought.
__________________
 
10-02-09, 03:26 PM   #9
lairdofdeath
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 63
i can look into it but i dont have any toons to test it with
 
10-02-09, 03:30 PM   #10
todd0168
A Frostmaul Preserver
 
todd0168's Avatar
Join Date: Mar 2009
Posts: 290
I have all but drood so far so if you need testing and bug reports just let me know.
__________________
 
10-03-09, 08:22 AM   #11
lairdofdeath
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 63
i dont think this will work i tried to put the reagents icons in and it broke nui so i tried it with just the words ([ wild berries ] : 1 ) and it worked on wifes druid untill i tried to take out the buttons but with druids every lvl of a spell has a dif reagent and im not sure if i can set it up to stop getting a reagent after a serten lvl and it could become a pain if you are at lvl 7 of rebirth and it is still asking if you want the reagents for lvl 1 (it might be able to turn a reagent restock off via / comand but i aint that good at this stuff yet so some one smarter or more advanced then me -cough cough Xrystal cough cough - could do it) but ill keep trying to see if i can make it work

Last edited by lairdofdeath : 10-03-09 at 08:41 AM.
 
10-04-09, 02:46 AM   #12
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Originally Posted by lairdofdeath View Post
i dont think this will work i tried to put the reagents icons in and it broke nui so i tried it with just the words ([ wild berries ] : 1 ) and it worked on wifes druid untill i tried to take out the buttons but with druids every lvl of a spell has a dif reagent and im not sure if i can set it up to stop getting a reagent after a serten lvl and it could become a pain if you are at lvl 7 of rebirth and it is still asking if you want the reagents for lvl 1 (it might be able to turn a reagent restock off via / comand but i aint that good at this stuff yet so some one smarter or more advanced then me -cough cough Xrystal cough cough - could do it) but ill keep trying to see if i can make it work
For this sort of thing to be possible, at the top of my head that is, I would think something along the lines of the following would work in some manner. If you use mageportals as a guide that is.

ReagentDB =
{
{ id = 12345, class = druid, minlevel = 1, maxlevel = 30 }
{ id = 12346, class = druid, minlevel = 31, maxlevel = 50 }
{ id = 12347, class = druid, minlevel = 51, maxlevel = 80 }
}


for each reagent in the reagentDB do
if playerlevel > minlevel - 1 and playerlevel < maxlevel + 1 then
TestQuantities()
end
end

This would in essence only calculate the quantities once it has been confirmed that they fit the level requirements.

See if that helps you out
__________________


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
 
10-05-09, 01:28 PM   #13
lairdofdeath
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 63
i have not been able to figure this out been working on it for a couple of days now and havent gotten any further then i was when i started so im just going to step aside and let some one else have a go at it
 
10-05-09, 02:17 PM   #14
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Yes, this project will take a while to do as you would need to spend time researching the reagent information.

I believe the best way to incorporate this into nUI as an infopanel is to have a list of possible reagents for the class logged in and display them in the panel. This part would be done differently to MagePorts though so may include quite a bit of coding to get it working just right.

Handling reagent restocking can be sped up by utilising the MagePorts restocking function and changing relevant parts as required. However, as I found out while doing MagePorts that the pop up window to restock will pop up an extra window if you have another addon installed that does a similar action. In the case of MagePorts and Crylosis I simply told it to use Crylosis's restocking dialog instead of the MagePorts one. The more restocking linked addons we have the more chance of conflict and thus the higher chance at causing a problem with the addon and more validation of more addons etc.

Of course these could be added at a later update of the addon as people find duplicate restock request windows appearing.

Apart from those pitfalls if you hunt around and find an infopanel plugin that looks right and use its code along with the mageports code to handle the restocking functionality and reagent storage I don't see any reason why someone that has made a simple addon or two cannot do it.

I'm taking a break from WoW at the moment being burnt out on raids and stuff and may end up dropping the complex addons I have been trying to get working with no avail and once I am back to playing WoW on a regular basis I will try and get something working for this. Of course, assuming that someone doesn't take up addon creation and wish to take a stab at it themselves.
__________________


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
 
 

WoWInterface » Featured Projects » nUI, MozzFullWorldMap and PartySpotter » Customization » nUI: Plugin Support » Mage Portal Infopanel Plugin


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