Thread Tools Display Modes
02-19-07, 11:08 AM   #1
jmlsteele
A Defias Bandit
Join Date: Feb 2007
Posts: 3
Detecting Socket Bonus

I'm trying to find a way to programmatically (in an addon) detect if a piece of gear (that is either worn or linked) is correctly socketed.

The basic code is..
Code:
		local numSockets = GetNumSockets();
		local bonus = true

		for i=1, numSockets do
			local _, _, gemMatchesSocket = GetExistingSocketInfo(i);
			if (not gemMatchesSocket) then
				bonus = false
				break
			end
		end

		if (bonus) then
			--Scan the socket bonus line
		end
However calls to GetNumSockets() and GetExistingSocketInfo(<socket num>) require the ItemSocketingUI to be loaded. What I'm wondering is is there a way to programmatically load the UI with a piece of gear OR is there another way o go about checking the socket bonus.

Any help would be greatly appreciated.
  Reply With Quote
02-19-07, 02:55 PM   #2
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
Something I read cladhaire mention was to check the color of the text on the tooltip for the socket bonus. Perhaps that's an avenue?
  Reply With Quote
02-20-07, 06:25 AM   #3
jmlsteele
A Defias Bandit
Join Date: Feb 2007
Posts: 3
First thing i thought of checking even before BC came out and I had just seen picutres

The colour code isn't sent along with the "Socket Bonus:" line as far as I can tell
  Reply With Quote
02-20-07, 07:31 AM   #4
JoshBorke
A Chromatic Dragonspawn
 
JoshBorke's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 185
ltext = getglobal(fname.."TextLeft"..index):GetTextColor()
rtext = getglobal(fname.."TextRight"..index):GetTextColor()

use GetTextColor to check the color of the Socket Bonus line in the tooltip.
  Reply With Quote
02-20-07, 09:02 AM   #5
jmlsteele
A Defias Bandit
Join Date: Feb 2007
Posts: 3
Well I can't test this right now (booo maintenance) but from the looks of it it should work perfectly.

If thats the case I <3 you ^^
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Detecting Socket Bonus


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