Ulysses

Ulysses Stuff => Releases => Ulysses Release Archives => Topic started by: Chironex on August 17, 2007, 08:07:02 AM

Title: Report Module 1.3
Post by: Chironex 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.
Title: Re: A "report" module
Post by: Megiddo 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. :)
Title: Re: A "report" module
Post by: Chironex on August 17, 2007, 10:39:32 AM
Yes, attachment fixed :) Thanks
Title: Re: A "report" module
Post by: JamminR 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'.
Title: Re: A "report" module
Post by: Chironex 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
Title: Re: Report Module 1.2
Post by: Lorua 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?

Title: Re: Report Module 1.2
Post by: Chironex 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.
Title: Re: Report Module 1.2
Post by: Megiddo on August 30, 2007, 11:18:42 AM
It won't run automatically, you'll have to add it to the init.lua
Title: Re: Report Module 1.2
Post by: Chironex on August 30, 2007, 11:37:03 AM
Right, thanks Megiddo.

So ok it works, i will update the first post :)
Title: Re: Report Module 1.3
Post by: Chironex on September 21, 2007, 06:22:28 AM
1.3 released - minor update
Title: Re: Report Module 1.3
Post by: Morbs on October 25, 2007, 04:14:04 PM
Excuse me, this looks like something I could definitely use.  Kudos!

However, the link is down =)
Title: Re: Report Module 1.3
Post by: Megiddo 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?
Title: Re: Report Module 1.3
Post by: JamminR_Logged_Out on October 25, 2007, 05:53:58 PM
Download link doesn't appear if not logged in/registered with our forum.
Title: Re: Report Module 1.3
Post by: MathieuG89 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.
Title: Re: Report Module 1.3
Post by: Chironex on April 03, 2008, 09:51:17 AM
Cool :)
Title: Re: Report Module 1.3
Post by: compuwiz on April 03, 2008, 01:09:34 PM
Just a suggestion, make the command
Code: [Select]
!report <player to be reported> <text>
ulx report <player to be reported> <text>
so when gets logged you can have the reporter's name,  steamID, & message, & the other person's name & steamID.
Title: Re: Report Module 1.3
Post by: Chironex on April 05, 2008, 03:36:25 AM
This module can be used to report anything not just players

And what's wrong with writing
Code: [Select]
!report Mingy is spamming melons!!instead of
Code: [Select]
!report Mingy he is spamming melons!!
Ok there is no steamid of the reported player, but the reporter could type "status" in console and copy/paste the steamid of the reported player in the message, if needed...but as these reports are logged into daily log files, it's easy to find his steamid.

:)
Title: Re: Report Module 1.3
Post by: zonax on May 04, 2011, 04:31:50 AM
Hello.
First of all. Sorry for bumping an old thread. But i can't get this to work, so i thought it would be best to do it here, so other users also could read it, if they where in the same situation as me.


I'm using the newest svn version (165) and have ulx and ulib.
But i really can't get this to work. I don't know if it's outdated, or it's just me that have a problem.
I'm following the instructions by putting the reports.lua into \orangebox\garrysmod\addons\ulx\lua\ulx\modules
And that's it. I don't get any error at all.(server and clientside)
It's like it wont register the module. if i type "ulx report <text" in console, notthing happens. It's just saying
"Invalid command entered. If you need help, please type "ulx help" in your console."

Anyone got any idea what's wrong here?

Title: Re: Report Module 1.3
Post by: Aaron113 on May 04, 2011, 05:58:57 AM
This was not made for the SVN of ULX, it was made for release.
Title: Re: Report Module 1.3
Post by: JamminR on May 04, 2011, 02:23:12 PM
A bit confusing, we understand, but the mention of SVN in the first post is for SVN of ULX 3.2. At time of original post, ULX version 3.1 was out. (Our last 'release' was version 3.4)
A rewrite of the ULib code base occurred after 3.4, making most older releases, or their SVN, incompatible.

Once we do a full release of 3.5 (or whatever version the new code changes require), I personally plan on looking into some of the releases we currently have, and depending on the complexity, converting some. (Converting actually often makes the release smaller/easier to do a convert)

Some of the release authors here also still visit somewhat regularly, and may re-release for current codebase.
The author of this particular module was here in early March.
Title: Re: Report Module 1.3
Post by: zonax on May 04, 2011, 11:07:10 PM
Oh, that's why i can't get it to work.

Well, i'm looking foward to the 3.5 release, and hoping they will update some of the old releases.

Thank you.
Title: Re: Report Module 1.3
Post by: Jussy on May 21, 2013, 08:41:31 AM
Hi Sorry To Revive this thread, but for some reason it doesnt work for me, could that possibly be from the updates ? if so could u possibly update this addon, I would really appreciate it so much :)
Title: Re: Report Module 1.3
Post by: Vilusia on May 21, 2013, 08:45:14 AM
It doesn't work because it's an outdated module.
Title: Re: Report Module 1.3
Post by: Jussy on May 21, 2013, 08:58:44 AM
It Would Be Awesome If Chironex Could Update It :) I have Been looking For A Addon Like This For Ages
Title: Re: Report Module 1.3
Post by: MrPresident on May 21, 2013, 09:37:23 AM
He hasn't been around these forums since August of last year.
Title: Re: Report Module 1.3
Post by: Jussy on May 21, 2013, 10:32:44 AM
Ah that sucks man, could you possibly try it out if you know code ?? :P
Title: Re: Report Module 1.3
Post by: MrPresident on May 21, 2013, 11:42:43 AM
I don't know how to code, I'm sorry.  ::)



