home *** CD-ROM | disk | FTP | other *** search
-
- // This script is to be called by an auto-logon script
- // for the purpose of allowing automatic Puma and DSZ Zmodem
- // downloads.
-
- main ()
- {
- str puma_start[] = "^022Puma^022"; // Puma auto-packet
- str dsz_start[] = "**^024"; // Zmodem auto-packet
- str cmd_line[50]; // Holds the command line
- str port[1], speed[5], e_speed[5]; // Dummy variables
- int p, d, c; // More dummy variables
-
- if (_zmod_auto) // It don't work if Telix beats us to the punch!
- {
- status_wind ("Automatic Zmodem downloads must be deactivated!", 20);
- status_wind ("Script aborting...", 20);
- return;
- }
-
- p = track (puma_start, 0); // Keep our eyes open for Puma...
- d = track (dsz_start, 0); // Ditto for Zmodem...
-
- check:
- terminal (); // So the user can still use Telix...
- if (track_hit (p)) // We've got Puma!
- goto puma;
- if (track_hit (d)) // We've got Zmodem!
- goto dsz;
- goto check;
-
- dsz:
- itos (get_port (), port); // Build up the command line...
- cmd_line = "port ";
- strcat (cmd_line, port);
- strcat (cmd_line, " speed ");
- itos (get_baud (), speed);
- strcat (cmd_line, speed);
- strcat (cmd_line, " rz -mrr");
- newdir (_down_dir); // So DSZ dumps the file in the right place
- c = run ("c:\joshua\telix\dsz ", cmd_line, 0);
- if (!c)
- {
- d = track (dsz_start, 0); // Set the trap again...
- goto check;
- }
- else
- {
- if (c == -1) // The script couldn't load DSZ.COM
- {
- status_wind ("Error loading DSZ! Script aborting...", 20);
- return;
- }
- else // DSZ had an error
- {
- status_wind ("Error in Zmodem download!", 20);
- d = track (dsz_start, 0);
- goto check;
- }
- }
-
- puma:
- itos (get_port (), port);
- cmd_line = "P";
- strcat (cmd_line, port);
- strcat (cmd_line, " S");
- itos (get_baud (), speed);
- strcat (cmd_line, speed);
- strcat (cmd_line, " E");
- e_speed = speed;
- if (speed == "19200") // HST connections...
- e_speed = "9600";
- if (_entry_enum == 1) // Abiogenetic...
- e_speed = "2400";
- strcat (cmd_line, e_speed);
- strcat (cmd_line, " r ");
- strcat (cmd_line, _down_dir);
- c = run ("c:\joshua\telix\puma ", cmd_line, 0);
- if (!c)
- {
- p = track (puma_start, 0); // Set the trap again
- goto check;
- }
- else
- {
- if (c == -1) // Script couldn't load PUMA.EXE
- {
- status_wind ("Error loading Puma! Script aborting...", 20);
- return;
- }
- if (c == 1)
- {
- status_wind ("Puma transfer aborted!", 20);
- p = track (puma_start, 0);
- goto check;
- }
- if (c == 2) // Session ended before transfer began
- // (Probably a bogus command line)
- {
- status_wind ("Local Puma error! Script aborting...", 20);
- return;
- }
- if (c == 3) // Somebody tried to hack Puma
- {
- status_wind ("Invalid Puma registration! Script aborting...", 20);
- return;
- }
- else // We sent no command line...
- {
- status_wind ("Script fuckup...", 20);
- return;
- }
- }
- }