Author Topic: Report Module 1.3  (Read 44453 times)

0 Members and 1 Guest are viewing this topic.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Report Module 1.3
« on: August 17, 2007, 08:07:02 AM »
I wrote this little module there is a few day for our server, so people can easily report bugs or spammers or anything else. I was thinking some of you could be interested by this script, so here it is.

The reports are sent to online admins, and written into a file, by default in "ulx_logs/reports.txt", with timestamp and reporter's name/steamid. If the option is enabled, it also logs into the daily log files.

There is an antispam (thanks JamminR for this idea)
    -It limits the report length to 128 characters (only the console is affected as the chat is already 128 chars max)
    -A player can only report once then he need to wait the interval before being able to report again (default is 120 seconds)


#Changelog:

   1.3:   [add] command help moved into "Utilities" Category (if using ULX 3.20 or greater)
            [add] some comments
            [change] minor and useless changes

   1.2:   [fix] some idiotic bugs, improved code a bit
   
   1.1:   [add] antispam
            [add] log in daily files (as an option)

   1.0:   [initial release]


#Commands:
   "!report <text>" in chat
   "ulx report <text>" in console


#Admins Cvars:
   "ulx_reports_enabled" <0-1>
   "ulx_reports_in_logs" <0-1>
   "ulx_reports_interval" <time>
   "ulx_reports_folder" <folder>



#Installation for ULX svn:
   - Put "reports.lua" file into "ulx/lua/ulx/modules"
   - Restart your server.

#Installation for ULX 3.11:
   - Put "reports.lua" file into "ulx/lua/ulx" folder
   - In the same folder, open "init.lua", locate the line (line 27 or near):
Code: [Select]
Msg( "// Load Complete!            //\n" )   - And add these lines just before:
Code: [Select]
Msg( "//  reports.lua              //\n" )
include( "ulx/reports.lua" )
   - Save and restart your server.

Don't forget to open "reports.lua" and modify settings as you want, if you want.
« Last Edit: September 21, 2007, 06:44:23 AM by Kyzer »

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6196
  • Karma: 394
  • Project Lead
Re: A "report" module
« Reply #1 on: August 17, 2007, 08:30:03 AM »
Very nice Kyzer! We've been talking about making something like this for ULX v3.2 (though a bit more complicated than simple file logging) but haven't gotten around to it yet/made a final decision about it. We'll be interested to see what people think about this.

Also, sorry about the not allowing the lua extension. It should be fixed now, so go ahead and change it. :)
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: A "report" module
« Reply #2 on: August 17, 2007, 10:39:32 AM »
Yes, attachment fixed :) Thanks

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 7885
  • Karma: 372
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: A "report" module
« Reply #3 on: August 17, 2007, 06:36:09 PM »
Nice Kyzer!

Few suggestions.
1) Anti-spam - Length and how many times in a period (1 minute?)
 I could see some idiot minge realizing this was on the server, and going to console and just typing "ulx report blahblahblah..." as much as the input would take, as many times as he could. May not crash a server, but sure would fill useless text.
If no admin was on, and the host only checked his logs once a day or so, lots of wasted space.

2) How about setting a user editable variable at the top of the script, default off, whereby the report would also inject the report into normal logs.
Though the reports log file has a date stamp of course, it might also be handy while just reviewing logs to search for the same report near some event.
Seeing 50 exp barrels spawned by one user right above the report of "<time> blah spawned and exploded barrels, trying to break my stuff", I think, would be a nice 'extra'.
The price one pays for pursuing any profession or calling is an intimate knowledge of its ugly side. - James Baldwin

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: A "report" module
« Reply #4 on: August 17, 2007, 11:50:25 PM »
Thanks for suggestions, i liked them so i did it ;)

You forgot noobs that can bind a key to "ulx report a" :)
The max length in the console is 255 anyway, but i've limited to 128, like the chat.

Here is a new version (first post)

Edit: another new version
« Last Edit: August 18, 2007, 11:40:15 AM by Kyzer »

Lorua

  • Guest
Re: Report Module 1.2
« Reply #5 on: August 30, 2007, 10:58:07 AM »
Hello!

Great work Kyzer. Is there any way to get this work with Ulx 3.11? Or does it only works with the SVN version?


Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Report Module 1.2
« Reply #6 on: August 30, 2007, 11:18:06 AM »
Thank you ;)

You can try to put it in the folder where are located fun.lua, log.lua, utils.lua, etc..and reply here if it works or no, or if you have errors (i think it will work but i'm not sure). But i will try myself anyway.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6196
  • Karma: 394
  • Project Lead
Re: Report Module 1.2
« Reply #7 on: August 30, 2007, 11:18:42 AM »
It won't run automatically, you'll have to add it to the init.lua
Experiencing God's grace one day at a time.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Report Module 1.2
« Reply #8 on: August 30, 2007, 11:37:03 AM »
Right, thanks Megiddo.

So ok it works, i will update the first post :)

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Report Module 1.3
« Reply #9 on: September 21, 2007, 06:22:28 AM »
1.3 released - minor update

Morbs

  • Guest
Re: Report Module 1.3
« Reply #10 on: October 25, 2007, 04:14:04 PM »
Excuse me, this looks like something I could definitely use.  Kudos!

However, the link is down =)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6196
  • Karma: 394
  • Project Lead
Re: Report Module 1.3
« Reply #11 on: October 25, 2007, 05:10:45 PM »
Excuse me, this looks like something I could definitely use.  Kudos!

However, the link is down =)

Works fine for me?
Experiencing God's grace one day at a time.

JamminR_Logged_Out

  • Guest
Re: Report Module 1.3
« Reply #12 on: October 25, 2007, 05:53:58 PM »
Download link doesn't appear if not logged in/registered with our forum.

Offline MathieuG89

  • Newbie
  • *
  • Posts: 28
  • Karma: 1
Re: Report Module 1.3
« Reply #13 on: April 01, 2008, 07:43:37 PM »
This module is great Kyzer! Thank you so much, I am now using this on my server, it is very reassuring to see you can do something on a server when theres no moderator or admins.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: Report Module 1.3
« Reply #14 on: April 03, 2008, 09:51:17 AM »
Cool :)