Thread: Chat Categories
View Single Post
07/08/14, 06:12 AM   #8
zgrssd
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 280
Originally Posted by Garkin View Post
So you probably want something like:
Lua Code:
  1. local channelTable = {}
  2.  
  3. for key, value in zo_insecurePairs(_G) do
  4.    if (kepy):find("^CHAT_CATEGORY_") and not (key):find("HEADER") then
  5.       channelTable[value] = key
  6.    end
  7. end
Looks like actually going over the entire global table is the only way to get those.
Found the documentation for find/attern:
http://lua-users.org/wiki/PatternsTutorial

The ^ makes certain only the start of the string is checked (improoving performance). Have to test that code when I am home again.
  Reply With Quote