Printing an actual function as seen in the file from which it was launched.

I know you can print variable names, as shown here for example: http://www.facepunch.com/showthread.php?884409-debug.getparams-Get-the-names-of-a-function-s-arguments

But now I need to print an entire function.

E,g: function: 0390C498 will print:
[lua]function HelloWorld()
print(“hey”);
end;[/lua]

Or just the print(“hey”); part.

Is there any way in doing this? Thanks.

No.



function HelloWorld()
a = "hey"
print(a);
end


**[Debug.getinfo

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Debug.getinfo)**
**[File.Read

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=File.Read)**

Which begs the question, can you file.Read from the cache file? I assume that’s what he wants to do.

How would I use that if the function name is, for example: TestFunction(). I would have to create a coroutine for it too?

I want to read from a piece of lua run from a dll.

You can’t read lua functions from a DLL.
Or the Lua Cache.

:ninja:
You broke automerge.

You would be able to (2) if you can figure out the link between the filename and the dua filename.

One way to get text for all functions is to make a module that hooks into all the functions in lua_shared.dll that convert text into bytecode, save a copy of the text in memory, and associate it with the Lua chunk that gets returned (I believe this is how Decoda works). Even if you do this, keep in mind that your Lua chunk list will get bloated with useless entries if you are running any scripts that make heavy use of **[Player.SendLua

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Player.SendLua)** or **[G.RunString

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=G.RunString)**.