[clientmod] Coloured chat [colour_chat]

red-001
Member
 
Posts: 193
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001 red-002 red-003 etc red-NaN red-999 Lord_Buckethead

[clientmod] Coloured chat [colour_chat]

by red-001 » Thu Jun 01, 2017 16:38

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
muhdnurhidayat
Member
 
Posts: 248
Joined: Wed Nov 16, 2016 22:55
Location: Shah Alam, Selangor, Malaysia
GitHub: MuhdNurHidayat
IRC: muhdnurhidayat
In-game: muhdnurhidayat

Re: [clientmod] Coloured chat [colour_chat]

by muhdnurhidayat » Sun Jun 04, 2017 19:28

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
[ Full signature ] - UTC+8 here, contributing to Minetest Wiki. I'm muhdnurhidayat in IFS (mod), HOMETOWN & others. / Twitter / MT Offtopic ✂️- - - - - -
 

red-001
Member
 
Posts: 193
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001 red-002 red-003 etc red-NaN red-999 Lord_Buckethead

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Sun Jun 04, 2017 21:57

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: 193
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001 red-002 red-003 etc red-NaN red-999 Lord_Buckethead

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Sun Jun 04, 2017 22:11

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

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

Re: [clientmod] Coloured chat [colour_chat]

by BBmine » Mon Jun 05, 2017 22:57

I saw diamondknight using this mod on HOMETOWN. It was REALLY cool! xD
God's not dead! -- Mods, Servers, My Youtube Channel My forum Good Music -- Never gonna give you up!!
 

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

Re: [clientmod] Coloured chat [colour_chat]

by paramat » Sat Jun 10, 2017 23:26

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: 193
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001 red-002 red-003 etc red-NaN red-999 Lord_Buckethead

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Sun Jun 11, 2017 00:11

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: 31
Joined: Tue Jul 05, 2016 11:28
Location: Deutschland
GitHub: niansa
IRC: nisa oder niansa
In-game: nisa oder tuxifan

Re: [clientmod] Coloured chat [colour_chat]

by mini » Thu Jun 15, 2017 13:44

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
muhdnurhidayat
Member
 
Posts: 248
Joined: Wed Nov 16, 2016 22:55
Location: Shah Alam, Selangor, Malaysia
GitHub: MuhdNurHidayat
IRC: muhdnurhidayat
In-game: muhdnurhidayat

Re: [clientmod] Coloured chat [colour_chat]

by muhdnurhidayat » Thu Jun 15, 2017 16:31

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...
[ Full signature ] - UTC+8 here, contributing to Minetest Wiki. I'm muhdnurhidayat in IFS (mod), HOMETOWN & others. / Twitter / MT Offtopic ✂️- - - - - -
 

red-001
Member
 
Posts: 193
Joined: Tue Jan 26, 2016 20:15
GitHub: red-001
IRC: red-001 red-002 red-003 etc red-NaN red-999 Lord_Buckethead

Re: [clientmod] Coloured chat [colour_chat]

by red-001 » Thu Jun 15, 2017 17:30

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?
 

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

Re: [clientmod] Coloured chat [colour_chat]

by BBmine » Fri Jun 16, 2017 19:03

This has been disabled on HOMETOWN. Too bad.
God's not dead! -- Mods, Servers, My Youtube Channel My forum Good Music -- Never gonna give you up!!
 

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

Re: [clientmod] Coloured chat [colour_chat]

by mini » Sat Jun 17, 2017 08:04

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: 745
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation
 

User avatar
Enrikoo
Member
 
Posts: 143
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico
In-game: Enrico

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Tue Dec 05, 2017 14:47

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)
Join my server Enrico Craft on address: minetesthosting.com port: 31079 | Visit GitHub of my minetest server.
 

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

Re: [clientmod] Coloured chat [colour_chat]

by Fedora24 » Wed Dec 06, 2017 22:26

can you PM in color?
Linuxworks original server
96.230.217.246 port 30000
 

User avatar
Enrikoo
Member
 
Posts: 143
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico
In-game: Enrico

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Thu Dec 07, 2017 12:59

Fedora24 wrote:can you PM in color?

Why should i send you private message, you are not the owner of the csm.
Join my server Enrico Craft on address: minetesthosting.com port: 31079 | Visit GitHub of my minetest server.
 

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

Re: [clientmod] Coloured chat [colour_chat]

by Fedora24 » Thu Dec 07, 2017 14:52

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
Linuxworks original server
96.230.217.246 port 30000
 

User avatar
Enrikoo
Member
 
Posts: 143
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico
In-game: Enrico

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Thu Dec 07, 2017 15:21

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.
Join my server Enrico Craft on address: minetesthosting.com port: 31079 | Visit GitHub of my minetest server.
 

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

Re: [clientmod] Coloured chat [colour_chat]

by Fedora24 » Thu Dec 07, 2017 15:23

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
Linuxworks original server
96.230.217.246 port 30000
 

User avatar
Enrikoo
Member
 
Posts: 143
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico
In-game: Enrico

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Thu Dec 07, 2017 16:52

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.
Join my server Enrico Craft on address: minetesthosting.com port: 31079 | Visit GitHub of my minetest server.
 

User avatar
Lone_Wolf
Member
 
Posts: 1630
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [clientmod] Coloured chat [colour_chat]

by Lone_Wolf » Fri Dec 08, 2017 03:02

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
 

User avatar
Enrikoo
Member
 
Posts: 143
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico
In-game: Enrico

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Fri Dec 08, 2017 05:47

But i can't talk in chat with Techy5 csm because i didn't pasted it in init LUA.
Join my server Enrico Craft on address: minetesthosting.com port: 31079 | Visit GitHub of my minetest server.
 

User avatar
Lone_Wolf
Member
 
Posts: 1630
Joined: Sun Apr 09, 2017 05:50
Location: You wouldn't believe me
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf or Somebody

Re: [clientmod] Coloured chat [colour_chat]

by Lone_Wolf » Fri Dec 08, 2017 06:20

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
 

User avatar
muhdnurhidayat
Member
 
Posts: 248
Joined: Wed Nov 16, 2016 22:55
Location: Shah Alam, Selangor, Malaysia
GitHub: MuhdNurHidayat
IRC: muhdnurhidayat
In-game: muhdnurhidayat

Re: [clientmod] Coloured chat [colour_chat]

by muhdnurhidayat » Fri Dec 08, 2017 11:42

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...
[ Full signature ] - UTC+8 here, contributing to Minetest Wiki. I'm muhdnurhidayat in IFS (mod), HOMETOWN & others. / Twitter / MT Offtopic ✂️- - - - - -
 

User avatar
Enrikoo
Member
 
Posts: 143
Joined: Thu Nov 16, 2017 18:18
Location: Germany
GitHub: Enrikoo
IRC: Enrico
In-game: Enrico

Re: [clientmod] Coloured chat [colour_chat]

by Enrikoo » Fri Dec 08, 2017 13:14

Fedora24 wrote:can you PM in color?

I can't because i don't use Techy5 csm in Minetest.
Join my server Enrico Craft on address: minetesthosting.com port: 31079 | Visit GitHub of my minetest server.
 

Next

Return to Client-side modding



Who is online

Users browsing this forum: No registered users and 1 guest