View Single Post
01-25-14, 08:54 PM   #6
Torhal
A Pyroguard Emberseer
 
Torhal's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 1,196
1: The pairs function returns the key/value pairs from a table. The "unitSpecific" refers to a variable which is holding the value for that particular key/value entry in the loop. It could very well have been named "flufferNutter."

2: The value for the table is set to "true" simply to give it a value to iterate over. When making a table, if the key is a non-space-separated string, the quotation marks and brackets are optional.

3: The expression
Code:
SetText(hp and hp > 0 and hp or nil)
is Lua's way of performing a pseudo ternary operation. Read this for a full explanation - there is a specific section for Lua there as well.

4: I'll let someone else answer this one, as I've not been reading this thread to be familiar with the posted code.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Author of NPCScan and many other AddOns.

Last edited by Torhal : 01-25-14 at 08:57 PM.
  Reply With Quote