Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(Corrected spelling/grammar)
(Updated with new information)
Line 2: Line 2:
 
Returns information on a glyph socket.
 
Returns information on a glyph socket.
   
enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(SocketID);
+
enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo([[Glyph SocketID|SocketID]]);
 
== Parameters ==
 
== Parameters ==
 
=== Arguments ===
 
=== Arguments ===
:;SocketID : Integer - Socket number.
+
:;[[Glyph SocketID|SocketID]] : Integer - Socket number.
 
=== Returns ===
 
=== Returns ===
 
:;enabled: Boolean - 1 if available. '''nil''' if locked.
 
:;enabled: Boolean - 1 if available. '''nil''' if locked.
Line 13: Line 13:
 
== Examples ==
 
== Examples ==
 
The following code scans all the glyph sockets and prints out the status of each one.
 
The following code scans all the glyph sockets and prints out the status of each one.
for i=1,6 do
+
for i = 1, NUM_GLYPH_SLOTS do
 
local enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(i);
 
local enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(i);
if enabled then
+
if ( enabled ) then
  +
local link = [[API GetGlyphLink|GetGlyphLink]](i);-- Retrieves the Glyph's link (nil of no glyph in Socket);
if glyphSpellID then
+
if ( link ) then
DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." contains "..GetSpellLink(glyphSpellID));
+
DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." contains "..link);
 
else
 
else
 
DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." is unlocked and empty!");
 
DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." is unlocked and empty!");
Line 25: Line 26:
 
end
 
end
 
end
 
end
== Details ==
 
===Arguments===
 
:;SocketID : Follows the pattern below.
 
1
 
3 5
 
6 4
 
2
 
 
== Notes ==
 
== Notes ==
  +
"AddOns/Blizzard_GlyphUI/Blizzard_GlyphUI.lua"
'''glyphSpellID''' can be used as a valid '''SpellID''' for any of the GetSpell* functions.
 
  +
Passes '''glyphSpellID''' to [[API GetSpellInfo | GetSpellInfo]] to retrieve the glyph name.

Revision as of 23:55, 4 December 2008

Returns information on a glyph socket.

enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(SocketID);

Parameters

Arguments

SocketID
Integer - Socket number.

Returns

enabled
Boolean - 1 if available. nil if locked.
glyphType
Integer - GLYPHTYPE_MAJOR or GLYPHTYPE_MINOR (1 is Major, 2 is Minor)
glyphSpellID
Integer - SpellID of socketted glyph. nil if none.
icon
String - Rune icon path. (Not the same icon as returned by GetSpellInfo)

Examples

The following code scans all the glyph sockets and prints out the status of each one.

for i = 1, NUM_GLYPH_SLOTS do
 local enabled, glyphType, glyphSpellID, icon = GetGlyphSocketInfo(i);
 if ( enabled ) then
  local link = GetGlyphLink(i);-- Retrieves the Glyph's link (nil of no glyph in Socket);
  if ( link ) then
   DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." contains "..link);
  else
   DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." is unlocked and empty!");
  end
 else
  DEFAULT_CHAT_FRAME:AddMessage("Glyph Socket "..i.." is locked!");
 end
end

Notes

"AddOns/Blizzard_GlyphUI/Blizzard_GlyphUI.lua" Passes glyphSpellID to GetSpellInfo to retrieve the glyph name.