Copy-paste to chatbox or place in a macro
Code:/dump (function() RunScript=function(a) loadstring(a)(); end; end)()
Copy-paste to chatbox or place in a macro
Code:/dump (function() RunScript=function(a) loadstring(a)(); end; end)()
how does this work then?
In the beta the /script and /run commands are disabled. This is a workaround to enable them. Just paste it in the chat input box and the commands are enabled until the UI is reloaded.
Could you translate your code to english, or mostly english? I know enough lua to write entire rotations in devpad pages, complete with automatic decisions for aoe or applying debuffs to arbitrary enemies, but I can't, for the life of me, read your code.
KuRIoS is awesome!
Well I can try to explain at least
First you need to know about RunScript..
/script sometext is actually an "alias" for RunScript('sometext')
In live, RunScript points to a C function which, as the name implies, runs the script. In beta, RunScript is nil.
Secondly, you need to know about /dump.
Forget the details on what it does for now, the only thing important is the bolded part of the quote. It tells us that /dump can call lua functions.Arguments
value
The name of the global variable, table value, or function result you wish to show.
Thirdly; loadstring()
loadstring is a standard lua function that parses a string and creates a function out of it.
The rest is just plain lua..
The red parts creates a function which runs the green stuff, which creates another function and assigns it to RunScriptCode:(function() RunScript=function(a) loadstring(a)(); end; end)()
So in the end /script sometext ends up very similar to
anonymous_function = loadstring('sometext')
anonymous_function()
Nicely done Mike +Rep
Haha, forgot /dump actually would let you run things in it. GJ reminding me
Now I can get some addons working again. *cough*
very nice find thanks for share!
What do you mean fixed? It still works fine for me.
Yes it's supposed to say that. Now try to use /run
lol before it never returned "empty result"
and i have tried many time, i get the exact same lua error that i get before i dumped the function
*edit*
i'll live without it.... i'm going to experiment on my end, since it's obvious it works for u lol so with that in mind i tank you again for the code and i'll continue to use PQR as my code testing medium till i get this worked out