View Single Post
08-12-18, 11:37 AM   #9
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Originally Posted by Kanegasi View Post
This reminds me of the abomination I made my NoCombatText addon into years ago when I was in the prime of learning Lua.

The following is a valid addon, using code tags instead of highlight tags for maximum effect:

Code:
local b,c,d,e,f,g,h,j,k,l,n,r,s,u,v,w,y,z=COMBAT,nil,EVENTS_LABEL,PET,
CreateFrame('frame'),'|cff00ff00',PetFrame,PLAYER,'player',PlayerFrame,
'NoCombatText','|cffff0000',' ','UNIT_COMBAT',{j=1,o=1,e=1,},SlashCmdList,
VIDEO_OPTIONS_DISABLED,VIDEO_OPTIONS_ENABLED function f:p(m)nctsv=v for i=1,
NUM_CHAT_WINDOWS do c=_G['ChatFrame'..i]if c:IsEventRegistered('CHAT_MSG_SYSTEM'
)then c:AddMessage('|cffffff00'..n..': '..string.lower(m))end end end function
f:q(x)x:UnregisterEvent(u)end SLASH_NCTPL1='/playerct'function w:NCTPL()if v.j
then l:RegisterUnitEvent(u,k,'vehicle')v.j=nil f:p(j..s..b..s..d..s..r..z)else
f:q(l)v.j=1 f:p(j..s..b..s..d..s..g..y)end end SLASH_NCTPE1='/petct'function
w:NCTPE()if v.e then h:RegisterUnitEvent(u,'pet',k)v.e=nil f:p(e..s..b..s..d..
s..r..z)else f:q(h)v.e=1 f:p(e..s..b..s..d..s..g..y)end end f:RegisterEvent(
'ADDON_LOADED')f:SetScript('OnEvent',function(_,_,a)if a==n and nctsv then
v=nctsv nctsv=nil end if v.j then f:q(l)end if v.e then f:q(h)end nctsv=v end)
I still tend to ignore common organization methods like spacing things or using more lines, and this addon is still somewhat of a giant mess of "compact code" even now, but this is a great reminder about how far I've come.
Clearly a wall of text.
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote