[clientmod] Chat log [chatlog]

Post Reply
red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

[clientmod] Chat log [chatlog]

by red-001 » Post

Log chat messages via CSM.

You need a new minetest-dev version.

How to use:
Just use the ".chatlog" or ".chatlog help" command.

License
License: MIT

Code: Select all

MIT License

Copyright (c) 2017 

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Get
github
Download

Install
Extract like a normal mod but to "/clientmods" instead of "/mods".
Then enable "client modding" in the advance settings menu
Last edited by red-001 on Sun Mar 26, 2017 07:50, edited 2 times in total.

User avatar
cx384
Member
Posts: 653
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384

Re: [clientmod] Chat log [chatlog]

by cx384 » Post

Nice mod!
The first post locks like this:
viewtopic.php?f=9&t=17046
Can your read this?

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [clientmod] Chat log [chatlog]

by Desour » Post

Heh, nice idea to copy nearly everything from my clientmod's first post. :D
Could you write the chatlog also into a file?
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

Yeah I'm pretty bad at writing bbcode so I used your post as an example. I can't save it to a normal file because CSM doesn't give mods direct filesystem access, however you can find the json file the mod saves to in "/client/mod_storage/chatlog"

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

Update: You can now add timestamps to messages

BBmine
Member
Posts: 3476
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: [clientmod] Chat log [chatlog]

by BBmine » Post

Very cool! Is this a mod, or a feature with the latest dev build?

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

Both? It's a mod for the new lua api.

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

Update: If you are using a recent version of minetest the prefix for client-sided commands as been changed from "/" to "."

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

update: The mod is now able to automatically detect if it should log messages that it's sending to the server.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [clientmod] Chat log [chatlog]

by Sokomine » Post

Thanks for the mod! It's a pity that clientside mods can't access the filesystem :-( Thus we need a second script in order to read what was stored.
A list of my mods can be found here.

User avatar
Wuzzy
Member
Posts: 4778
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [clientmod] Chat log [chatlog]

by Wuzzy » Post

What does this mod do?

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [clientmod] Chat log [chatlog]

by Desour » Post

Wuzzy wrote:What does this mod do?
AFAIK it logs the chat. :P
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

BBmine
Member
Posts: 3476
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: [clientmod] Chat log [chatlog]

by BBmine » Post

Where does it save the chatlog? :P

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

it saves it as a kind of peusdo table in /client/storage/chatlog

BBmine
Member
Posts: 3476
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: [clientmod] Chat log [chatlog]

by BBmine » Post

red-001 wrote:it saves it as a kind of peusdo table in /client/storage/chatlog
I can't really read it. I opened it with LibreOffice because it seems to be a CSV, but it looks unformatted.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [clientmod] Chat log [chatlog]

by azekill_DIABLO » Post

"best thing to open something is a notepad" --azekill_DIABLO, just now.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [clientmod] Chat log [chatlog]

by Desour » Post

@BBmine: Have you tried leafpad?
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

red-001
Member
Posts: 205
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001

Re: [clientmod] Chat log [chatlog]

by red-001 » Post

it's json encoded so yes libreoffice wouldn't handle it.

User avatar
r1bnc
Member
Posts: 38
Joined: Mon Dec 23, 2019 07:57
GitHub: r1bnc
IRC: r1bnc
In-game: r1bnc
Location: Philippines
Contact:

Re: [clientmod] Chat log [chatlog]

by r1bnc » Post

-
cdb_4afce6e9210a
twitch.tv/r1bnc

User avatar
Miniontoby
Member
Posts: 616
Joined: Fri Mar 01, 2019 19:25
GitHub: Miniontoby
IRC: Miniontoby
In-game: Miniontoby
Location: The Netherlands

Re: [clientmod] Chat log [chatlog]

by Miniontoby » Post

May i implement this into my upcoming csm mod??? I make an adv_csm which includes lots of features such as playerlist and some node stuff and more debug and the coloured chat. I want to get this too, if you allow me, or i will code my own one.
Working on mtctl ---- Check my mod "Doorbell" -- Stay safe

User avatar
Mesenotaur
New member
Posts: 6
Joined: Tue Mar 02, 2021 12:42
GitHub: Mesenotaur

Re: [clientmod] Chat log [chatlog]

by Mesenotaur » Post

Hello there!

This CSM seems really promising; I need to look at things people wrote with me.
So it saves the chatlog in a file in the mod’s storage, right? Does it also work for server notifications, PMs and other things? Just everything the chat gives you?
Anyway, I sadly have to report that this mod doesn’t work for me. My Minetest 5.4.1 is showing the following error:

Code: Select all

ModError: Failed to load and run mod "chatlog":
chatlog:init.lua:31: attempt to call field 'register_on_receiving_chat_messages' (a nil value)
stack traceback:
  chatlog:init.lua:31: in main chunk
Check debug txt for details.
I did not yet have the time nor interest into coding mods for myself, tho I want to get into it, especially some CSM.
So how can this be fixed? I understand that that parameter doesn’t exist; what is it now? And any idea why it changed?

Thanks for the mod and hopefully some answers and fixes.
--Mesenotaur

EDIT: Ok, this was a very easy fix. You just need to replace the two register_on_receiving_chat_messages in the code to register_on_receiving_chat_message (message instead of messages). Then the mod doesn’t crash and you join the server.
But: The logging logged the server messages, that’s good. But I wrote some messages into the chat and it logged nothing at all from those. I saw something like Debug id: 0 and Debug id: 1 in chat, which wasn’t there before. Is it not logging what I myself write?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest