Help with scripts and putting into an addon!

Can someone help me make these scripts, please? I want to hide my level on my portrait and show the moonkin form ability like shown here and I also want to hide my targets level and the circle surrounding it on the portrait then same for my focus target.
gyazo. com/7ad27a48492973c4902924b25f6e8a55

I’m also trying to write all my /run scripts into an addon but I can’t figure out how to do it. I tried to use addon.bool by putting them all there and deleting the “/run” in the lines but it didn’t do anything when I used the addon.

/run PlayerFrame: SetScale(1.1)
/run TargetFrame: SetScale(1.1)
/run FocusFrame: SetScale(1.1)
/run PlayerName:Hide()
/run MiniMapTracking:Hide()
/run GarrisonLandingPageMinimapButton:Hide()
/run GameTimeFrame:Hide()
/run MinimapZoneTextButton:Hide()
/run MiniMapZoomIn:Hide()
/run MiniMapZoomOut:Hide()
/run MiniMapWorldMapButton:Hide()
/run MinimapBorderTop:Hide()
/run MainMenuBarArtFrame.LeftEndCap:Hide();MainMenuBarArtFrame.RightEndCap:Hide()
/run MicroButtonAndBagsBar:Hide()
/run StatusTrackingBarManager:Hide()
/run MainMenuBarArtFrameBackground:Hide()
/run ActionBarUpButton:Hide()
/run ActionBarDownButton:Hide()
/run RegisterStateDriver(StanceBarFrame, ‘visibility’, ‘hide’)
/run BuffFrame.SetPoint=BuffFrame.SetPoint f=function() BuffFrame:ClearAllPoints() BuffFrame:SetPoint(“BOTTOMRIGHT”,PlayerFrame,“BOTTOMRIGHT”,697,112) end f() hooksecurefunc(BuffFrame,“SetPoint”,function() f() end) BuffFrame:SetScale(1.2)
/run CharacterMicroButton:ClearAllPoints()
/run CharacterMicroButton:SetPoint(“CENTER”,-6000,0)
/run CharacterMicroButton:Setpoint=function() end
/run CompactPartyFrameMember2Name:SetAlpha(0)
/run CompactPartyFrameMember1Name:SetAlpha(0)
/run CompactPartyFrameMember3Name:SetAlpha(0)
/run MinimapZoomIn:Hide()
/run MinimapZoomOut:Hide()
/run TargetFrameTextureFrameName:SetAlpha(0)
/run FocusFrameTextureFrameName:SetAlpha(0)
/run MainMenuBarArtFrame.PageNumber:Hide()
/run TargetFrameToTTextureFrameName:SetAlpha(0)
/run FocusFrameToTTextureFrameName:SetAlpha(0)

Could someone help me write it into lua so the addon.bool will work correctly or a different method? Thank you.

Install:
BugGrabber
https://www.curseforge.com/wow/addons/bug-grabber

and BugSack:
https://www.curseforge.com/wow/addons/bugsack

These will help identify where the errors are.

12x CERRENUI\core.lua:23: function arguments expected near ‘=’

This doesn’t really do anything for me because I have no idea how to write lua or scripts in that matter.

I helps us identify where things might be wrong without having to search line-by-line through blocks of unformatted and/or intention unclear code.

Line 23:

CharacterMicroButton:Setpoint=function() end

should be

CharacterMicroButton.Setpoint=function() end

The use of the : instead of the . means it thinks you are trying to call the method in question rather than changing what it does.

It also means you’ve either never used that line in a macro or never noticed it didn’t work so you may not need that line in your addon.

Okay now it’s giving me the error
1.CerrenUI\core.lua:19: unexpected symbol near ‘?’ (x4)

But not a question mark in the quotes, a box… And it’s not showing anything in the error log but only on the minimap icon. I’ve included a gyazo screenshot. It’s also only running a few of the commands, is that normal?

gyazo. com/914f203b8b979cd8d5a13e5f2b50c7b0

It looks like you might have a tab or some such in the code. It’s a bit difficult with code block in the OP
(you might re-post it with you current code. Once pasted, select it all and press the code tags button (</> above the edit box) so it retains most of its formatting).

try changing:
RegisterStateDriver(StanceBarFrame, "visibility", "hide")

to:
StanceBarFrame:HookScript("OnShow", function(self) self:Hide() end)

Once you get an error, execution of the current set of commands will stop.

1 Like