diff options
author | cheapie <no-email-for-you@example.com> | 2024-09-14 15:09:56 -0500 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2024-09-14 15:09:56 -0500 |
commit | 931de0485b90bc1770321902f4efc2fbc251d861 (patch) | |
tree | 52f6f2a807996080cce31a5301dd0a1bde594882 | |
parent | 75cb2d76222a08748a260cd2d12a507feb21924b (diff) | |
download | dropthecaps-931de0485b90bc1770321902f4efc2fbc251d861.tar dropthecaps-931de0485b90bc1770321902f4efc2fbc251d861.tar.gz dropthecaps-931de0485b90bc1770321902f4efc2fbc251d861.tar.bz2 dropthecaps-931de0485b90bc1770321902f4efc2fbc251d861.tar.xz dropthecaps-931de0485b90bc1770321902f4efc2fbc251d861.zip |
-rw-r--r-- | .luacheckrc | 7 | ||||
-rw-r--r-- | init.lua | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..f12f10b --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,7 @@ +max_line_length = 160 + +read_globals = { + "minetest", + "irc", + "notice", +} @@ -28,15 +28,15 @@ minetest.register_on_leaveplayer(function(player) end) minetest.register_on_chat_message(function(name, message) - if minetest.get_player_privs(name).basic_privs~=true and message:len()>16 and caps_percentage(message)>0.5 then + if (not minetest.check_player_privs(name,"basic_privs")) and message:len() > 16 and caps_percentage(message) > 0.5 then caps_message_count[name] = caps_message_count[name] + 1 - if caps_message_count[name]>=3 then + 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.global_exists("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 + if minetest.global_exists("notice") then notice.send(name,"You are using too many capital letters.") else minetest.chat_send_player(name,"You are using too many capital letters.") |