//大七 2016年6月23日23:17:23
unitQ_MRQD;interface
usesClasses, SysUtils, DateUtils;procedureMain(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);implementation
procedureMain(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);beginMain2(Npc,Player,Args);end;procedureMain2(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);constS=[[
%s %s %s %s %s %s %s \
你已经签到:{S=$d;C=249}天,距离下一次领奖还差{S=300;C=249}天
]];vardays:array[1..7] of string;
s1,s2:string;
Year, Month, Day, Hour:Word;
nField,nLine,n,m,Daynum{月天数},nWeek{星期几}: integer;
MyArray:Array [1..7,1..5]of string;beginDecodeDate(Now, Year, Month, Day);
nWeek :=DayOfWeek(StartOfTheMonth(Now));
Daynum :=DaysInAMonth(Year, Month);
s1 := Format(S,[‘星期日‘,‘星期一‘,‘星期二‘,‘星期三‘,‘星期四‘,‘星期五‘,‘星期六‘]);
n := 1;
m := 1;for nLine := 1 to 5 do
begin
for nField := 1 to 7 do
begin
if(n < nWeek)then
beginMyArray[nField,nLine] := ‘‘;end else if (nWeek + Daynum > n)then
beginMyArray[nField,nLine] :=inttostr(m);
m := m+1;end else beginMyArray[nField,nLine] := ‘‘;end;
n := n+1;end;end;
s2 :=s1;for nLine := 1 to 5 do
begin
for nField := 1 to 7 do
beginIF(MyArray[nField,nLine]=‘‘)THENbegins2 := ReplaceStr(S2, Format(‘$%d%d‘,[nField-1,nLine]),‘0‘) ; //填充作用
end else begins2 := ReplaceStr(S2, Format(‘$%d%d‘,[nField-1,nLine]),MyArray[nField,nLine]);end;end;end;
Npc.Say(Player, S2 );end;procedureQD(Npc: TNormNpc; Player: TPlayObject; Args: TArgs);beginDebug(Args.Str[0]);end;end.