summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Debuggers/Debuggers.lua
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-02 14:43:55 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-02 14:43:55 +0100
commit7167105e22c16a0adf8b90c5a94257d4457e7bbc (patch)
treef7ba42f729ca66608851f4f0356ac148c2f99a99 /MCServer/Plugins/Debuggers/Debuggers.lua
parentAnother GCC fix, hopefully this one will work (diff)
downloadcuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.tar
cuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.tar.gz
cuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.tar.bz2
cuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.tar.lz
cuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.tar.xz
cuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.tar.zst
cuberite-7167105e22c16a0adf8b90c5a94257d4457e7bbc.zip
Diffstat (limited to 'MCServer/Plugins/Debuggers/Debuggers.lua')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua23
1 files changed, 17 insertions, 6 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 065237ba7..3e1a1ba5d 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -1,7 +1,7 @@
-- Global variables
-PLUGIN = {} -- Reference to own plugin object
-ShouldDumpFunctions = false -- If set to true, all available functions are logged upon plugin initialization
+PLUGIN = {}; -- Reference to own plugin object
+ShouldDumpFunctions = true; -- If set to true, all available functions are logged upon plugin initialization
@@ -22,7 +22,7 @@ function Initialize(Plugin)
-- dump all available functions to console:
if (ShouldDumpFunctions) then
LOG("Dumping all available functions:");
- function dump (prefix, a)
+ function dump (prefix, a, Output)
for i, v in pairs (a) do
if (type(v) == "table") then
if (GetChar(i, 1) ~= ".") then
@@ -31,15 +31,26 @@ function Initialize(Plugin)
elseif (v == _G.package) then
LOG(prefix .. i .. " == _G.package, ignoring");
else
- dump(prefix .. i .. ".", v)
+ dump(prefix .. i .. ".", v, Output)
end
end
elseif (type(v) == "function") then
- LOG(prefix .. i .. "()")
+ if (string.sub(i, 1, 2) ~= "__") then
+ table.insert(Output, prefix .. i .. "()");
+ end
end
end
end
- dump("", _G);
+
+ local Output = {};
+ dump("", _G, Output);
+
+ table.sort(Output);
+ local f = io.open("API.txt", "w");
+ for i, n in ipairs(Output) do
+ f:write(n, "\n");
+ end
+ f:close();
end
return true