Category : System Diagnostics for your computer
Archive   : ALERT10.ZIP
Filename : ALERT.C

 
Output of file : ALERT.C contained in archive : ALERT10.ZIP
#include
#include
#include
#include
#include
#include
#include "alert.h"



void main( int argc, char **argv )
{


time_t starting_time;

clock_t t_start,
t_end,
t_tot,
hrs,
min,
sec;

SoundFlag = ON;

if( argc > 1 )
if( *argv[1] == 's' )
SoundFlag = OFF;


t_start = clock() / CLK_TCK;
starting_time = time( NULL );

graphics_setup( SETUP_COLOR );

while( !( kbhit() && getch() == EXITVALUE ) ) // Press EXITVALUE (in alert.h file) to exit.
FlashCycle();

closegraph();

t_end = clock() / CLK_TCK;

t_tot = t_end- t_start;
hrs = t_tot / 3600;
t_tot = t_tot - ( hrs * 3600 );
min = t_tot / 60;
t_tot = t_tot - ( min * 60 );
sec = t_tot;

textcolor( LIGHTRED );
cprintf( "\nALERT has been active since " );
cprintf( ctime( &starting_time ) );

textcolor( LIGHTBLUE );
cprintf( " " );
cprintf( "ALERT has been running for " );

if( hrs )
if( hrs > 1 )
cprintf( "%ld hours, ", hrs );
else
cprintf( "%ld hour, ", hrs );

if( min )
if( min > 1 )
cprintf( "%ld minutes, ", min );
else
cprintf( "%ld minute, ", min );

if( sec )
if( sec > 1 )
cprintf( "%ld seconds.\n\n\n", sec );
else
cprintf( "%ld second.\n\n\n", sec );


}


/*************************************************************************/
/* GENERIC VGA GRAPHICS SETUP */
/*************************************************************************/

void graphics_setup( int background_color )
{
int grdriver = VGA,
grmode = VGAHI;

registerfarbgidriver( EGAVGA_driver_far );
registerfarbgifont( triplex_font_far );
initgraph( &grdriver, &grmode, "" );

if( graphresult() ) //Error in opening graphics mode..
{
closegraph();
exit ( GR_ERROR );
puts( "Error in opening graphics systems!" );
}

setbkcolor( background_color );
setcolor( PIXEL_COLOR );

return;

}

void write_text( int x_coord, int y_coord, int type_size, char* text )
{
settextstyle( TRIPLEX_FONT, HORIZ_DIR, type_size);
outtextxy( x_coord, y_coord, text );

return;
}

void FlashCycle()
{

static char *txt1,
*txt2;
int y_ht,
line1color,
count = -1;

randomize();

txt1 = Msg1;
txt2 = Msg2;

switch ( random ( RANDOM + 1 ) )
{
case 0:
setbkcolor( LIGHTBLUE );
line1color = YELLOW;
break;
case 1:
setbkcolor( WHITE );
line1color = DARKGRAY;
break;
case 2:
setbkcolor( LIGHTGREEN );
line1color = BLUE;
break;
default:
setbkcolor( YELLOW );
line1color = RED;
}

y_ht = random( MAXYHT );
WRITE_LINE1;

while( !kbhit() && ++count < MAXCYCLECOUNT )
{
delay( DELAY );
ERASE_LINE1;
WRITE_LINE2;

if( random( MAXCYCLECOUNT ) >= DIALPHONE && SoundFlag == ON )
if( !random( RANDOM ) )
warble();
else
dial();

delay( DELAY );
ERASE_LINE2;
WRITE_LINE1;
}
cleardevice();

return;
}


  3 Responses to “Category : System Diagnostics for your computer
Archive   : ALERT10.ZIP
Filename : ALERT.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/