banepwn

noita _G dumper script

Feb 23rd, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. function OnModPreInit()
  2.     print("PenTest - OnModPreInit()") -- First this is called for all mods
  3. end
  4.  
  5. function OnModInit()
  6.     print("PenTest - OnModInit()") -- After that this is called for all mods
  7. end
  8.  
  9. function OnModPostInit()
  10.     print("PenTest - OnModPostInit()") -- Then this is called for all mods
  11. end
  12.  
  13. function OnPlayerSpawned( player_entity ) -- This runs when player entity has been created
  14.     GamePrint( "PenTest - OnPlayerSpawned() - Player entity id: " .. tostring(player_entity) )
  15. end
  16.  
  17. function OnWorldInitialized() -- This is called once the game world is initialized. Doesn't ensure any world chunks actually exist. Use OnPlayerSpawned to ensure the chunks around player have been loaded or created.
  18.     GamePrint( "PenTest - OnWorldInitialized() " .. tostring(GameGetFrameNum()) )
  19. end
  20.  
  21. function OnWorldPreUpdate() -- This is called every time the game is about to start updating the world
  22.     --GamePrint( "PenTest - Pre-update hook " .. tostring(GameGetFrameNum()) )
  23. end
  24.  
  25. function OnWorldPostUpdate() -- This is called every time the game has finished updating the world
  26.     --GamePrint( "PenTest - Post-update hook " .. tostring(GameGetFrameNum()) )
  27. end
  28.  
  29. local outstr = ""
  30. local function out(str)
  31.     outstr = outstr..str.."\n"
  32. end
  33. local function dump(tbl, seen, indent)
  34.     seen[tbl] = true
  35.     for k, v in pairs(tbl) do
  36.         out(indent..string.format("(%s) %q = (%s) %q", type(k), tostring(k), type(v), tostring(v)))
  37.         if type(k) == "table" and seen[k] ~= true then
  38.             seen = dump(k, seen, indent.."\t")
  39.         end
  40.         if type(v) == "table" and seen[v] ~= true then
  41.             seen = dump(v, seen, indent.."\t")
  42.         end
  43.         seen[k] = true
  44.         seen[v] = true
  45.     end
  46.     return seen
  47. end
  48. dump(_G, {}, "")
  49.  
  50. error("\n"..outstr)
Add Comment
Please, Sign In to add comment