[clientmod] Coloured chat [colour_chat]

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

[clientmod] Coloured chat [colour_chat]

by red-001 » Post

This mod automatically adds colour to all messages you send
Usage - Chatcommands
  • .set_colour to set the colour of chat sent to the server, you can use either HTML named colours or HTML hexdecimal colour codes.
  • .rainbow to generate and send rainbow text
Get
github
Download

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by mnh48 » Post

is there any setting to turn off temporarily while ingame?

for example, when coloured chat is set, the teleport in IhrFussel's Server doesn't work (typing location name to be teleported to said location wouldn't even respond) so it would be good if we can temp turn off to use teleport and turn on after that. xD

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

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Post

Not yet but you can run `.set_colour` on it's own to reset your colour settings which should fix that however you will need to enter your colour again

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

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Post

Update: I added a `.say` command for sending chat without colour

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

Re: [clientmod] Coloured chat [colour_chat]

by BBmine » Post

I saw diamondknight using this mod on HOMETOWN. It was REALLY cool! xD

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: [clientmod] Coloured chat [colour_chat]

by paramat » Post

This mod is now irritating server admin, and protection against it is being coded as a PR.
Please only use this mod after checking if it is allowed on a server (it probably will not be).

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

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Post

Sever owners can just strip the colour codes if they have an issue with this. It's even a setting now so it couldn't be easier. For the record the server owners of the servers I play on didn't mind this much but I suppose it's different when a lot of people are using it.

mini
Member
Posts: 79
Joined: Tue Jul 05, 2016 11:28
GitHub: niansa
IRC: nisa oder tuxifan
In-game: nisa oder tuxifan
Location: Deutschland

Re: [clientmod] Coloured chat [colour_chat]

by mini » Post

The mod doesn't work for me. When i use .rainbow my client does show a grey window. And .set_colour is the same but if i use .set_colour the client does show a grey window when i type a message.

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by mnh48 » Post

for .rainbow ... did you just send the command by itself? you should put the text after the command...

for example:
.rainbow Hello there! I'm here :P

gives you:
Hello there! I'm here :P

as for .set_colour ... you write the HTML named colours or HTML hexdecimal colour codes after the command just for one time, then just write chat normally without any command... the chat will appear according to colour you've defined, until you change the colour or deactivate the clientmod...

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

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Post

mini wrote:The mod doesn't work for me. When i use .rainbow my client does show a grey window. And .set_colour is the same but if i use .set_colour the client does show a grey window when i type a message.
can you tell me whats in debug.txt?

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

Re: [clientmod] Coloured chat [colour_chat]

by BBmine » Post

This has been disabled on HOMETOWN. Too bad.

mini
Member
Posts: 79
Joined: Tue Jul 05, 2016 11:28
GitHub: niansa
IRC: nisa oder tuxifan
In-game: nisa oder tuxifan
Location: Deutschland

Re: [clientmod] Coloured chat [colour_chat]

by mini » Post

The error messsage in debug.txt:

Code: Select all

2017-06-17 10:04:08: ERROR[Main]: ModError: Runtime error from mod 'colour_chat' in callback on_sending_message(): /home/nils/.minetest/clientmods/colour_chat/init.lua:67: attempt to call field 'send_chat_message' (a nil value)
Edit: I have seen that my version is old, i'm compiling the newest version...

Edit2: It works now :)

User avatar
ManElevation
Member
Posts: 896
Joined: Tue Aug 02, 2016 22:04
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
Location: Madrid,Spain

Re: [clientmod] Coloured chat [colour_chat]

by ManElevation » Post

i did it for you guys so you dint have to set this up your self
https://github.com/ManElevation/minetest-zip
My Public Mods! Discord: Rottweiler Games#3368

Enrikoo
Member
Posts: 452
Joined: Thu Nov 16, 2017 18:18
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
Location: Germany
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Post

Here is the Techy5's coloured chat code:

Code: Select all

local data = minetest.get_mod_storage()
local dColor = "#00FF00"
 
local chatSource = function(msg) -- Find out who was talking to us
    if string.sub(msg, 1, 1) == "<" then -- Normal messages
        local parts = string.split(msg, ">") -- Split it at the closing >
        return string.sub(parts[1], 2, string.len(parts[1])) -- Return the first part minus the first character
    elseif string.sub(msg, 1, 2) == "* " then -- /me messages
        local parts = string.split(msg, " ") -- Split the message before and after the name
        return parts[2] -- Return the name (this one is easy)
    end
    return false -- If nothing else returned, return false
end
 
minetest.register_chatcommand("setcolor", { -- Assign a colour to chat messages from a specific person
    params = "<name> <color>",
    description = "Colourize a specified player's chat messages",
    func = function(param)
        local args = string.split(param, " ") -- Split up the arguments
        local setName = "player_" .. args[1] -- The setting name to set
        local color = args[2]
        if not color then -- If a color was not specified, use the default color.
            color = dColor
        end
        data:set_string(setName, color)
        minetest.display_chat_message("Player color set sucessfully!")
    end
})
 