Maybe someone will pick it up now that it's been bumped up and brought to light.
Title: Re: Report Module 1.3
Post by: Jussy on May 21, 2013, 01:17:32 PM
haha all good man :) i hope so :) thanks alot any ways man :)
Title: Re: Report Module 1.3
Post by: Vilusia on May 21, 2013, 01:42:21 PM
Jussy a good alternative for this reporter is a neat tool.
It's made by tyguy, its called Reporter Tool.
You can use that until someone fixes this :D
Here is the svn for it: http://tyguy550.googlecode.com/svn/trunk/
Hope this helps!
Title: Re: Report Module 1.3
Post by: Jussy on May 21, 2013, 01:53:07 PM
Thanks So much :) I really appreciate this man :) ive been searching for so long :P lol thanks again :)
Title: Re: Report Module 1.3
Post by: Jussy on May 21, 2013, 02:10:57 PM
Ahh for some reason it messes up my servers jobs, i cant click on them :P ill just have to wait till hopefully an update comes out for this reporter :) but thnx man :)
Title: Re: Report Module 1.3
Post by: JamminR on May 21, 2013, 02:16:14 PM
Not only is this release older than the Gmod 13 update, it's older than our Ulib re-write of (2011?)

/me hijacks thread with post related nothing to original topic.
I don't know how to code, I'm sorry.  ::)
/me thinks "ah HA! There WERE negative effects."


/me continues laughing aloud at the joke MrP made.
Title: Re: Report Module 1.3
Post by: bender180 on May 21, 2013, 05:05:15 PM
so i want to try and attempt to update this as i think it might be useful to me, do you think it would be better for me to rewrite it from scratch or update the existing code. I started updating existing code ive been getting this error

Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/sh/reports.lua:46: attempt to call field 'convar' (a nil value)
i think its because im creating the convars incorrectly

Code: [Select]
-- Easy Config:
local ReportsEnabled = "1" -- Set this to 0 if you want to disable this script
local ReportsInLogs = "1" -- Set this to 0 if you don't want to log reports in daily logs
local ReportsInterval = "120" -- The player can only report once then he need to wait this interval (seconds) before reporting again. 0 = no delay (not recommended)
local ReportsFolder = "ulx_logs" -- By default, in the same folder as others log files
-- End of config


local ReportsEnabled = ulx.convar( "ReportsEnabled", "1", "<0-1> - Set this to 0 if you want to disable the report command.", ULib.ACCESS_ADMIN)
local reportsInLogs = ulx.convar( "reportsInLogs", "1", "<0-1> - Set this to 0 if you don't want to log reports in daily logs.", ULib.ACCESS_ADMIN )
local ReportsInterval = ulx.convar( "ReportsInterval", "120", "<time> - Time between 2 reports from the same player. Set this to 0 to disable.", ULib.ACCESS_SUPERADMIN )
local ReportsFolder = ulx.convar( "ReportsFolder", "ulx_logs", "<folder> - The folder where to save the reports file.", ULib.ACCESS_SUPERADMIN )


Any help/suggestions would be great as ive never used a convar before.
Title: Re: Report Module 1.3
Post by: Vilusia on May 21, 2013, 05:42:25 PM
Code: [Select]
[ERROR] addons/ulx/lua/ulx/modules/sh/reports.lua:46: attempt to call field 'convar' (a nil value)
  1. unknown - addons/ulx/lua/ulx/modules/sh/reports.lua:46
   2. include - [C]:-1
    3. unknown - addons/ulx/lua/ulx/cl_init.lua:17
     4. include - [C]:-1
      5. unknown - addons/ulx/lua/ulib/modules/ulx_init.lua:4
       6. include - [C]:-1
        7. unknown - addons/ulib/lua/ulib/cl_init.lua:23
         8. include - [C]:-1
          9. unknown - addons/ulib/lua/autorun/ulib_init.lua:5

Getting this.
Title: Re: Report Module 1.3
Post by: JamminR on May 21, 2013, 07:41:42 PM
Vilusia, read the second page of this thread....it's not compatible with Ulib 2.5 or Gmod 13. and the post above yours only indicates he's thinking about making it work (whether by scratch or by rewrite)

Bender, Best of both worlds.
To rewrite the ULX commands themselves, you almost have to rewrite the functions anyway.
As for convar structure, I'd have to remind myself how we do it.

EDIT- If ULX had a documents site like Ulib does at ulyssesmod.net/docs, here's what it would say about ulx.convar
Code: [Select]
--[[
Function: convar

This is what will set up ULX's convars, it makes them under the command "ulx"

Parameters:

command - The console command. IE, "sv_kickminge".
value - The value to start off at.
help - *(Optional)* A help string for using the command.
access - *(Optional, defaults to ACCESS_ALL)* Restricted access.
]]

My guess, you're defining the same variables twice. Once as a string or number, then as a convar.
Title: Re: Report Module 1.3
Post by: bender180 on May 21, 2013, 08:51:10 PM
Thank you that should help also will there ever be a ulx docs site like ulib?
Title: Re: Report Module 1.3
Post by: Vilusia on May 22, 2013, 02:46:22 AM
Sorry about that I misread what he said :P
Title: Re: Report Module 1.3
Post by: Jussy on May 22, 2013, 09:12:43 AM
Ok Well If You Ever Get This To Work, Could You Post It On The Forums ?? That Would Be Awesome :)
Title: Re: Report Module 1.3
Post by: SuperAero_ on May 26, 2013, 03:53:36 AM
Great Release
Title: Re: Report Module 1.3
Post by: bender180 on June 03, 2013, 11:57:50 AM
just an update i still am working on patching this up ive got it almost 100% ive just been busy with school and haven't had much time to do anything lua related.
Title: Re: Report Module 1.3
Post by: nak0604 on July 29, 2013, 08:34:20 PM
I get this error when i start my server now

http://pastebin.com/56xjSJNW