From 8eaa7c15f5a9da5c4d24efe151fb66bf9030b163 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Fri, 27 Nov 2015 22:11:13 +0100 Subject: [PATCH] Sleep gefixt --- plugins/sleep.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/sleep.lua b/plugins/sleep.lua index 37c04db..e900c46 100644 --- a/plugins/sleep.lua +++ b/plugins/sleep.lua @@ -1,15 +1,15 @@ require "socket" -local function sleep(sec) - socket.select(nil, nil, sec) +local function sleep(n) + os.execute("sleep " .. tonumber(n)) end local function run(msg, matches) print('Schlafe... ') --- Set delay in seconds (10 = 10 seconds) -local delay = 60 +-- Delay in seconds (10 = 10 seconds) +local delay = matches[1] sleep(delay) return 'Bin wieder da!' @@ -19,7 +19,8 @@ end return { description = "Setzt den Bot in schlaf", usage = {"/sleep"}, - patterns = {"^/[Ss][Ll][Ee][Ee][Pp]$"}, - run = run + patterns = {"^/[Ss][Ll][Ee][Ee][Pp] (.*)$"}, + run = run, + privileged = true } --by Akamaru [https://ponywave.de] \ No newline at end of file