aboutsummaryrefslogtreecommitdiff
path: root/clientmods/dragonfire/chat/spam.lua
diff options
context:
space:
mode:
Diffstat (limited to 'clientmods/dragonfire/chat/spam.lua')
-rw-r--r--clientmods/dragonfire/chat/spam.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/clientmods/dragonfire/chat/spam.lua b/clientmods/dragonfire/chat/spam.lua
new file mode 100644
index 000000000..991846d33
--- /dev/null
+++ b/clientmods/dragonfire/chat/spam.lua
@@ -0,0 +1,12 @@
+local etime = 0
+
+minetest.register_globalstep(function(dtime)
+ etime = etime + dtime
+ if etime < 10/8 then return end
+ etime = 0
+ local spam = minetest.settings:get("chat_spam")
+ local enable_spam = minetest.settings:get("chat_enable_spam")
+ if enable_spam and spam then
+ local _ = chat.send(spam) or minetest.send_chat_message(spam)
+ end
+end)