summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2015-07-24 00:32:20 -0500
committercheapie <no-email-for-you@example.com>2015-07-24 00:32:20 -0500
commitd9bf531c22a8d4de6778d75a8126bccc3889b6f8 (patch)
treef41fa885432b0dddd60894ea315d9f84d0b0811b
downloaddropthecaps-d9bf531c22a8d4de6778d75a8126bccc3889b6f8.tar
dropthecaps-d9bf531c22a8d4de6778d75a8126bccc3889b6f8.tar.gz
dropthecaps-d9bf531c22a8d4de6778d75a8126bccc3889b6f8.tar.bz2
dropthecaps-d9bf531c22a8d4de6778d75a8126bccc3889b6f8.tar.xz
dropthecaps-d9bf531c22a8d4de6778d75a8126bccc3889b6f8.zip
Add Content
-rw-r--r--README2
-rw-r--r--depends.txt1
-rw-r--r--init.lua8
3 files changed, 11 insertions, 0 deletions
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)