Can someone check my custom addon?

Hello,
I wrote some scripts that I made into an addon so I don’t have to press the macros everytime I start to play and all alts have the same custom interface.

My problem is that I get an error message:

“Your AddOns are experiencing a large number of errors and may be slowing down the game. You can turn on display of Lua errors in the interface options.”

I can then Disable AddOns or Ignore it.

I haven’t found the option to show the Lua errors.
Can someone look into my scripts and may point me to a mistake I made so I can fix it?

Here are my scripts:

–Cast Bars (player & focus)

CastingBarFrame:SetScale(1.5)
FocusFrameSpellBar:SetScale(1.35)
CastingBarFrame:ClearAllPoints()
CastingBarFrame:SetPoint("TOP", WorldFrame, "CENTER", 0, -310)
CastingBarFrameSetPoint = function() end

– Player / Target / Focus Frames

PF = PlayerFrame
TF = TargetFrame
FF = FocusFrame

PF:SetScale(1.12)
TF:SetScale(1.12)
FF:SetScale(1.12)


PF:ClearAllPoints()
PF:SetPoint("CENTER", -600, 250)
PF.SetPoint = function() end

TF:ClearAllPoints()
TF:SetPoint("CENTER", -370, 250)
TF.SetPoint = function() end

FF:ClearAllPoints()
FF:SetPoint("CENTER", -370, 50)
--FocusFrame:SetPoint("TOP", WorldFrame, "CENTER", -370, -400)
FF.SetPoint = function() end

– Main Menu Bar / Gryphons

MainMenuBarArtFrameBackground:Hide()
MainMenuBarArtFrame.LeftEndCap:Hide()
MainMenuBarArtFrame.RightEndCap:Hide()
MainMenuBarArtFrame.PageNumber:Hide()
ActionBarUpButton:Hide()
ActionBarDownButton:Hide()
MultiBarBottomRightButton1:ClearAllPoints()
MultiBarBottomRightButton1:SetPoint("CENTER",-146,-1)
MultiBarBottomRightButton1.SetPoint = function() end

–Stance Buttons

StanceButton1:SetAlpha(0.01)
StanceButton2:SetAlpha(0.01)
StanceButton3:SetAlpha(0.01)
StanceButton4:SetAlpha(0.01)
StanceButton5:SetAlpha(0.01)
StanceButton6:SetAlpha(0.01)

– Action Bars/Buttons

-- Status Bar (XP/AP)

	StatusTrackingBarManager:SetAlpha(0.2)


-- Micro Menu & Bags
	
	CharacterMicroButton:SetAlpha(0.01)
	SpellbookMicroButton:SetAlpha(0.01)
	TalentMicroButton:SetAlpha(0.01)
	QuestLogMicroButton:SetAlpha(0.01)
	GuildMicroButton:SetAlpha(0.01)
	LFDMicroButton:SetAlpha(0.01)
	CollectionsMicroButton:SetAlpha(0.01)
	EJMicroButton:SetAlpha(0.01)
	StoreMicroButton:SetAlpha(0.01)
	MainMenuMicroButton:SetAlpha(0.01)
	StoreMicroButton:SetAlpha(0.01)
	AchievementMicroButton:SetAlpha(0.01)
	MicroButtonAndBagsBar:Hide()

I appreciate any help.
Thank you.

The only culprits for your lua errors that I can see are

.SetPoint = function() end
PF = PlayerFrame
TF = TargetFrame
FF = FocusFrame

I’ve removed them and replaced them with what I personally use for a solution and it seems to do the job, they removed the option to toggle display of lua errors ingame, you’d need AdvancedInterfaceOptions to see that but I’ve included the CVar in your scripts.

--See LUA errors ingame CVar
C_CVar.SetCVar("scriptErrors",1) 
---

CastingBarFrame:SetScale(1.5)
FocusFrameSpellBar:SetScale(1.35)
CastingBarFrame:ClearAllPoints()
CastingBarFrame:SetPoint("TOP", WorldFrame, "CENTER", 0, -310)
CastingBarFrame.ignoreFramePositionManager=true

PlayerFrame:SetScale(1.12)
TargetFrame:SetScale(1.12)
FocusFrame:SetScale(1.12)

PlayerFrame:ClearAllPoints()
PlayerFrame:SetPoint("CENTER", -600, 250)
PlayerFrame:SetUserPlaced(true)

TargetFrame:ClearAllPoints()
TargetFrame:SetPoint("CENTER", -370, 250)
TargetFrame:SetUserPlaced(true)

FocusFrame:ClearAllPoints()
FocusFrame:SetPoint("CENTER", -370, 50)
--FocusFrame:SetPoint("TOP", WorldFrame, "CENTER", -370, -400)
FocusFrame:SetUserPlaced(true)

MainMenuBarArtFrameBackground:Hide()
MainMenuBarArtFrame.LeftEndCap:Hide()
MainMenuBarArtFrame.RightEndCap:Hide()
MainMenuBarArtFrame.PageNumber:Hide()
ActionBarUpButton:Hide()
ActionBarDownButton:Hide()

MultiBarBottomRightButton1:ClearAllPoints()
MultiBarBottomRightButton1:SetPoint("TOP", ActionButton1, "BOTTOM", 503, 36)

StanceButton1:SetAlpha(0.01)
StanceButton2:SetAlpha(0.01)
StanceButton3:SetAlpha(0.01)
StanceButton4:SetAlpha(0.01)
StanceButton5:SetAlpha(0.01)
StanceButton6:SetAlpha(0.01)

StatusTrackingBarManager:SetAlpha(0.2)
	
CharacterMicroButton:SetAlpha(0.01)
SpellbookMicroButton:SetAlpha(0.01)
TalentMicroButton:SetAlpha(0.01)
QuestLogMicroButton:SetAlpha(0.01)
GuildMicroButton:SetAlpha(0.01)
LFDMicroButton:SetAlpha(0.01)
CollectionsMicroButton:SetAlpha(0.01)
EJMicroButton:SetAlpha(0.01)
StoreMicroButton:SetAlpha(0.01)
MainMenuMicroButton:SetAlpha(0.01)
StoreMicroButton:SetAlpha(0.01)
AchievementMicroButton:SetAlpha(0.01)
MicroButtonAndBagsBar:Hide()

Thank you very much for your reply. I’ll try this as soon as I can.

edit:
It worked. thank you very much. especially the activation of the error window. that helped a lot!!

1 Like

Can just toggle errors on/off with a command.
/console scriptErrors 1
0 for off.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.