From 7c62730cd476914cf834b4f195b11f5a2adbbcde Mon Sep 17 00:00:00 2001 From: Akamaru Date: Sat, 6 Jun 2015 22:15:05 +0200 Subject: [PATCH] improved afk plugin removed wd plugin --- plugins/afk.lua | 23 ++++++++++++++++++----- plugins/wd.lua | 12 ------------ 2 files changed, 18 insertions(+), 17 deletions(-) delete mode 100644 plugins/wd.lua diff --git a/plugins/afk.lua b/plugins/afk.lua index 4951598..38f5536 100644 --- a/plugins/afk.lua +++ b/plugins/afk.lua @@ -1,12 +1,25 @@ function run(msg, matches) + text = matches[2] local user_name = get_name(msg) - return user_name .. ' ist nun AFK' + + if matches[1] == '/afk' and not text then + return user_name .. ' ist nun AFK' + end + + if matches[1] == '/afk' then + return user_name .. ' ist nun AFK (' .. text .. ')' + end + + if matches[1] == '/re' or '/wd' then + return user_name .. ' ist wieder da!' + end + end return { - description = "Sagt dass ihr afk seid", - usage = {"/afk"}, - patterns = {"^/afk(.*)$"}, - run = run + description = 'Sagt dass ihr afk oder wieder da seid', + usage = {'/afk','/re','/wd'}, + patterns = {'^/([A|a][F|f][K|k])$','^/([A|a][F|f][K|k]) (.*)$','^/([R|r][E|e])$','^/([W|w][D|d])$'}, + run = run } --by Akamaru [https://ponywave.de] \ No newline at end of file diff --git a/plugins/wd.lua b/plugins/wd.lua deleted file mode 100644 index c7a3335..0000000 --- a/plugins/wd.lua +++ /dev/null @@ -1,12 +0,0 @@ -function run(msg, matches) - local user_name = get_name(msg) - return user_name .. " ist wieder da" -end - -return { - description = "Sagt dass ihr wieder da seid", - usage = {"/wd"}, - patterns = {"^/[w|W][d|D]$"}, - run = run -} ---by Akamaru [https://ponywave.de] \ No newline at end of file