summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2024-08-30 13:43:51 -0500
committercheapie <no-email-for-you@example.com>2024-08-30 13:43:51 -0500
commit75cb2d76222a08748a260cd2d12a507feb21924b (patch)
treee007d6584b436d6bf5e31124f614a70e8cfc6a45
parent95105f72cb6744bbeb2009e7fd11788365f71d67 (diff)
downloaddropthecaps-75cb2d76222a08748a260cd2d12a507feb21924b.tar
dropthecaps-75cb2d76222a08748a260cd2d12a507feb21924b.tar.gz
dropthecaps-75cb2d76222a08748a260cd2d12a507feb21924b.tar.bz2
dropthecaps-75cb2d76222a08748a260cd2d12a507feb21924b.tar.xz
dropthecaps-75cb2d76222a08748a260cd2d12a507feb21924b.zip
Fix a few deprecated things and a global leak
-rw-r--r--depends.txt2
-rw-r--r--init.lua4
-rw-r--r--mod.conf3
3 files changed, 5 insertions, 4 deletions
diff --git a/depends.txt b/depends.txt
deleted file mode 100644
index 7dd5e6f..0000000
--- a/depends.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-irc?
-notice?
diff --git a/init.lua b/init.lua
index 0dc0aef..075e76e 100644
--- a/init.lua
+++ b/init.lua
@@ -1,4 +1,4 @@
-caps_message_count={}
+local caps_message_count={}
local caps_percentage = function(message)
local upper = message:upper()
@@ -33,7 +33,7 @@ minetest.register_on_chat_message(function(name, message)
if caps_message_count[name]>=3 then
minetest.kick_player(name,"Used too many capital letters")
minetest.chat_send_all(string.format("* %s was kicked for using too many capital letters.",name))
- if minetest.get_modpath("irc") then irc:say(string.format("* %s was kicked for using too many capital letters.",name)) end
+ if minetest.get_modpath("irc") then irc.say(string.format("* %s was kicked for using too many capital letters.",name)) end
minetest.log("action", string.format("Kicked %s for using too many capital letters",name))
else
if minetest.get_modpath("notice") then
diff --git a/mod.conf b/mod.conf
new file mode 100644
index 0000000..42c7403
--- /dev/null
+++ b/mod.conf
@@ -0,0 +1,3 @@
+name = dropthecaps
+description = Kicks players that spew all-caps messages
+optional_depends = irc,notice