Neat lua stats program

Sorry if this isn’t the right board. I just wrote this program
Lua Stats

This script allows you to see all the lines of code, hooks, functions, and net messages in a given directory.
It searches the whole directory so script, addon, gamemode, entire server, it can check it all!

Screenshot of Drugs Mod

Screenshot of DarkRP

It currently checks for:
Added Hooks.
Net Messages Sent.
And what originally inspired this script: Lines of code.

Is this useful? No not really, but it’s so neat that I thought I should share.
What else should it check for? I am willing to add other things that are constantly created in lua/glua

Suggestions for shortening/optimizations? Feel free to comment

It would get more attention if it was posted here

Taking a brief look at the code, this script seems to count all instances of the word ‘funciton’. So, if I had that wrote in a comment, or whatever, the script would give a false result? I’m pretty sure that the debug library can do all of this, and more. :confused:

Will fix, thanks for the suggestion

[editline]31st August 2015[/editline]

I didn’t post this there because this isn’t a glua script and doesn’t fall under “gamemode” or “addon”.
Should I post it there though?

The script now ignores all things found in lua and glua notes (–[[function]] /function/)
Any sort of trigger words I should add to this?

Possibly add blank lines/comment lines, or make it display each file in a directory w/ line count/file size?


Do you mean the count of local variables? Please elaborate.

I could add specific info per file during processing, thank you for the suggestion

Stev_'s request has been added… Sort of. Formatting printing is very tedious and difficult so I gave up on making it look nice. The script also displays the file with the most lines and the file with the biggest size separately at the end (The two are not always the same.)

If anyone has any suggestions on making the print not make users go brain dead, please reply! The printing occurs on line 121

Pics of the newest update

Darkrp (ew)

Drugs mod (Not as gross)

My entire home darkrp server (interesting)

I will add a hotfix right after posting this to allow the user to turn extra details off.

For those curious like I was, “texteditor.lua” is part of wiremod (addons/wiremod/lua/wire/client/texteditor.lua)
“vehicle.lua” is part of !cake anitcheat.

Much better

I my self don’t use them, but maybe add user-messages to be detected as well?

Isn’t the umsg library just the deprecated form of net messages? I will probably add them for the lols, see how many people use outdated functions. Thank you for the suggestion.

New update, added checking for (most) deprecated functions/variables

(Still horrible formatting, but this is darkrp, turns out it’s still using a LOT of depricated functions)

The script can now log to a file as well

usermessages are NOT deprecated. They are inferior to net, but not deprecated.

That’s…pretty much what deprecation is.


OK Geez, no need to spam about it. I am wrong.

i remember making this reasoning a while ago, and you actually disagreed with me.