Chat ME implemented.

This commit is contained in:
A.C.M. 2024-02-10 01:35:40 +01:00
parent b09cef4328
commit 92ac34f105
4 changed files with 31 additions and 10 deletions

View File

@ -41,12 +41,17 @@ minetest.register_on_leaveplayer(function(player)
minetest.log("action", "[MOD] " .. sc.modname .. " : Module core: *** " .. line)
end) -- minetest.register_on_leaveplayer
minetest.override_chatcommand("me", {
if (not sc.do_not_overwrite_me_command) then
print("*** Overwrite me.")
minetest.log("action", "[MOD] " .. sc.modname .. " : Module core: *** Overwrite Chatcommand ME." )
minetest.override_chatcommand("me", {
privs = {},
func = function(name, param)
sc.me(name, param)
return true
end
privs = {},
func = function(name, param)
sc.me(name, param)
return true
end
})
})
end

View File

@ -49,6 +49,7 @@ sc.irc_on = minetest.settings:get_bool("smart_chat.irc_on") or false
sc.matterbridge = minetest.settings:get_bool("smart_chat.matterbridge") or false
sc.matterbridge_irc = minetest.settings:get_bool("smart_chat.matterbridge_irc") or false
sc.join_with_priv = minetest.settings:get_bool("smart_chat.join_with_priv") or false
sc.do_not_overwrite_me_command = minetest.settings:get_bool("smart_chat.do_not_overwrite_me_command") or false
sc.irc_line = ""

View File

@ -255,14 +255,12 @@ function lib.send_2_irc(playername, text)
local line = string.gsub(text, "\27/%([^()]*%)", "")
local me = string.sub(line, 1, 6)
print("Check" .. me .. " > " .. line)
if((me) == ("ACTION")) then
line = "PRIVMSG " .. lib.irc_channel .. " :* " .. playername .. string.sub(line, 7, string.len(line)) .. lib.crlf
print("ME " .. line)
else
line = "PRIVMSG " .. lib.irc_channel .. " :<" .. playername .. "> " .. line .. lib.crlf
print("CHAT " .. line)
end

View File

@ -1,35 +1,52 @@
#Command all
smart_chat.cmd_all (Enable command all) bool true
#Command channels
smart_chat.cmd_channels (Enable command channels) bool true
#Command free_channel
smart_chat.cmd_free_channel (Enable command free) bool true
#Command help
smart_chat.cmd_help (Enable command Help) bool true
#Command invite
smart_chat.cmd_invite (Enable command invite) bool true
#Command join
smart_chat.cmd_join (Enable command join) bool true
smart_chat.join_with_priv (Join with privileg) bool false
#Command kick
smart_chat.cmd_kick (Enable command kick) bool true
#Command leave
smart_chat.cmd_leave (Enable command leave) bool true
#Command list
smart_chat.cmd_list (Enable command list) bool true
#Command move
smart_chat.cmd_move (Enable command move) bool true
#Command status
smart_chat.cmd_status (Enable command Status for Chat) bool true
#Command store_channel
smart_chat.cmd_store_channel (Enable command store_channel) bool true
#Command talk2public
smart_chat.cmd_talk2public (Enable command talk2public) bool true
#Command toggle
smart_chat.cmd_toggle (Enable command toggle) bool true
#Command where
smart_chat.cmd_where (Enable command where) bool true
#Command me
smart_chat.do_not_overwrite_me_command (Overwrite ME to be compatible) bool false
#IRC-Settings
smart_chat.irc_on (Enable IRC) bool false
smart_chat.host_ip (IP of the IRC) string localhost