Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. local f = file.Open('diagnostic-dump.txt', 'w', 'DATA')
  2.  
  3. local function dumpFunction(func)
  4. local info = debug.getinfo(func)
  5. local str = {}
  6. for i = 1, info.nparams do
  7. table.insert(str, "_")
  8. end
  9. if info.isvararg then
  10. table.insert(str, "...")
  11. end
  12. str = {(info.name or "unknown") .. "@"..(info.what or "unknown") .. "@" .. (info.short_src or "unknown"), "(", table.concat(str, ", "), ")"}
  13. return table.concat(str, "")
  14. end
  15.  
  16. -- dump hook data
  17. f:Write("------------------\n")
  18. f:Write(" HOOK DATA DUMP \n")
  19. f:Write("------------------\n")
  20. for hookName, hooks in pairs(hook.GetTable()) do
  21. f:Write(hookName .. "\n")
  22. for id, func in pairs(hooks) do
  23. f:Write("\t" .. id .. " : " .. dumpFunction(func) .. "\n")
  24. end
  25. end
  26.  
  27. -- dump a list of the installed addons
  28. f:Write("------------------\n")
  29. f:Write(" ADDON LIST DUMP \n")
  30. f:Write("------------------\n")
  31.  
  32. do
  33. local files, dirs = file.Find("addons/*", "MOD")
  34. for
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement