summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/003-3/malindou.txt5
-rw-r--r--npc/functions/util.txt6
2 files changed, 9 insertions, 2 deletions
diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt
index 28c7e3364..2d3f61006 100644
--- a/npc/003-3/malindou.txt
+++ b/npc/003-3/malindou.txt
@@ -655,6 +655,11 @@ OnInit:
//htput($@CONTRIBUTORS, "", 1);
end;
+OnClock0500:
+ // 23717 2020-12-
+ query_sql("DELETE FROM `chatlog` WHERE `time` < '"+sqldate(-7)+"'");
+ end;
+
// This is for HUB
OnSkillInvoke:
if (!playerattached())
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 721789f78..5afbdbce1 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -1144,9 +1144,11 @@ function script numdate {
return atoi(.@strdate$);
}
-// Same as numdate() but SQL format
+// Same as numdate() but SQL format.
+// sqldate({day variation})
function script sqldate {
- .@strdate$=sprintf("%04d-%02d-%02d %02d:%02d:%02d", gettime(GETTIME_YEAR), gettime(GETTIME_MONTH), gettime(GETTIME_DAYOFMONTH), gettime(GETTIME_HOUR), gettime(GETTIME_MINUTE), gettime(GETTIME_SECOND));
+ .@d=getarg(0, 0);
+ .@strdate$=sprintf("%04d-%02d-%02d %02d:%02d:%02d", gettime(GETTIME_YEAR), gettime(GETTIME_MONTH), gettime(GETTIME_DAYOFMONTH)+.@d, gettime(GETTIME_HOUR), gettime(GETTIME_MINUTE), gettime(GETTIME_SECOND));
return .@strdate$;
}