program SPbGUKiTshedule2; var Time, DayOfWeek, ostm, osts, osth,k,obedh,obedmin,vsegomin,percent,doperekuramin : integer; DateText, TimeText, DayText : string; Week : array [1..7] of string; begin setColor(0, 0, 0); fillRect(0, 0, getWidth, getHeight); repaint; setColor(255, 255, 255); DrawText('Электрорасписание',15,getheight/2-10); repaint; DrawText('звонков СПбГУКиТа',15,getheight/2+10); repaint; delay(800); setColor(200, 200, 200); DrawText('Электрорасписание',15,getheight/2-10); repaint; DrawText('звонков СПбГУКиТа',15,getheight/2+10); repaint; repaint; delay(200); setColor(0, 0, 0); fillRect(0, 0, getWidth, getHeight); repaint; delay(500); k:=0; repeat setColor(0, 0, 0); fillRect(0, 0, getWidth, getHeight); setFont(FONT_FACE_SYSTEM, FONT_STYLE_PLAIN, FONT_SIZE_SMALL); setColor(255, 255, 255); Time:=GetCurrentTime; DateText :='' + GetDay(Time); DateText :=DateText + '.' + (GetMonth(Time)+1); DateText :=DateText + '.' + GetYear(Time); TimeText := '' + GetHour(Time); TimeText := TimeText + ':'+ GetMinute(Time); TimeText := TimeText + ':' + GetSecond(Time); Week[1]:='Воскресенье'; Week[2]:='Понедельник'; Week[3]:='Вторник'; Week[4]:='Среда'; Week[5]:='Четверг'; Week[6]:='Пятница'; Week[7]:='Суббота'; DayOfWeek:=GetWeekDay(Time); DayText:='' + Week[DayOfWeek]; DrawText(DateText,2,2); setFont(FONT_FACE_SYSTEM, FONT_STYLE_BOLD, FONT_SIZE_LARGE); setcolor(55,100,100); DrawText(TimeText,40,15); setcolor(255,100,0); DrawText(TimeText,39,15); setFont(FONT_FACE_SYSTEM, FONT_STYLE_PLAIN, FONT_SIZE_SMALL); setColor(255, 255, 255); DrawText(DayText,117-5*length(Daytext),2); setDefaultFont; If gethour(time)=9 then ostm:=(59-getminute(time)+35) else if (gethour(time)=10) and (getminute(time)<35) then ostm:=34-getminute(time) else if (gethour(time)=10) and (getminute(time)>=45) then ostm:=79+(60-getminute(time)) else if (gethour(time)=11) then ostm:=(60-getminute(time)+19) else if (gethour(time)=12) and (getminute(time)<20) then ostm:=(19-getminute(time)) else if (gethour(time)=13) then ostm:=(34+(60-getminute(time))) else if (gethour(time)=14) and (getminute(time)<35) then ostm:=(34-getminute(time)) else if (gethour(time)=14) and (getminute(time)>=45) then ostm:=79+(60-getminute(time)) else if (gethour(time)=15) then ostm:=19+(60-getminute(time)) else if (gethour(time)=16) and (getminute(time)<20) then ostm:=(19-getminute(time)) else if (gethour(time)=16) and (getminute(time)>=30) then ostm:=64+(60-getminute(time)) else if (gethour(time)=17) then ostm:=4+(60-getminute(time)) else if (gethour(time)=18) and (getminute(time)<5) then ostm:=4-getminute(time) else if (gethour(time)=18) and (getminute(time)>=5) then ostm:=400 else if (gethour(time)<9) then ostm:=450 else ostm:=500; osts:=60-getsecond(time); setcolor(150,150,255); if (dayofweek=1) then DrawText('Выходной! Гыгы)',15,50) else if (getday(time)>8) and (getmonth(time)=0) then DrawText('Сессия((',15,50) else if (ostm=400) then DrawText('Давно пора домой!',5,50) else if (ostm=450) or (gethour(time)>=19) then begin DrawText('Какой нафиг универ! ',10,50); DrawText('Рано ещё!',30,65); end; else if (ostm=500) then begin setFont(FONT_FACE_SYSTEM, FONT_STYLE_BOLD, FONT_SIZE_LARGE); setcolor(255,50,50); DrawText('Перерыв!',25,50); setDefaultFont; end else begin osth:=0; if (ostm>60) then begin osth:=ostm div 60; ostm:=ostm mod 60; end; setcolor(255,255,0); if (osth<>0) then begin {osth:= ostm div 60;} DrawText('До конца пары: ',5,33); setcolor(255,150,0); DrawText('' + osth + ' ч ' + ostm + ' мин ' + osts + ' сек',25,47); end else if (ostm<>0) then begin DrawText('До конца пары: ',5,33); setcolor(255,150,0); DrawText('' + ostm + ' мин ' + osts + ' сек',25,47); end else begin DrawText('До конца пары: ',5,33); setcolor(255,150,0); DrawText('' + osts + ' сек',25,47); end; vsegomin:=95-(60*osth+ostm); percent:=100*vsegomin/95-1; setcolor(200,200,255); fillRoundRect(5, 65, 110, 15, 2, 2); setcolor(100,100,255); drawRoundRect(5, 65, 110, 15, 2, 2); setcolor(100,100,255); fillRoundRect(5, 65, (110*percent/100), 15, 2, 2); setcolor(0,0,0); DrawText('' + percent + ' % выполнено',18,67); setcolor(100,100,255); if (percent<47) then begin setFont(FONT_FACE_SYSTEM, FONT_STYLE_PLAIN, FONT_SIZE_SMALL); setcolor(100,100,255); doperekuramin:=osth*60+ostm-50; DrawText(''+doperekuramin+':'+osts,70,117); setcolor(80,80,255); setFont(FONT_FACE_SYSTEM, FONT_STYLE_PLAIN, FONT_SIZE_SMALL); setcolor(80,80,230); DrawText('До перекура:',5,117); setDefaultFont; end; end; setcolor(150,150,255); if (dayofweek<>1) and (getmonth(time)<>1) and (gethour(time)<18) then begin obedh:=12-gethour(time); obedmin:=19+(60*obedh-getminute(time)); obedh:=(obedmin div 60); obedmin:=obedmin mod 60; setcolor(255,255,0); if (gethour(time)<12) and (gethour(time)>8) then begin DrawText('До обеда:',5,85); setcolor(255,150,0); if (obedh<>0) then DrawText('' + obedh + ' ч ' + obedmin + ' мин ' + osts + ' сек',25,100) else DrawText('' + obedmin + ' мин ' + osts + ' сек',25,100); end else if (gethour(time)=12) and (getminute(time)<20) then begin setcolor(255,255,0); DrawText('До обеда: ',5,85); setcolor(255,150,0); DrawText('' + (19-getminute(time)) + ' мин ' + osts + ' сек',25,100); end; else if (gethour(time)=12) and (getminute(time)>=20) then begin setcolor(255,255,0); setFont(FONT_FACE_SYSTEM, FONT_STYLE_BOLD, FONT_SIZE_LARGE); DrawText('Обед!',30,85); setDefaultFont; setcolor(255,150,0); end; else if (gethour(time)>12) then begin setcolor(150,150,255); DrawText('Обед уже был. (((',5,85); end; end; Repaint; Delay(300); k:=k+1; until (GetKeyPressed = KE_KEY0); setFont(FONT_FACE_SYSTEM, FONT_STYLE_PLAIN, FONT_SIZE_SMALL); setColor(0, 0, 0); fillRect(0, 0, getWidth, getHeight); setColor(200, 200, 200); DrawText('(c)DimentSoft, 2007',15,getheight/2); repaint; delay(2000); end.