Originally Posted by Codger
I went to ChatGPT https://chat.openai.com/ and asked them to convert the xml code to lua and the code below is the result.
...
Lua Code:
frame:SetScript("OnLoad", function() frame.TitleText:SetText("Simple Frame") end)
|
The problem with this is OnLoad runs when
CreateFrame() is called. Registering a script to it through Lua does nothing as it's never called again.
It's still a good idea to proofread any code GhatGPT spits out as it still makes mistakes. It sees
parentKey and just shoves it in a local instead of assigning the object to that key in the parent's table, as Fizzlemizz pointed out. It also doesn't handle
useParentLevel, which is to set the child's framelevel equal to its parent where by default, it's +1.