Advertisement
qwertz19281

[Lua] apiiter - list ALL (sub)fields and (sub)methods of _G

Feb 21st, 2016
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. --This script will iterate all lua fiels and methods loaded in global table
  2. --example with ComputerCraft: http://pastebin.com/zU5001tQ
  3. c=io.open("apilist","w")
  4.  
  5. function ins(at,bk)
  6.   for k,v in pairs(at) do
  7.     if not (k=="_G") then
  8.       print(bk..k)
  9.       c.writeLine(bk..k)
  10.       if type(v)=="table"  then
  11.         ins(v,bk..k..".")
  12.       end
  13.     end
  14.   end
  15. end
  16.  
  17. ins(_G,"")
  18. c.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement