WoWInterface (
-   General Authoring Discussion (
-   -   Can anyone help me troubleshoot real short code (

Dissosiative 10-15-19 12:54 PM

Can anyone help me troubleshoot real short code

I have no idea why its not running.

myrroddin 10-15-19 09:07 PM

Maybe I am missing something at first glance, but you don't define "DevilHunters" anywhere as an addon.

local DevilHunters = {}

-- OR

local name, DevilHunters = ...

One of these two should be the very first line of your code.

Urtgard 10-16-19 02:00 AM

Line 119: Your addon is called "DevilsHuntersClassic" and not "DevilsHunters"

And all the functions and variables you use should be locals.


One stumbling block for Lua programmers coming from other languages is the fact that all variables are global unless specified otherwise. Many times, the use of global variables is necessary: saved variables are created via the global environment; all API functions and UI frames are in the global namespace. However, globals come at a cost of both performance, and naming conflicts.

Globals are inefficient to access compared to locals. Whenever a global is accessed, Lua has to call the internal equivalent of getfenv() to figure out where to retrieve the global from. Local variables, on the other hand, are stored on a stack.

All times are GMT -6. The time now is 09:00 PM.

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