home *** CD-ROM | disk | FTP | other *** search
- // ----------------------------------------------------------------------- //
- // **** Begin CircuitNET Mail Run Script Configuration **** //
- // ----------------------------------------------------------------------- //
- //
- // Enter your 6 digit Node ID between the quotes on the next line
-
- str nodeid[6] = "000000";
-
- // Enter the outgoing packet name between the quotes on the next line
-
- str buf[], ufilename[] = "C:\CIRCUIT\MAIL\000000.ZIP";
-
- // Enter the path of where to download the mail packet between the quotes
- // on the next line. Be sure to end with a backslash.
-
- str newdlpath[] = "C:\CIRCUIT\MAIL\";
-
- // Enter the 6 digits for your birthdate below. If the month or day is a single
- // digit, preceed it with a zero. DON'T enter any / or -, 6 digits only!
-
- str birthdate[6] = "000000";
-
- // Enter the baud to reset modem to after host hangup after the = mark
- // on the next line.
-
- int reset_baud = 00000;
-
- // If you wish to capture your mail run for debugging purposes enter the dirctory
- // and name of the capture file between the quotes on the next line.
-
- str capfilename[] = "C:\TELIX\CAMAIL.CAP";
-
- // Don't enter anything for this next one.
- str dfilename[];
- // This one holds the current download directory. Don't enter anything.
- str holddowndir[80];
-
- // Make sure to put your password in the Telix dialing directory
- // Now save this file and compile it using the CS.EXE utility that comes
- // with Telix. Type CS <script file name>.slt
- // ----------------------------------------------------------------------- //
- // **** End CircuitNET Mail Run Script Configuration **** //
- // ----------------------------------------------------------------------- //
-
- main()
- {
-
- holddowndir = _down_dir;
- _down_dir = newdlpath;
-
-
- strcat(dfilename, newdlpath); // Start with download directory
- strcat(dfilename, nodeid); // Add NodeId
- strcat(dfilename, ".ZIP"); // Add .ZIP file extention
-
- clear_scr();
-
- int cst;
- cst = capture_stat (); // check capture status
-
- if (cst == 1) // close capture if open
- {
- capture("*CLOSE*");
- }
- capture(capfilename);
-
- int stat, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12;
- int tmark = 0;
- t1 = track("continue? ", 1);
- t2 = track("?]? ", 1);
- t3 = track("[Y/n] ", 1);
- t4 = track("Menu? ", 1);
- t5 = track("[y/N]? ", 1);
- t6 = track("[MM-DD-YY]", 1); // watch for birthdate prompt
- t7 = track("irst name: ", 1); // first name prompt
- t8 = track("last name: ", 1); // last name prompt
- t9 = track(" password: ", 1); // password prompt
- t10 = track("<R>e-Enter ", 1); // whoops, entered name wrong, try again
- t11 = track("SELECTION ", 1); // SFMSGST no we don't want to scan
- t12 = track("ENTER COMMAND ", 1); // the good stuff, send/receive mail
- tmark = timer_start(1800); // wait up to 3 minute for upload prompt
-
- while (carrier())
- {
- terminal();
- stat = track_hit(0);
- if (stat == t1)
- cputs("^M");
- if (stat == t12)
- {
- cputs("A^M");
- ustamp( "** Sent A Command **", 1, 1 );
- Delay(10);
- receive('Z', dfilename);
- ustamp( "** Received Inbound Mail Packet **", 1, 1 );
- if(filefind(ufilename, 0, buf) !=0)
- {
- Terminal();
- ustamp( "** Found Outbound Mail Packet **", 1, 1 );
- While(carrier())
- {
- Terminal();
- ustamp( "** Waiting to send upload signal **", 1, 1 );
- timer_restart(tmark, 600); // wait up to 1 minute to send upload command
- stat = track_hit(0);
- if (stat == t12 or time_up(tmark))
- {
- delay(20);
- cputs("B^M");
- ustamp( "** Sent B Command **", 1, 1 );
- Delay(15);
- send('Z', ufilename);
- track_free(t3);
- track_free(t3);
- timer_free(tmark);
- timer_free(tmark);
- ustamp( "** Sent Outbound Mail Packet **", 1, 1 );
- Break;
- }
- }
- }
- else
- {
- status_wind("No Outgoing Mail packet!", 30);
- ustamp( "** No Outgoing Mail packet **", 1, 1 );
- }
- track_free(t3);
- timer_free(tmark);
- status_wind("Mailpack proceedures done. Logging off!", 20);
- delay(20);
- cputs("G^M");
- delay(10);
- cputs("Y^M");
- ustamp( "** Sent logoff commands **", 1, 1 );
- Break;
- }
- if (stat == t3)
- cputs("N^M");
- if (stat == t4)
- cputs("^M");
- if (stat == t5)
- cputs("N^M");
- if (stat == t6)
- {
- delay(5);
- cputs(birthdate); // tell them when we were born, no fibbing
- cputs("^M");
- }
- if (stat == t7)
- {
- cputs(nodeid); // send user name as node id
- cputs("^M");
- }
- if (stat == t8)
- cputs("^M");
- if (stat == t9)
- {
- cputs(_entry_pass);
- cputs("^M");
- }
- if (stat == t10)
- cputs("R^M");
- if (stat == t11)
- cputs("S^M");
- }
-
- track_free(0); // Clear all track channels
- terminal(); // Give terminal a time slice
- capture( "*CLOSE*" ); // Close our capture file
- _down_dir = holddowndir; // Put default down dir back
-
-
- off_line();
- }
- // ------------------------------------------------------------------------- //
-
- off_line()
- {
- status_wind("Waiting for 'NO CARRIER'...", 20);
-
- waitfor("NO CARRIER", 5);
- terminal();
- if (carrier()) hangup();
-
- delay(5);
-
- set_cparams(reset_baud, get_parity(), get_datab(), get_stopb());
-
- cputs_tr("AT^M"); // get modem attention
- waitfor("OK", 5);
- terminal();
- delay(5);
- terminal();
-
- cputs_tr("ATZ^M"); // reset modem to CMOS defaults
- waitfor("OK", 5);
- terminal();
- delay(5);
- terminal();
-
- cputs_tr("ATZ^M"); // Do it again -- in case RING came in...
- waitfor("OK", 5);
- terminal();
- delay(5);
-
- cputs_tr("ATH1^M"); // Go off-hook
- waitfor("OK", 3);
- terminal();
- delay(5);
-
- cputs_tr("ATH1^M"); // Again -- just in case a RING came in...
- waitfor("OK", 3);
- terminal();
- terminal();
-
- status_wind("Line should now be off-hook.", 10);
-
- ustamp( "*************************************************", 1, 1 );
- exittelix(0); // Unload Telix, return to batch w/Errorlevel=0
- }
-
-
- // ------------------------------------------------------------------------- //
-
-