aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-03-29 18:27:21 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2020-03-29 18:27:21 +0200
commit5892c472fd95ba6d36e9ddc6917486d6dbdb33b9 (patch)
treed54ce0ae80202d60a6cefc72332757409659fba9
parent0b412261d722b66ff796f35c1c1a02744bbbb204 (diff)
downloadbeerchat-5892c472fd95ba6d36e9ddc6917486d6dbdb33b9.tar.gz
beerchat-5892c472fd95ba6d36e9ddc6917486d6dbdb33b9.tar.bz2
beerchat-5892c472fd95ba6d36e9ddc6917486d6dbdb33b9.zip
Adapted for LinuxForks server
-rw-r--r--init.lua19
1 files changed, 11 insertions, 8 deletions
diff --git a/init.lua b/init.lua
index 8b2cd54..1a76f02 100644
--- a/init.lua
+++ b/init.lua
@@ -5,12 +5,12 @@ local channels = {}
-- Mod settings -- Change these to your liking
--
local main_channel_name = "main" -- The main channel is the one you send messages to when no channel is specified
-local main_channel_owner = "Beerholder" -- The owner of the main channel, usually ADMIN
+local main_channel_owner = "gabriel" -- The owner of the main channel, usually ADMIN
local main_channel_color = "#ffffff" -- The color in hex of the main channel
local default_channel_color = "#ffffff" -- The default color of channels when no color is specified
-local enable_sounds = true -- Global flag to enable/ disable sounds
+local enable_sounds = false -- Global flag to enable/ disable sounds
local channel_management_sound = "beerchat_chirp" -- General sound when managing channels like /cc, /dc etc
local join_channel_sound = "beerchat_chirp" -- Sound when you join a channel
local leave_channel_sound = "beerchat_chirp" -- Sound when you leave a channel
@@ -50,7 +50,7 @@ local self_message_string = "(${from_player} utters to him/ herself) ${message}"
local private_message_sent_string = "[PM] sent to @(${to_player}) ${message}"
local me_message_string = "|#${channel_name}| * ${from_player} ${message}"
local channel_message_string = "|#${channel_name}| <${from_player}> ${message}"
-local main_channel_message_string = "|#${channel_name}| <${from_player}> ${message}"
+local main_channel_message_string = "<${from_player}> ${message}"
local whisper_string = "|#${channel_name}| <${from_player}> whispers: ${message}"
function format_message(s, tab)
@@ -421,7 +421,8 @@ minetest.register_chatcommand("unignore", unmute_player)
atchat_lastrecv = {}
minetest.register_on_chat_message(function(name, message)
- local players, msg = string.match(message, "^@([^%s:]*)[%s:](.*)")
+ local raw_msg = minetest.strip_colors(message)
+ local players, msg = string.match(raw_msg, "^@([^%s:]*)[%s:](.*)")
if players and msg then
if msg == "" then
minetest.chat_send_player(name, "Please enter the private message you would like to send")
@@ -562,9 +563,10 @@ minetest.register_chatcommand("me", me_override)
hashchat_lastrecv = {}
minetest.register_on_chat_message(function(name, message)
- local channel_name, msg = string.match(message, "^#(.-): (.*)")
+ local raw_msg = minetest.strip_colors(message)
+ local channel_name, msg = string.match(raw_msg, "^#(.-): (.*)")
if not channels[channel_name] then
- channel_name, msg = string.match(message, "^#(.-) (.*)")
+ channel_name, msg = string.match(raw_msg, "^#(.-) (.*)")
end
if channel_name == "" then
channel_name = hashchat_lastrecv[name]
@@ -608,7 +610,7 @@ minetest.register_on_chat_message(function(name, message)
end
return true
else
- channel_name = string.match(message, "^#(.*)")
+ channel_name = string.match(raw_msg, "^#(.*)")
if channel_name then
if not channels[channel_name] then
minetest.chat_send_player(name, "Channel "..channel_name.." does not exist")
@@ -635,7 +637,8 @@ end)
-- $ chat a.k.a. dollar chat code, to whisper messages in chat to nearby players only using $, optionally supplying a radius e.g. $32 Hello
minetest.register_on_chat_message(function(name, message)
- local dollar, sradius, msg = string.match(message, "^($)(.-) (.*)")
+ local raw_msg = minetest.strip_colors(message)
+ local dollar, sradius, msg = string.match(raw_msg, "^($)(.-) (.*)")
if dollar == "$" then
local radius = tonumber(sradius)
if not radius then