Lines 56 to 78 is 100% invalid code for table construction. See "table constructor" for details in the Lua manual, i.e the things you can put inside a { }.
Yes, it was working just fine in game, actually. At least what of it I could test. I play a Priest, and haven't had an opportunity yet to see a Druid cast Revive, nor check if Death Knights will be last on list of res targets, along with Warriors.
I guess my problem is that I'm trying to learn and code at the same time. Maybe I'm jumping in too deep and too fast. ... That wasn't a question, or if it was, a rhetorical one.
Now that I have a working example (I learn best from examples. I *Do* have Cladhaire's WoW Programming guide, and reference it as often as I can) I see I was thinking correctly about self.ResSpellIcons. Nice of you to put the SpellIDs in, although in this case I don't think I will use them. Maybe, maybe not.
How about I call myself a newb, and leave it at that?
SpellIDs are preferable, because they will work on any localization without you having to localize the spellnames. In fact, the point of GetSpellInfo() IS mostly to get the localized spellname.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
code modifications
The error while compiling is:
Suggestions, or is this the wrong forum, and where should I be posting?
Correct code should look like this:
Yes, there is an extra bracket around the last line, it is needed to reduce the number of return values of the function to just the first value.
If you're wondering where those numbers comes from, go search wowhead.
self.ResSpellIcons = {
PRIEST = "Interface\\Icons\\Spell_Holy_Resurrection",
SHAMAN = "Interface\\Icons\\Spell_Nature_Regenerate",
PALADIN = "Interface\\Icons\\Spell_Holy_Resurrection",
DRUID = "Interface\\Icons\\Spell_Nature_Regenerate"
}
the same way? Since the GetSpellInfo has a return value of icon.
I have to question whether you even test your code in game, because you appear to not even know the basics of Lua coding and the Lua language itself.
Read http://www.lua.org/pil/
I guess my problem is that I'm trying to learn and code at the same time. Maybe I'm jumping in too deep and too fast. ... That wasn't a question, or if it was, a rhetorical one.
Now that I have a working example (I learn best from examples. I *Do* have Cladhaire's WoW Programming guide, and reference it as often as I can) I see I was thinking correctly about self.ResSpellIcons. Nice of you to put the SpellIDs in, although in this case I don't think I will use them. Maybe, maybe not.
How about I call myself a newb, and leave it at that?