From d9bf531c22a8d4de6778d75a8126bccc3889b6f8 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 24 Jul 2015 00:32:20 -0500 Subject: Add Content --- README | 2 ++ depends.txt | 1 + init.lua | 8 ++++++++ 3 files changed, 11 insertions(+) create mode 100644 README create mode 100644 depends.txt create mode 100644 init.lua diff --git a/README b/README new file mode 100644 index 0000000..db246f7 --- /dev/null +++ b/README @@ -0,0 +1,2 @@ +This is a simple mod for Minetest that kicks players that attempt to send all-caps messages of more than 5 characters. +It will also send a message to all players stating that the kick occurred, and if the irc mod is installed, the same message will be sent to the IRC channel. diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..20efb18 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +irc? diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..421b04d --- /dev/null +++ b/init.lua @@ -0,0 +1,8 @@ +minetest.register_on_chat_message(function(name, message) + if message:len()>5 and message:lower()~=message and message:upper()==message then + minetest.kick_player(name,"Sending all-caps messages is not allowed") + minetest.chat_send_all(string.format("* %s was kicked for sending an all-caps message.",name)) + if minetest.get_modpath("irc") then irc:say(string.format("* %s was kicked for sending an all-caps message.",name)) end + minetest.log("action", string.format("Kicked %s for sending an all-caps message",name)) + end +end) -- cgit v1.2.3