2020-04-11 03:15:26 +02:00
|
|
|
local sc = smart_chat
|
2022-02-08 19:50:03 +01:00
|
|
|
local S = sc.S
|
|
|
|
|
2022-01-27 23:17:30 +01:00
|
|
|
sc.crlf = "\r\n"
|
2020-04-11 03:15:26 +02:00
|
|
|
|
|
|
|
minetest.register_on_chat_message(function(player, message)
|
|
|
|
|
|
|
|
if(player ~= "" or player ~= nil) then
|
|
|
|
|
|
|
|
--local playername = minetest.get_player_by_name(player)
|
|
|
|
return sc.chat(player, message)
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return false -- Systemmessage, no processing for us.
|
|
|
|
|
2022-01-29 16:39:20 +01:00
|
|
|
end -- if(player ~=
|
2020-04-11 03:15:26 +02:00
|
|
|
|
|
|
|
end) -- register_on_chatmessage()
|
|
|
|
|
2022-02-08 19:50:03 +01:00
|
|
|
|
2020-04-11 03:15:26 +02:00
|
|
|
minetest.register_on_joinplayer(function(player)
|
|
|
|
local playername = player:get_player_name()
|
2022-02-08 21:44:23 +01:00
|
|
|
local message = S("joins the World") .. "."
|
|
|
|
playername = playername or S("unknown")
|
|
|
|
|
2022-02-08 19:50:03 +01:00
|
|
|
sc.send_2_irc(playername, message)
|
2020-04-11 03:15:26 +02:00
|
|
|
sc.player[playername] = nil -- the public Chat
|
|
|
|
sc.public[playername] = nil
|
2022-02-08 19:50:03 +01:00
|
|
|
|
2020-04-11 03:15:26 +02:00
|
|
|
end) -- register_on_joinplayer()
|
|
|
|
|
|
|
|
minetest.register_on_leaveplayer(function(player)
|
2022-02-08 21:44:23 +01:00
|
|
|
local playername = player:get_player_name() or S("unknown")
|
|
|
|
local line = S("leaves the World") .. "."
|
|
|
|
|
2020-04-11 03:15:26 +02:00
|
|
|
sc.player[playername] = nil
|
|
|
|
sc.public[playername] = nil
|
2022-02-08 21:44:23 +01:00
|
|
|
sc.send_2_irc(playername, "*** " .. line .. ".")
|
2022-02-08 19:50:03 +01:00
|
|
|
|
2022-01-29 16:39:20 +01:00
|
|
|
end) -- minetest.register_on_leaveplayer
|
2022-01-27 23:17:30 +01:00
|
|
|
|