minetest.register_chatcommand("delcolor", {
    params = "<name>",
    description = "Set a specified player's chat messages to the default colour",
    func = function(param)
        local setName = "player_" .. param
        data:set_string(setName, nil) -- Set the color as blank
        minetest.display_chat_message("Player color set sucessfully!")
    end
})
 
minetest.register_chatcommand("listcolors", {
    params = "",
    description = "List player/colour pairs",
    func = function(param)
        local list = data:to_table().fields
        for key,value in pairs(list) do
            if string.sub(key, 1, 7) == "player_" then
                key = string.sub(key, 8, string.len(key))
            end
            minetest.display_chat_message(key .. ", " .. minetest.colorize(value, value))
        end
    end
})
 
minetest.register_on_connect(function()
    minetest.register_on_receiving_chat_messages(function(message)
        local msgPlain = minetest.strip_colors(message)
        local source = chatSource(msgPlain)
       
        if not source then -- If the chat was not from a player, return
            return
        end
       
        local playerSet = "player_" .. source -- The setting name
        local color = data:get_string(playerSet) -- Get the desired color
        if color == "" then -- If no color, return
            return
        end
       
        message = minetest.colorize(color, msgPlain)
        minetest.display_chat_message(message)
        return true
    end)
end)

User avatar
Edgy1
Member
Posts: 163
Joined: Thu Nov 24, 2016 16:29
GitHub: JamesTobin
In-game: Trump

Re: [clientmod] Coloured chat [colour_chat]

by Edgy1 » Post

can you PM in color?

Enrikoo
Member
Posts: 452
Joined: Thu Nov 16, 2017 18:18
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
Location: Germany
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Post

Fedora24 wrote:can you PM in color?
Why should i send you private message, you are not the owner of the csm.

User avatar
Edgy1
Member
Posts: 163
Joined: Thu Nov 24, 2016 16:29
GitHub: JamesTobin
In-game: Trump

Re: [clientmod] Coloured chat [colour_chat]

by Edgy1 » Post

Enrikoo wrote:
Fedora24 wrote:can you PM in color?
Why should i send you private message, you are not the owner of the csm.
That wasn't helpful. I'm talking about /msg in minetest chat with color mod. Don't troll the forum

Enrikoo
Member
Posts: 452
Joined: Thu Nov 16, 2017 18:18
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
Location: Germany
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Post

Fedora24: I don't want to message you in pm i don't try to trolling in forum and it isn't your csm anyway.

User avatar
Edgy1
Member
Posts: 163
Joined: Thu Nov 24, 2016 16:29
GitHub: JamesTobin
In-game: Trump

Re: [clientmod] Coloured chat [colour_chat]

by Edgy1 » Post

Enrikoo wrote:Fedora24: I don't want to message you in pm i don't try to trolling in forum and it isn't your csm anyway.
I am not trolling, I asked a serious question

Enrikoo
Member
Posts: 452
Joined: Thu Nov 16, 2017 18:18
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
Location: Germany
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Post

Fedora24 wrote:I am not trolling, I asked a serious question
You don't need it to do, but i just posted it in this topic that red-001 can look it.

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [clientmod] Coloured chat [colour_chat]

by Lone_Wolf » Post

Enrikoo wrote:
Fedora24 wrote:I am not trolling, I asked a serious question
You don't need it to do, but i just posted it in this topic that red-001 can look it.
Er wollte fragen, ob es möglich sei, deine privaten Nachrichten im Spiel zu färben
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

Enrikoo
Member
Posts: 452
Joined: Thu Nov 16, 2017 18:18
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
Location: Germany
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Post

But i can't talk in chat with Techy5 csm because i didn't pasted it in init LUA.

User avatar
Lone_Wolf
Member
Posts: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [clientmod] Coloured chat [colour_chat]

by Lone_Wolf » Post

Enrikoo wrote:But i can't talk in chat with Techy5 csm because i didn't pasted it in init LUA.
Er redet nicht über die clientseitige Mod von Techy5
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
mnh48
Member
Posts: 310
Joined: Wed Nov 16, 2016 22:55
GitHub: mnh48
IRC: MNH48
In-game: mnh48
Location: Kuala Lumpur, Malaysia
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by mnh48 » Post

Looks like someone misunderstand the question...

They just ask if this CSM could send PMs in-game in colour or not... They did not ask you to PM them, lol...

Enrikoo
Member
Posts: 452
Joined: Thu Nov 16, 2017 18:18
GitHub: Enrikoo
IRC: Enrico - Enricoo - Enrlco
In-game: Enrico - Enriko
Location: Germany
Contact:

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Post

Fedora24 wrote:can you PM in color?
I can't because i don't use Techy5 csm in Minetest.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests