Request for someone to turn two macro scripts into addons.
I know I could just throw these into a folder and they would probably work fine, but was just wondering if someone could clean them up.
Macro one puts the yellow border around dispellable buffs that is default for mages/shamans.. etc around all target/focus frame buffs for all classes and not just enemy target/focus. Lua Code:
Macro two replaces the level text on the default nameplates to arenaID numbers when inside an arena. So arena target 123 instead of level 100. Lua Code:
|
Bump
The first macro looks fine to me, but could someone show me how to indent it? I tried using an auto indentation program and it doesn't work on this code, it just keeps it at 1 line. Not too concerned about the second macro, so unless someone is bored, don't worry about it. |
You mean just this?
Lua Code:
|
Yes, thank you.
|
While you're doing cleanup, you may as well go a little further and remove some inefficiencies that might make sense in the context of a space-limited macro, but don't make sense in an addon. The current code is doing two things that aren't so great:
1. It's looking up the name of the target frame over and over. The target frame shows up to 32 buffs at a time, so you're potentially calling the same function 32 times. You can easily call it just once, store the name in a variable, and refer to that inside your loop: Code:
hooksecurefunc("TargetFrame_UpdateAuras", function(s) Code:
hooksecurefunc("TargetFrame_UpdateAuras", function(s) Finally (not related to performance) you can add more whitespace to improve readability: Code:
hooksecurefunc("TargetFrame_UpdateAuras", function(s) |
All times are GMT -6. The time now is 01:49 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI