44 lines
1.1 KiB
Lua
Raw Normal View History

2020-04-11 03:15:26 +02:00
local sc = smart_chat
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()
2020-04-11 03:15:26 +02:00
minetest.register_on_joinplayer(function(player)
local playername = player:get_player_name()
local message = S("joins the World") .. "."
playername = playername or S("unknown")
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
2020-04-11 03:15:26 +02:00
end) -- register_on_joinplayer()
minetest.register_on_leaveplayer(function(player)
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
sc.send_2_irc(playername, "*** " .. line .. ".")
2022-01-29 16:39:20 +01:00
end) -- minetest.register_on_leaveplayer
2022-01-27 23:17:30 +01:00