SirBaconBitz

Dump

Jan 25th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. function dump(t, level)
  2.         level = level or 0
  3.         for i,v in pairs(t) do
  4.         sleep(0.25)
  5.                 io.write(string.rep('  ', level))
  6.                 io.write(i..': ')
  7.                 if type(v) == 'table' then
  8.                         print ''
  9.                         dump(v, level + 1)
  10.                 else
  11.                         print(tostring(v))
  12.                 end
  13.         end
  14. end
  15.  
  16. local thing = {
  17.         a_table = {
  18.                 another_table = {
  19.                         some_value = 'a string'
  20.                 }
  21.         }
  22. }
  23.  
  24. dump(thing)
Add Comment
Please, Sign In to add comment