Thread Tools Display Modes
09-19-09, 08:13 PM   #1
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Xrystal Please Help

Hello again, ok I have no clue as to what im doing as far a programming, or codeing as I'm sure you can tell i dont type correct or spell the best. But i would really like to make this Pally Buffs work .

I started with your MagePorts and went threw and change all the MagePorts text to PallyBuffs text. Then i went to WoWhead and found the spellID. I use the level 78-79 spell ID and set the learn levels in the .lua to 0 because with WoW Paladin spells just like most spells that level you can click the one and it will give the proper level of spell to the level of charactor.

Other then that i tried to keep everything else the same as you had it, I got it to show up on the AddOns screen but when i log in i get a UIparent frame error, so i have attached the Zip file of PallyBuffs as i said you will notice that is is exacly the same as MagePorts but with the names changes.

I think i moght have to do more modifying of the orginal files to get it to work.

The spells i am trying to get to work are.

Top Row: Greater Blessing of Might - Greater Blessing of Wisdom - Greater Blessing of Kings - Great Blessing of Sanctuary

Bottum Row: Blessing of Might - Blessing of Wisdom - Blessing of Kings - Blessing of Sanctuary

It would be really awesome if also Redemption (Rez Spell) and Divine Intervention could be added as well.

What i'm asking for is just some help in getting it going maybe a line or 2 or maybe just you explaining how to do it.


Thanks for any help.

Coke
Attached Files
File Type: zip nUI_InfoPanel_PallyBuffs.zip (11.1 KB, 755 views)
 
09-19-09, 08:23 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
I'll try and take a look at it after some sleep .. rofl .. started falling asleep while questing so thought it safer to go to bed

At worst I'll look at it Monday while the rest of the guild are working or sleeping
__________________


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
 
09-19-09, 08:27 PM   #3
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Thank You, and take your time no hurry
 
09-20-09, 11:03 AM   #4
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Ok, I was playing around with it today found a couple of places i missed changing MagePorts to PallyBuffs switched those and also changed it from only loading on Mages to only loading on Paladins.

Now I can see the buttons and can use them but i get a .lua error as fallows

Code:
Message: ...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:276: bad argument #1 to 'pairs' (table expected, got nil)
Time: 09/20/09 09:53:25
Count: 1
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
(tail call): ?
[C]: ?
[C]: in function `pairs'
...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:276: in function <...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:255>
...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:465: in function <...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:461>

Locals:
Then this one keeps repeating massively.

Code:
Message: ...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:276: bad argument #1 to 'pairs' (table expected, got nil)
Time: 09/20/09 09:53:25
Count: 1
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
(tail call): ?
[C]: ?
[C]: in function `pairs'
...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:276: in function <...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:255>

Locals:
I think it has a looping issue with restocking regants

So i have attached the new zip



Thanks again for helping with this.


Coke
Attached Files
File Type: zip nUI_InfoPanel_PallyBuffs.zip (11.2 KB, 772 views)
 
09-20-09, 12:46 PM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Okay, make sure that the pairs(x,y) statements have a table name in x and an item in y. They need to be set to something other than nil otherwise you get that problem.

ReagentDB is probably where it is going wrong. Either it isn't needed or you need to change it to what you are using instead.
__________________


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
 
09-20-09, 01:43 PM   #6
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by Xrystal View Post
Okay, make sure that the pairs(x,y) statements have a table name in x and an item in y. They need to be set to something other than nil otherwise you get that problem.
ok this is what i have for pairs(x,y)
Code:
	-- First the GBlessing Buttons	
	for i,v in pairs(PallyBuffs.PallyBuffsButtons) do
		local reagentName = select(2,GetItemInfo(ReagentDB[2].item)) or nil;
		local reagentCount = GetItemCount(ReagentDB[2].item) or 0;
		local spellName = v:GetAttribute("spell");
		local Available = ( GetSpellInfo(spellName) ~= nil );
		if ( not Available or reagentCount == 0 ) then 
			v:SetAlpha(PallyBuffs_Defaults.NotAvailableAlpha); 
		else
			if (Solo) then 
				v:SetAlpha(PallyBuffs_Defaults.NotIdealAlpha); 
			else
				v:SetAlpha(PallyBuffs_Defaults.AvailableAlpha);
			end
		end
		if ( PallyBuffs_Defaults.DisplayText and reagentName ) then
			v:GetParent().GBlessingCount:SetText(reagentName .. " : " .. reagentCount);  
			v:GetParent().GBlessingTitle:SetText(_L["GREATER BLESSINGS"]);  
		else
			v:GetParent().GBlessingCount:SetText("");
			v:GetParent().GBlessingTitle:SetText("");
		end
	    local Path, Size, Flags = v.Cooldown.Text:GetFont()
		v.Cooldown.Text:SetFont(Path,PallyBuffs_Defaults.FontSize,Flags);
		v.Cooldown.Text:SetAlpha(1.0);
	end

	-- Then the Blessing Buttons
	for i,v in pairs(PallyBuffs.BlessingButtons) do
		local reagentName = select(2,GetItemInfo(ReagentDB[1].item)) or nil;
		local reagentCount = GetItemCount(ReagentDB[1].item) or 0;
		local spellName = v:GetAttribute("spell");
		local Available = ( GetSpellInfo(spellName) ~= nil );
		if ( not Available or reagentCount == 0 ) then 
			v:SetAlpha(PallyBuffs_Defaults.NotAvailableAlpha); 
		else
			if (IsInRaid) then 
				v:SetAlpha(PallyBuffs_Defaults.NotIdealAlpha); 
			elseif (IsInParty) then 
				v:SetAlpha(PallyBuffs_Defaults.NotIdealAlpha);
			else
				v:SetAlpha(PallyBuffs_Defaults.AvailableAlpha);
			end
		end
		if ( PallyBuffs_Defaults.DisplayText and reagentName) then
			v:GetParent().BlessingTitle:SetText(_L["BLESSINGS"]);  
			v:GetParent().BlessingCount:SetText(reagentName .. " : " .. reagentCount);  
		else
			v:GetParent().BlessingCount:SetText("");
			v:GetParent().BlessingTitle:SetText("");
		end
	    local Path, Size, Flags = v.Cooldown.Text:GetFont()
		v.Cooldown.Text:SetFont(Path,PallyBuffs_Defaults.FontSize,Flags);
		v.Cooldown.Text:SetAlpha(1.0);
	end
Originally Posted by Xystral View Post
ReagentDB is probably where it is going wrong. Either it isn't needed or you need to change it to what you are using instead.
and for this one is

Code:
local function PallyBuffs_InitReagentDB()
	ReagentDB = {};
	table.insert(ReagentDB, { item = 21177, max = PallyBuffs_Defaults.MaxRestockQty, level = 5 } ); -- Symbol of Kings
    table.insert(ReagentDB, { item = 17033, max = PallyBuffs_Defaults.MaxRestockQty, level = 5 } ); -- Symbol of Divinity
end
 
09-20-09, 04:35 PM   #7
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
SWEET!!!!! ok got it to work but there are some bugs now (issue was had the work PallyBuffs in a place that GBlessing needed to be)

Ok so one of the bugs is Greater Blessings need Symbol of Kings and Divine Intervention needs Symbol of Dinvinity but when I pull them out of my bags the Kings are attached to the regular blessings and the Divinity are attached to the Greater Blessings so pretty much the top row is Dinive and the buttom row is kings, but i dont need kings for the bottum row.
 
09-20-09, 08:11 PM   #8
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Ok so im down to one bug and that is Restocking Regants, I wonder if it is cause of them selling them in stacks of 20 not singels like Rune of Teleportation maybe someone can help with this part.

But as soon as I get that figured out i will upload to site for everyone to use.

Here are some Screenshots of it in action.

Coke
Attached Thumbnails
Click image for larger version

Name:	PallyBuffs_No_Regants.jpg
Views:	824
Size:	299.3 KB
ID:	3419  Click image for larger version

Name:	PallyBuffs_With_Regants_Solo.jpg
Views:	790
Size:	293.9 KB
ID:	3420  Click image for larger version

Name:	PallyBuffs_In_Party.jpg
Views:	788
Size:	300.6 KB
ID:	3421  Click image for larger version

Name:	PallyBuffs_In_Raid.jpg
Views:	805
Size:	318.4 KB
ID:	3422  

 
09-20-09, 08:54 PM   #9
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Whoops forgot to add the file to the last post.

Here it is.



Coke
Attached Files
File Type: zip nUI_InfoPanel_PallyBuffs.zip (9.3 KB, 750 views)
 
09-20-09, 09:34 PM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Originally Posted by cokedrivers View Post
Ok so im down to one bug and that is Restocking Regants, I wonder if it is cause of them selling them in stacks of 20 not singels like Rune of Teleportation maybe someone can help with this part.

But as soon as I get that figured out i will upload to site for everyone to use.

Here are some Screenshots of it in action.

Coke
Looks cool so far

What is the problem with restocking ? Did you change the name of the restocking dialog or keep the same name ? If the former use the same name as the mageports if you have that addon if the latter change it to a different one and see if that helps. I recall having problems with restocking due to using the crylosis addon for non port magey stuff.
__________________


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
 
09-20-09, 09:43 PM   #11
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
I have Mageports installed but it dont load unless im on a Mage so i dont think that would cause the issue, i really think it is because of the stacking issue, Kings sells in stacks of 20 for a single buy and the mages ones sell singles.
 
09-20-09, 09:51 PM   #12
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Ah .. think I got it...

Think you will have to make sure that the restock quantity jumps to the next 20 stack. I'm not sure if the modulus/div symbol % works here but if you do restock % 20 it should result in a remainder.

remainder = restock % 20
if ( remainder > 0 ) then restock = restock + remainder; end

That should in all essence make the restock quantity jump to the next stack of 20.

Do a print(..) of each value before doing that though so you can see what the results are. I'll double check if the mod/div function exists in lua though to be sure.

edit: yep modulus function % works so the example above should result in the difference between 20 ( the amount you can buy at a time ) and how much needs to be bought and automatically upgrades it to match Theoreticallly that is
__________________


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

Last edited by Xrystal : 09-20-09 at 09:54 PM.
 
09-20-09, 10:20 PM   #13
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
ok that sounds like it may work, but i have to buy in 20's for example Sweetened Goat's Milk from a vendor each click buys 5 so for Symbols of Kings Each Click buys 20. So if i have it set to restock at 100 ( which is a stack) and i have 53 on me there is no way it will get me to 100 it will either be 93 or 113.

Hope i discribed this correctly
 
09-20-09, 10:38 PM   #14
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Originally Posted by cokedrivers View Post
ok that sounds like it may work, but i have to buy in 20's for example Sweetened Goat's Milk from a vendor each click buys 5 so for Symbols of Kings Each Click buys 20. So if i have it set to restock at 100 ( which is a stack) and i have 53 on me there is no way it will get me to 100 it will either be 93 or 113.

Hope i discribed this correctly
It should work that way, but not in game to try it out. Here's the MagePorts Reagent Restock code with the additions highlighted. And here's an example using your numbers as a guide. Which, just proved my initial code wrong The highlighted code should work correct now.

max = 100;
stock = 53;
restock = max - stock = 47;
remaining = restock % 20 = 7 ( Just checked with calculator )
restock = restock + ( 20 - remaining ) = 60.

Code:
local function MagePorts_ReagentRestock(Confirmed)

	local ReagentVendor = false;
	local ReagentsLow	= false;
	local RestockList	= {};
	
	local PlayerLevel = UnitLevel("player");

	-- 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

	-- If we have (MagePorts_Defaults.MaxRestockQty) of each reagent then no need to continue
	if ( not ReagentsLow ) then return; end
	
	-- Check to see if this is a reagent vendor
	-- If it is and we have confirmed restocking then buy the reagents
	ReagentVendor = false;
	for i = 1, GetMerchantNumItems(), 1 do
		local name, _, price, quantity = GetMerchantItemInfo(i);
		if ( RestockList[name] ) then
			ReagentVendor = true;
			if ( Confirmed ) then
				local count	= GetItemCount(name);
				local restock = 0;	
				for j,reagent in pairs(ReagentDB) do
					local dbName = GetItemInfo(reagent.item);
					if ( dbName == name ) then
						if ( count < reagent.max ) then
							restock = reagent.max - count;
local remaining = restock % 20;
restock = restock + ( 20 - remaining ) ;
							BuyMerchantItem(i,restock);
							break;
						end
					end
				end
			else
				break;
			end
		end
	end

	-- If this is a reagent vendor then pop up the question to restock
	if ( ReagentVendor ) then
		StaticPopup_Show("RESTOCK_REAGENTS");
	end
	
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
 
09-20-09, 10:48 PM   #15
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
First off let me just say Thank You for the help with this, as stated before i have no idea how to do any kind of programing or codeing.

Ok i must have done something wrong or took something out that i should not have. Here is what that section for me looks like:

Code:
local function PallyBuffs_ReagentRestock(Confirmed)

	local ReagentVendor	= false;
	local ReagentsLow	= false;
	local RestockList	= {};
	
	local PlayerLevel = UnitLevel("player");
	 

	-- Create a list of Reagents to Restock	
	-- for itemID = 21177, 1 do
	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 and itemID == 21177 )then
			if ( PlayerLevel > ( reagent.level-1 ) ) then
				RestockList[name] = true;
			end
		end
	end

	-- If we have (PallyBuffs_Defaults.MaxRestockQty) of each reagent then no need to continue
	if ( not ReagentsLow ) then return; end
	
	-- Check to see if this is a reagent vendor
	-- If it is and we have confirmed restocking then buy the reagents
	ReagentVendor = false;
	for i = 1, GetMerchantNumItems(), 1 do
		local name, _, price, quantity = GetMerchantItemInfo(i);
		if ( RestockList[name] ) then
			ReagentVendor = true;
			if ( Confirmed ) then
				local count	= GetItemCount(name);
				local restock = 0;	
				for j,reagent in pairs(ReagentDB) do
					local dbName = GetItemInfo(reagent.item);
					if ( dbName == name ) then
						if ( count < reagent.max ) then
							restock = reagent.max - count;
local remaining = restock % 20;
restock = restock + ( 20 - Remaining ) ;                            
							BuyMerchantItem(i,restock);
							break;
						end
					end
				end
			else
				break;
			end
		end
	end

	-- If this is a reagent vendor then pop up the question to restock
	if ( ReagentVendor ) then
		StaticPopup_Show("RESTOCK_REAGENTS");
	end
	
end
And when i go back ingame and reload it give me this error:

Code:
Message: ...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:463: attempt to perform arithmetic on global 'Remaining' (a nil value)
Time: 09/20/09 21:43:49
Count: 1
Stack: [string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:18: in function <[string "Interface\FrameXML\BasicControls.xml:<Scrip..."]:4>
(tail call): ?
[C]: ?
...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:463: in function <...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:420>
...rface\AddOns\nUI_InfoPanel_PallyBuffs\PallyBuffs.lua:489: in function `OnAccept'
Interface\FrameXML\StaticPopup.lua:3282: in function `StaticPopup_OnClick'
[string "*:OnClick"]:1: in function <[string "*:OnClick"]:1>

Locals:
But on normal without the code you give me it says Internal bag Error

Also if i have some on my guy the Restock button does not pop up.


If i'm leaving something out let me know ill add it to a reply.

Coke
 
09-20-09, 10:59 PM   #16
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Rofl, thought I edited before you saw the post. Was an error on my part as variables are case sensitive. change Remaining to remaining and it should work as the line above sets remaining up as a valid value

See if that works and post up the resulting zip file and I will take a look see with my lowbie paladin and see I can test it out for you after I have had some sleep
__________________


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
 
09-20-09, 11:07 PM   #17
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Ok well it dont pop up that error no more but it still is giving me the Internal Bag Error when i try to buy also it still will not pop up the window to buy if i have some in my bags. but here is the addon maybe you can see what i missed.

Again thanks for all the help.
Attached Files
File Type: zip nUI_InfoPanel_PallyBuffs.zip (9.3 KB, 748 views)
 
09-21-09, 01:15 AM   #18
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,935
Originally Posted by cokedrivers View Post
Ok well it dont pop up that error no more but it still is giving me the Internal Bag Error when i try to buy also it still will not pop up the window to buy if i have some in my bags. but here is the addon maybe you can see what i missed.

Again thanks for all the help.
Oh, just remembered ... I've noticed that when I don't have any reagents at all on my mage it wigs out but I just ignore it but it could be a similar thing you are getting.
__________________


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 » Xrystal Please Help


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