Skip to content

Commit

Permalink
Chat ME implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
acmgit committed Feb 10, 2024
1 parent b09cef4 commit 92ac34f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
19 changes: 12 additions & 7 deletions core.lua
Expand Up @@ -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
1 change: 1 addition & 0 deletions init.lua
Expand Up @@ -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 = ""
Expand Down
4 changes: 1 addition & 3 deletions lib.lua
Expand Up @@ -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

Expand Down
17 changes: 17 additions & 0 deletions settingtypes.txt
@@ -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
Expand Down

0 comments on commit 92ac34f

Please sign in to comment.