From 35fa5a5a6621f50b7b45dcc83d5e4d6cf93597ad Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 11 Feb 2011 20:15:00 +0100 Subject: Added the schedule_per_date() lua function. Reviewed-by: Ablu, Freeyorp. --- scripts/lua/libmana.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/lua/libmana.lua b/scripts/lua/libmana.lua index 787edfed..dc58751a 100644 --- a/scripts/lua/libmana.lua +++ b/scripts/lua/libmana.lua @@ -375,6 +375,17 @@ function schedule_every(seconds, funct) table.sort(scheduler_jobs, job_cmp) end +-- schedules a function call to be executed at a given date +function schedule_per_date(my_year, my_month, my_day, my_hour, my_minute, funct) + local job = {} + job[0] = os.time{year = my_year, month = my_month, day = my_day, + hour = my_hour, min = my_minute} + job[1] = funct + job[2] = nil + table.insert(scheduler_jobs, job) + table.sort(scheduler_jobs, job_cmp) +end + -- DEATH NOTIFICATIONS local ondeath_functs = {} -- cgit v1.2.3-70-g09d2