prontera.gat,152,192,4 script カレンダー 857,{ if(gettime(7) != 'start_year || gettime(6) != 'start_month) { //年月が違ったら初期設定 set 'start_year,gettime(7); //開始年 set 'start_month,gettime(6); //開始月 set '@start_week,gettime(4); //開始曜日 setarray 'max_day[1],31,28,31,30,31,30,31,31,30,31,30,31; //月毎日数 if((gettime(7)%4 == 0 && gettime(7)%100) || gettime(7)%400 == 0) //うるう年算出 set 'max_day[2],29; } set '@start_week,gettime(4); for(set '@c,gettime(5)%7; '@c > 0 ; set '@c,'@c-1) { //開始曜日算出 set '@start_week,'@start_week-1; if('@start_week < 0) set '@start_week,6; } if('@c == 0) set '@start_week,'@start_week+1; while(1) { mes "    <<"+('start_year+'@next_year)+"年" +('start_month+'@next_month)+ "月>>"; mes " ^FF0000日^000000 月 火 水 木 金 ^0000FF土^000000 "; for(set '@i,0; '@i < '@start_week; set '@i,'@i+1) //開始日まで空白 set '@str$,'@str$+"   "; set '@week,'@start_week; for(set '@day,1; '@day <= 'max_day['start_month+'@next_month]; set '@day,'@day+1) { if('@week == 0) //日曜日は赤 set '@str$,'@str$+"^FF0000"+(gettime(5)=='@day? "[": " ")+('@day<10? "0": "")+'@day+(gettime(5)=='@day? "]": " ")+"^000000"; else if('@week == 6) //土曜日は青 set '@str$,'@str$+"^0000FF"+(gettime(5)=='@day? "[": " ")+('@day<10? "0": "")+'@day+(gettime(5)=='@day? "]": " ")+"^000000"; else set '@str$,'@str$+(gettime(5)=='@day? "[": " ")+('@day<10? "0": "")+'@day+(gettime(5)=='@day? "]": " "); set '@week,'@week+1; if('@week == 7) { mes '@str$; set '@str$,""; set '@week,0; } } mes '@str$; close; //以下未実装 set '@str$,""; next; if('@next_month) set '@menu$,"前の月"; else set '@menu$,""; switch(select("次の月",'@menu$,"やめる")) { case 1: set '@start_week,'@week; //前の算出結果を再利用 set '@next_month,'@next_month+1; if(('start_month+'@next_month)%13 == 0) set '@next_year,'@next_year+1; break; case 2: case 3: close; } } }