Sorry if this isn't the right board. I just wrote this program
[URL="https://github.com/blindsighter314/Lua-Stats"]Lua Stats[/URL]
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
[IMG]http://i.imgur.com/WRJWO57.png[/IMG]
Screenshot of DarkRP
[IMG]http://i.imgur.com/MGnQbNS.png[/IMG]
It currently checks for:
Functions.
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 [URL="http://facepunch.com/forumdisplay.php?f=66"]here[/URL]
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. :/
[QUOTE=Braden1996;48580767]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. :/[/QUOTE]
Will fix, thanks for the suggestion
[editline]31st August 2015[/editline]
[QUOTE=Exploderguy;48580167]It would get more attention if it was posted [URL="http://facepunch.com/forumdisplay.php?f=66"]here[/URL][/QUOTE]
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?
[QUOTE=blindsighterr;48584676]The script now ignores all things found in lua and glua notes (--[[function]] /*function*/)
Any sort of trigger words I should add to this?[/QUOTE]
Localizations
[QUOTE=StonedPenguin;48593567]Localizations[/QUOTE]
Do you mean the count of local variables? Please elaborate.
[QUOTE=stev_;48593538]Possibly add blank lines/comment lines, or make it display each file in a directory w/ line count/file size?[/QUOTE]
I could add specific info per file during processing, thank you for the suggestion
EDIT
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)
[IMG]http://i.imgur.com/F0Jufp2.png[/IMG]
Drugs mod (Not as gross)
[IMG]http://i.imgur.com/D6zOfTn.png[/IMG]
My entire home darkrp server (interesting)
[IMG]http://i.imgur.com/x87omZS.png[/IMG]
I will add a hotfix right after posting this to allow the user to turn extra details off.
EDIT
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.
EDIT
Much better
[IMG]http://i.imgur.com/TxxMewv.png[/IMG]
I my self don't use them, but maybe add user-messages to be detected as well?
[QUOTE=tzahush;48597245]I my self don't use them, but maybe add user-messages to be detected as well?[/QUOTE]
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)
[IMG]http://i.imgur.com/IO1BM7Z.png[/IMG]
The script can now log to a file as well
[IMG]http://i.imgur.com/2F4f1Vn.png[/IMG]
[IMG]http://i.imgur.com/eC4QUi2.png[/IMG]
usermessages are NOT deprecated. They are inferior to net, but not deprecated.
[QUOTE=Robotboy655;48604605]They are inferior to net[/QUOTE]
That's...pretty much what deprecation is.
[quote]Deprecation is an attribute applied to a computer software feature, characteristic, or practice to indicate that it should be avoided (often because it is being superseded)[/quote]
[QUOTE=Robotboy655;48604605]usermessages are NOT deprecated. They are inferior to net, but not deprecated.[/QUOTE]
[IMG]http://i.imgur.com/YuSFnud.png[/IMG]
:/
[QUOTE=man with hat;48606875][IMG]http://i.imgur.com/P41EXDf.png[/IMG]
[IMG]http://i.imgur.com/bCUdWYz.png[/IMG][/QUOTE]
OK Geez, no need to spam about it. I am wrong.
Sorry, you need to Log In to post a reply to this thread.