Thread Tools Display Modes
10-15-19, 12:54 PM   #1
Dissosiative
A Defias Bandit
Join Date: Dec 2008
Posts: 2
Can anyone help me troubleshoot real short code

https://github.com/Rootkit-/Devil/bl...ersClassic.lua

I have no idea why its not running.
  Reply With Quote
10-15-19, 09:07 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Maybe I am missing something at first glance, but you don't define "DevilHunters" anywhere as an addon.
Code:
local DevilHunters = {}

-- OR

local name, DevilHunters = ...
One of these two should be the very first line of your code.
  Reply With Quote
10-16-19, 02:00 AM   #3
Urtgard
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 25
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.

https://wow.gamepedia.com/UI_best_pr...ocal_variables
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Can anyone help me troubleshoot real short code

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