Thread Tools Display Modes
10-16-13, 02:36 PM   #1
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
GetSpellInfo with name issue

Code:
print( (GetSpellInfo(116257) == "Invoker's Energy") )

-- true


print( GetSpellInfo("Invoker's Energy") )

-- nil
Seems to be an issue with apostrophes. Is there a work around for this?

Edit: searching with spellName is limited to your spellbook

Last edited by Freebaser : 10-16-13 at 03:45 PM.
  Reply With Quote
10-16-13, 02:49 PM   #2
humfras
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Oct 2009
Posts: 131
Keep in mind that
Using spellId as the argument will always return the info. Using spellName or spellLink will only return the info if the spell is in your spellbook. Otherwise it will return nil.
http://wowpedia.org/API_GetSpellInfo
__________________
Author of VuhDo CursorCastBar OptiTaunt Poisoner RaidMobMarker
  Reply With Quote
10-16-13, 02:50 PM   #3
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
As far as I know you can only use the spell name if it's in your spell book.

Multiple spells have the same name so it would be unreliable to look up information with it, not to mention issues with localization.
  Reply With Quote
10-16-13, 03:38 PM   #4
Freebaser
A Molten Kobold Bandit
 
Freebaser's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 135
Ah, wasn't aware of the spellbook limitation.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetSpellInfo with name issue

Thread Tools
Display Modes

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