Advertisement
clark

print out libary functions

Feb 6th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. local tbl = {
  2. ["cam"] = cam,
  3. ["concommand"] = concommand,
  4. ["cvars"] = cvars,
  5. ["debug"] = debug,
  6. ["draw"] = draw,
  7. ["file"] = file,
  8. ["hook"] = hook,
  9. ["math"] = math,
  10. ["net"] = net,
  11. ["render"] = render,
  12. ["string"] = string,
  13. ["surface"] = surface,
  14. ["table"] = table,
  15. ["timer"] = timer,
  16. }
  17.  
  18. for name, funct in SortedPairs(tbl) do
  19. file.Append("debug.txt", "\t['" .. name .. "'] = {\n")
  20.  
  21. for k, v in pairs(funct) do
  22. if funct and funct[k] and type(funct[k]) == "function" then
  23. local info = debug.getinfo(funct[k])
  24.  
  25. if info and info.source and info.func then
  26. file.Append("debug.txt", "\t\t['" .. k .. "'] = { src = '" .. tostring(info.source) .. "', func = '" .. tostring(info.func) .. "' },\n")
  27. end
  28. end
  29. end
  30.  
  31. file.Append("debug.txt", "\t},\n")
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement