Creating a secure macro (>255) frame
I've learned that I can bypass the 255 character limit by using a secure macro frame but at the moment I'm still trying to learn how to do this. The following is the text from a file myfirstframe.xml which I create with a text editor and until I get my head around the method I'll just be using the macro as it stands (<255) in this file:
Code:
<Button name="SecureActionButtonTemplate" inherits="SecureFrameTemplate" virtual="true"> |
You have several problems:
Code:
frame:SetAttribute("type", "macro"), ("macrotext", "#showtooltip\n/startattack\n/console Sound_EnableSFX 0\n/use [combat] Code:
frame:SetAttribute("type", "macro"); Code:
frame:SetAttribute("macrotext", [[ |
Thanks. I created a files GSHB2.lua and places it in a directory GSHB2 in my addons directory. It contains the following code:
Code:
<Button name="GSHB2" inherits="SecureActionButtonTemplate" virtual="true"> |
Firstly, do you have a toc? Second, that's xml code above, not lua.
|
Quote:
Quote:
I've saved it as GSHB2.xml now instead. What's next? |
|
Quote:
Quote:
Quote:
Code:
## Interface: 20400 Code:
<Button name="GSHB" inherits="SecureActionButtonTemplate" virtual="true"> |
You need dependencies and a lua file. Also you need a header in the xml refering to the lua file as script source.
Also have you restarted WoW yet? File tree changes don't take effect until you restart. |
Quote:
What needs to go in the lua file? I understood it all to be contained in the xml file. Re: header in the xml refering to the lua file as script source: isn't xml the script? Quote:
|
I'm novice to Lua and XML, so I don't know if I am wording this correctly.
The code you have in your XML file now is Lua code. XML is used to make the frames and set up the Scripts for Lua. From what I am reading you should do this: (This won't work, just the idea. (Or at least I don't believe so.)) Lua file: Code:
local GSHB = CreateFrame("frame") If you set up a button with an OnClick script, you have to go back to the Lua file and make a function for that script. Example (Lua file): Code:
function GSHB_OnClick() Scripts can be made in Lua as well, but I am not sure if you need XML or not for this addon. Hope this helps clarify some. |
Get rid of OnClick. You have no control of OnClick from a secure button.
The type/macrotext attributes need to be set OnLoad. Everything after that will be handled for you automatically. |
All times are GMT -6. The time now is 12:19 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI