Thread Tools Display Modes
10-03-19, 01:30 AM   #1
lurtex
A Defias Bandit
Join Date: Oct 2019
Posts: 2
Classic: Script into addon

Hey

Im wondering if anyone can help me to convert some scripts into an addon so i dont have to manually run it every time i log on (works on retail but not on classic), and how to make the TargetFrameNameBackground transparent like my player frame:
https://gyazo.com/1446e21a2c71cb8b104fc8cf4c2bd2f9


/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==PlayerFrameHealthBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==TargetFrameHealthBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==PlayerFrameManaBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)
/run hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(_,s)if s==TargetFrameManaBar.TextString then local t=s:GetText()if t then s:SetText(t:gsub(" / .*",""))end end end)

Thank you
  Reply With Quote
10-03-19, 05:08 AM   #2
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
You could paste them in to https://addon.bool.no/ , and it will spit out an addon for you. It's been a long time since I used it so I don't remember exactly what you have to do but I do remember that you have to edit the strings a little. I know that you have to take the "/run" off the beginning of each line, though. It'll even make a .toc file for you (but you might have to edit it a little bit to make it to your liking ).

But, it'll make you a serviceable addon.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!
  Reply With Quote
10-03-19, 04:05 PM   #3
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
The website jeffy linked is what I suggest using to create an addon out of your script (don't forget to remove the /runs as they suggested), but you also need to open the .toc file from the downloaded folder and change 80200 to 11302 so the addon can run without using the "load out of date addons" option.

As for making the target frame transparent, here you go:

Lua Code:
  1. hooksecurefunc("TargetFrame_CheckFaction",function(self)
  2.     self.nameBackground:SetVertexColor(0,0,0,0.5)
  3. end)

This will make the targetframe's name background the same color and alpha as the playerframe, but it will no longer show gray for tapped units or any other color.

Finally, about your "works in retail and not in classic" comment, what is that referring to? Your scripts? You need to make sure "numeric values" is selected in Esc > Interface Options > Display, which gives the frames the "### / ###" format you're trying to change.

Last edited by Kanegasi : 10-03-19 at 04:07 PM.
  Reply With Quote
10-04-19, 08:48 PM   #4
lurtex
A Defias Bandit
Join Date: Oct 2019
Posts: 2
Originally Posted by Kanegasi View Post
The website jeffy linked is what I suggest using to create an addon out of your script (don't forget to remove the /runs as they suggested), but you also need to open the .toc file from the downloaded folder and change 80200 to 11302 so the addon can run without using the "load out of date addons" option.

As for making the target frame transparent, here you go:

Lua Code:
  1. hooksecurefunc("TargetFrame_CheckFaction",function(self)
  2.     self.nameBackground:SetVertexColor(0,0,0,0.5)
  3. end)

This will make the targetframe's name background the same color and alpha as the playerframe, but it will no longer show gray for tapped units or any other color.

Finally, about your "works in retail and not in classic" comment, what is that referring to? Your scripts? You need to make sure "numeric values" is selected in Esc > Interface Options > Display, which gives the frames the "### / ###" format you're trying to change.
Hey, thanks for the help!

Yea the color of tapped units might be a problem I realized. Is it possible to only works on players?

Thanks again
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Classic: Script into addon

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off