Jack Parsons
Member
I grew somewhat tired of reading compat.lua to learn the available functions (Since they're mostly "shortcuts"), so I came up with this solution. Just introduce this function to your global.lua:
Then, you have to pass the table that you wish to introspect / inspect (Like "Player", "Item", "Town", "Creature", "Tile", etc (Still inside global.lua)).
This way, you can discover all the functions and read them each time the server starts. You could also use the I/O Library in order to export them to a text file.
Example:
Code:
function listFunctions(t)
for i, v in pairs(t) do
if type(v) == "function" then
print(i, v, debug.getinfo(v))
end
end
end
Code:
listFunctions(Item)
Example:
Last edited: