WoWInterface (
-   Lua/XML Help (
-   -   How to get SpellID from SpellButton1..12? (Classic) (

jezzi23 05-01-20 11:45 AM

How to get SpellID from SpellButton1..12? (Classic)
I need to get more information about spells in the spellbook from the SpellButton1, ..., SpellButton12 frames without opening their tooltips. These 12 frames always exist and as you move between pages/tabs the 12 button frames just get updated icons/tooltips for different spells. I tried to look into what fields and it has a table field called SpellName but it just seems to contain garbage.

Any ideas? :)

Vrul 05-01-20 01:49 PM

Those are FontStrings, try:

for index = 1, 12 do
    local spellButtonName = "SpellButton" .. index

SDPhantom 05-01-20 01:50 PM

My initial instinct would be to look at GetSpellBookItemInfo().
There are other related functions listed here.

This is all depending on what you actually want to do with the spell buttons. Another suggestion is to look at what Blizzard does with it and how it's set up. SpellBookFrame.xml has the template the buttons are created from and SpellBookFrame.lua contains its underlying code.

jezzi23 05-01-20 02:39 PM

Thank you Vrul! With the spell name and spell rank as SubSpellName I can get the spell id from GetSpellInfo(...). :banana:

All times are GMT -6. The time now is 07:21 AM.

vBulletin © 2021, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI