Pinkishu

fenvdump

Feb 12th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local c = 0
  2. while true do
  3.   local fenv = getfenv(c)
  4.   if fenv == nil then break end
  5.   local file = fs.open("fenv_"..c,"w")
  6.   local funcs = {}
  7.   local other = {}
  8.   for k,v in pairs(fenv) do
  9.     if type(v) == "function" then funcs[k] = v
  10.     else
  11.         other[k]=v
  12.     end
  13.  
  14.  
  15.   end
  16.   file.writeLine("--Functions")
  17.   str = ""
  18.   for k,v in pairs(funcs) do file.writeLine(k) end
  19.  
  20.   str = ""
  21.   file.writeLine("--OTHER")
  22.   for k,v in pairs(other) do file.writeLine( k.."("..type(v)..")".."=>"..(type(v) == "table" and tostring(v) or v) ) end
  23.  
  24.   file.close()
  25.   c=c+1
  26. end
Add Comment
Please, Sign In to add comment