[Mod] Chat2 [0.1.0] [chat2]

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

[Mod] Chat2 [0.1.0] [chat2]

by lag01 » Sat Jun 20, 2015 10:30

This mod is meant to solve problem when game chat is too intensive - players logging in/out, speaking among themselves, system messages etc. and it is hard to follow messages addressed to you.
Modes:
  • default: show you messages in different colors, when someone mention your name or PM you, also nearby chat or shouts(!).
  • "/chat2 *": show also regular messages, so it can be used instead of default chat (close default game chat by pressing F2)
  • Can turn on/off by writing command "/chat2"

License: LGPL 2.1 or later.
Dependencies: chat_anticurse? (my other mod, but should work without it too)

Download: zip
Browse on: GitHub
 

User avatar
rubenwardy
Moderator
 
Posts: 5546
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Chat2 [0.1.0] [chat2]

by rubenwardy » Sat Jun 20, 2015 19:15

A few tips

Code: Select all
function chat2.add_message(player, new_text, new_color)


Is the same as

Code: Select all
chat2.add_message = function(player, new_text, new_color)


With

Code: Select all
if something == nil then


You can use

Code: Select all
if not something then


Providing 'something' isn't a boolean.

Coloured chat is going to be added soon™ to the Minetest core, just as a warning.
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: [Mod] Chat2 [0.1.0] [chat2]

by lag01 » Sat Jun 20, 2015 19:54

rubenwardy wrote:A few tips
...
Code: Select all
function chat2.add_message(player, new_text, new_color)

...
Code: Select all
if not something then

...

Thanks, i will try to remember that next time!

rubenwardy wrote:Coloured chat is going to be added soon™ to the Minetest core, just as a warning.

Oh, that would be nice, especially with good api. Meanwhile, we can test colored chat in real world environment using mods like this one :)
 

amadin
Member
 
Posts: 544
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Chat2 [0.1.0] [chat2]

by amadin » Sun Jul 05, 2015 19:16

Does it is bug? Chat2 cuts long sentences whith message <invalid multibyte string>.
Image
 

User avatar
Krock
Developer
 
Posts: 4152
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: [Mod] Chat2 [0.1.0] [chat2]

by Krock » Mon Jul 06, 2015 07:47

amadin wrote:Does it is bug? Chat2 cuts long sentences whith message <invalid multibyte string>.
http://s18.postimg.org/qi3ihk61l/image.jpg

That's a Minetest core issue. It looks like the character conversion failed there.
What you can do is: check for a newer client version and/or report this as an issue on GitHub.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: [Mod] Chat2 [0.1.0] [chat2]

by lag01 » Mon Jul 06, 2015 10:33

problem is because i use wrong function string.sub() to split utf8 string, and it sometimes split some utf8 letters in half, resulting in this error.
later will think of solution...
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: [Mod] Chat2 [0.1.0] [chat2]

by lag01 » Mon Jul 06, 2015 19:51

I tried to write custom splitting code, but <invalid multibyte string> still occurs sometimes. So need future testing...
 

amadin
Member
 
Posts: 544
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Chat2 [0.1.0] [chat2]

by amadin » Tue Jul 07, 2015 16:22

Do you can turn off case sensitive of nicknames in chat and chat commands by your mod? If not, maybe you know how to do it to me?
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: [Mod] Chat2 [0.1.0] [chat2]

by lag01 » Tue Jul 07, 2015 19:04

amadin wrote:Do you can turn off case sensitive of nicknames in chat and chat commands by your mod? If not, maybe you know how to do it to me?

Here, in attachment. I changed two lines, so your nick and search words are searched case insensitive. It applies to all players, so i am not sure if it is ok as default.

Please report to me, if <invalid multibyte string> still happens.
Attachments
chat2.zip
with case insensitive nick and search words.
(12.91 KiB) Downloaded 28 times
 

amadin
Member
 
Posts: 544
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Chat2 [0.1.0] [chat2]

by amadin » Sun Jul 12, 2015 04:12

lag01 wrote:
amadin wrote:Do you can turn off case sensitive of nicknames in chat and chat commands by your mod? If not, maybe you know how to do it to me?

Here, in attachment. I changed two lines, so your nick and search words are searched case insensitive. It applies to all players, so i am not sure if it is ok as default.

Please report to me, if <invalid multibyte string> still happens.

Nothing changed - i still can use only case sensitive nicknames and and i still see error <invalid multibyte string>.
 

amadin
Member
 
Posts: 544
Joined: Tue Jun 16, 2015 16:23

Re: [Mod] Chat2 [0.1.0] [chat2]

by amadin » Thu Jul 16, 2015 06:53

I propose to introduce an alternative to the command / msg - the command / m (for speed type) and / n (near) for messages to players near me (do non write in public chat). I do not know whether or not it is feasible, but would like to input box ("T") remembers the previous chat command as the linux console, because f10 is far and it closes (covers) half of screen.
 

User avatar
Samson1
Member
 
Posts: 94
Joined: Wed Apr 01, 2015 19:41
IRC: Samson1
In-game: Samson1

Re: [Mod] Chat2 [0.1.0] [chat2]

by Samson1 » Wed Oct 28, 2015 17:27

Are there colours for Admins? Server owners?
 

User avatar
kaadmy
Member
 
Posts: 701
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: [Mod] Chat2 [0.1.0] [chat2]

by kaadmy » Wed Oct 28, 2015 17:36

How would you figure out who's a moderator/admin? Currently admins/mods just have different privs, all of which any player can have. Maybe have a builtin list of moderators?
Never paint white stripes on roads near Zebra crossings.

Pixture
 

User avatar
orwell
Member
 
Posts: 720
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Chat2 [0.1.0] [chat2]

by orwell » Wed Nov 04, 2015 13:42

kaadmy wrote:How would you figure out who's a moderator/admin? Currently admins/mods just have different privs, all of which any player can have. Maybe have a builtin list of moderators?


Why not add a privilege (e.g. "moderator") to identify moderators? Maybe add more privs like this and make colors configurable in your mod. This wouldn't need a server restart when adding a new moderator.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
rubenwardy
Moderator
 
Posts: 5546
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Chat2 [0.1.0] [chat2]

by rubenwardy » Wed Nov 04, 2015 15:53

Whilst that's an abuse of the privilege system (it's meant to grant players the ability to do something, not to rank and list users) it'll be the quickest way to do it.
 

User avatar
orwell
Member
 
Posts: 720
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Chat2 [0.1.0] [chat2]

by orwell » Sun Nov 08, 2015 20:03

rubenwardy wrote:Whilst that's an abuse of the privilege system ...


Maybe it is not the purpose of the privilege system, but if you have not too many different ranks, it's just right.
BTW, being a moderator actually IS a privilege.
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
orwell
Member
 
Posts: 720
Joined: Wed Jun 24, 2015 18:45
Location: Raxacoricofallapatorius
In-game: orwell

Re: [Mod] Chat2 [0.1.0] [chat2]

by orwell » Mon Nov 16, 2015 16:21

Just uploaded that mod. It's not that much code. You could use the idea (or even the code, then include the copyright notice in license.txt).
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

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

Re: [Mod] Chat2 [0.1.0] [chat2]

by Wuzzy » Sat Jul 01, 2017 15:44

Note: Minetest now allows to color the chat natively. So the main reason for duplicating the chat is gone, now you can colorize the chat directly by using `core.colorize`.
So I think this mod should be re-done so it does not need a laggy HUD element anymore.
My creations. I gladly take any bitcoins you have lying around: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 9 guests