*Edit*
Nevermind, for future reference what works is:
frame:SetScript("OnEvent", assert(loadstring(luacodestring)))
Moderator can delete thread if you like.
For example, I got a string that contains LUA code and I wish to run that code inside a OnEvent script, like this:
Code:
frame:SetScript("OnEvent", function(...)
assert(loadstring(stringluacode))()
end)
Problem is I read you can't pass the "..." down like:
Code:
frame:SetScript("OnEvent", function(...)
assert(loadstring(stringluacode))(...)
end)
So my question now is, anyone got any ideas how I could do this? I was thinking maybe I have to do something like this:
Code:
stringluacode = "local arg = {"..arg1..","..arg2..","..arg3.."}"..stringluacode
But I gotta escape the code and I can't pass down tables like this, kind of messy...