home *** CD-ROM | disk | FTP | other *** search
- {**********************************************************************
- * *
- * PROCOMM Script Generator v1.1 *
- * *
- * Kevin J. Gross PROCOMM v2.3 *
- * Software Technician PC-BOARD v11 *
- * Goshen College Turbo Pascal v3.0 *
- * July 13, 1986 MS-DOS 2.11 *
- * *
- * This program generates script command files to be used with *
- * the PROCOMM Communications Utility for automatic file transfers. *
- * This version is written to support the PC-Board BBS software *
- * since it seems to currently be the most used BBS software around *
- * here. Future versions may support TBBS or some other software. *
- * *
- * This program was written specifically for four BBS's I often *
- * work with. I tried to structure the code in such a way that *
- * it is easy to modify the generator for other PC-Board systems. *
- * The procedure GetBBSChoice contains the majority of BBS specific *
- * information such as the BBS name, dialing entry number and *
- * protocol. PCBoardMoreCheck does have a BBS specific IF-THEN *
- * clauses to provide for long BBS logon messages. *
- * *
- * When run this program asks the user which board they want a *
- * script for and then asks the user's name, password, and the names *
- * of the files to be downloaded or uploaded. If the user is *
- * uploading a file, they will also be prompted for a description. *
- * *
- * This generated script file will put the transferred files in the *
- * specified TransferDrive. The script file also generates a log *
- * file of the session in the TransferDrive. *
- * *
- * NOTE: The 300 second wait time for the %I command is usually *
- * sufficient for the BBS to time out and hangup on the auto xfer *
- * if something unexpected happens. Make sure this time is long *
- * enough for the BBS's you use or you may get your SYSOP up at *
- * 3:00am in the morning which could have unpredictable results. *
- * *
- * NOTE: This program can be used in conjunction with the TEF *
- * utility to download files unattended at early morning hours when *
- * phone rates are cheap and BBS's are less heavily used. Do not *
- * use this program or a modified version for unattended transfers *
- * unless you have supervised two successful transfers to verify its *
- * proper functioning with your BBS. Also, always read your log *
- * files to make sure nothing unexpected is happening even if things *
- * seem to have transferred okay. *
- * *
- * Enjoy, but use with care. *
- * *
- **********************************************************************}
-
- PROGRAM PROCOMM_SCRIPT (INPUT,OUTPUT,ScriptFile);
-
- CONST LogFileType = '.LOG'; { Logfile Extension }
- CommandFileType = '.CMD'; { Command File Ext. }
- TransferDrive = 'C:'; { RAMdisk }
- Emulation = '7'; { ANSI-BBS }
- SearchWait = 300; { So BBS Times Out }
- SkipWait = 20; { Wait w/o Timeout }
- Xmodem = 'X'; { Transfer Protocol }
- CRCXmodem = 'C';
- CRCYmodem = 'Y';
- MaxLen = 50; { Maximum String }
-
- TYPE Strings = STRING[MaxLen];
-
- VAR ScriptFile : TEXT;
- FirstName,
- LastName,
- Password,
- BBSName,
- BBSEntry,
- Protocol : Strings;
- BBS : INTEGER;
-
-
- {**********************************************************************
- * Header *
- **********************************************************************}
-
- PROCEDURE Header;
-
- BEGIN
-
- WRITELN;
- WRITELN;
- WRITELN(' PROCOMM Script File Generator v1.1');
- WRITELN;
- WRITELN(' for the Procomm Communications Utility v2.3');
- WRITELN(' and PCBoard v11.x');
- WRITELN;
- WRITELN(' Written by Kevin J. Gross');
- WRITELN;
- WRITELN
-
- END; { Header }
-
-
- {**********************************************************************
- * Get User Info *
- **********************************************************************}
-
- PROCEDURE GetUserInfo(VAR FirstName,
- LastName,
- Password : Strings);
-
- BEGIN
-
- WRITELN;
- WRITELN;
- WRITE('What is your first name? ');
- READ(FirstName);
-
- WRITELN;
- WRITE('What is your last name? ');
- READ(LastName);
-
- WRITELN;
- WRITE('What is your password? ');
- READ(Password)
-
- END; { GetUserInfo }
-
-
- {**********************************************************************
- * Get BBS Choice *
- **********************************************************************}
-
- PROCEDURE GetBBSChoice(VAR BBS : INTEGER;
- VAR BBSName,
- BBSEntry,
- Protocol : Strings);
-
- VAR Again : BOOLEAN;
-
- BEGIN
-
- WRITELN;
- WRITELN('1 : River City Network BBS (South Bend)');
- WRITELN('2 : 1149 BBS (Elkhart)');
- WRITELN('3 : PC-Link Central BBS (Bloomington)');
- WRITELN('4 : Last Chance BBS (Portage)');
-
- REPEAT
- Again := False;
-
- WRITELN;
- WRITE('Which BBS do you want a script for? ');
- READ(BBS);
-
- CASE BBS OF
-
- 1 : BEGIN
- BBSName := 'RCN'; { BBS Abbrev. for Filename }
- BBSEntry := '#36'; { Procomm Dialing Entry }
- Protocol := CRCXmodem { Transfer Protocol }
- END;
-
- 2 : BEGIN
- BBSName := '1149';
- BBSEntry := '1';
- Protocol := CRCYmodem
- END;
-
- 3 : BEGIN
- BBSName := 'PC-LINK';
- BBSEntry := '#34';
- Protocol := CRCXmodem
- END;
-
- 4 : BEGIN
- BBSName := 'LAST';
- BBSEntry := '#30';
- Protocol := CRCXmodem
- END
-
- ELSE Again := TRUE
-
- END; { CASE }
-
- UNTIL NOT Again
-
- END; { GetBBSChoice }
-
-
- {**********************************************************************
- * PC Board Setup *
- **********************************************************************}
-
- PROCEDURE PCBoardSetup(BBSName,
- Emulation,
- EntryNumber : Strings;
- VAR ScriptFile : TEXT);
-
- BEGIN
-
- WRITELN(ScriptFile,'%B"',TransferDrive,'"');
- WRITELN(ScriptFile,'%LO"',BBSName,LogFileType,'"');
- WRITELN(ScriptFile,'%P"',SearchWait,'"');
- WRITELN(ScriptFile,'%E',Emulation);
- WRITELN(ScriptFile,'%C"',EntryNumber,'"')
-
- END; { PCBoardSetup }
-
-
- {**********************************************************************
- * PC Board More Check *
- **********************************************************************}
-
- PROCEDURE PCBoardMoreCheck(BBSName : Strings;
- VAR ScriptFile : TEXT);
-
- BEGIN
-
- IF (BBSName = '1149') OR
- (BBSName = 'LAST')
- THEN
- BEGIN
- WRITELN(ScriptFile,'%P"',SkipWait,'"');
- WRITELN(ScriptFile,'%I"More:"');
- WRITELN(ScriptFile,'%T"N!"')
- END { THEN }
-
- END; { PCBoardMoreCheck }
-
-
- {**********************************************************************
- * PC Board Log On *
- **********************************************************************}
-
- PROCEDURE PCBoardLogon(FirstName,
- LastName,
- Password,
- BBSName : Strings;
- VAR ScriptFile : TEXT);
-
- BEGIN
-
- WRITELN(ScriptFile,'%I"Want graphics"');
- WRITELN(ScriptFile,'%T"N Q!"');
- WRITELN(ScriptFile,'%I"your first name?"');
- WRITELN(ScriptFile,'%T"',FirstName,'!"');
- WRITELN(ScriptFile,'%I"your last name?"');
- WRITELN(ScriptFile,'%T"',LastName,'!"');
- WRITELN(ScriptFile,'%I"Password"');
- WRITELN(ScriptFile,'%T"',Password,'!"');
-
- PCBoardMoreCheck(BBSName,ScriptFile);
-
- WRITELN(ScriptFile,'%I"Check your mail"');
- WRITELN(ScriptFile,'%T"!"');
-
- WRITELN(ScriptFile,'%I"[C/R] to continue?"');
- WRITELN(ScriptFile,'%T"!"');
- WRITELN(ScriptFile,'%P"',SearchWait,'"');
- WRITELN(ScriptFile,'')
-
- END; { PCBoardLogOn }
-
-
- {**********************************************************************
- * PC Board Download *
- **********************************************************************}
-
- PROCEDURE PCBoardDownLoad(Filename,
- Protocol : Strings;
- VAR ScriptFile : TEXT);
-
- VAR ProcommProtocol : Strings;
-
- BEGIN
-
- IF Protocol = CRCXmodem
- THEN
- ProcommProtocol := Xmodem
- ELSE
- ProcommProtocol := Protocol;
-
- WRITELN(ScriptFile,'%I"Main Board Command?"');
- WRITELN(ScriptFile,'%T"D;',Filename,';',Protocol,'!"');
- WRITELN(ScriptFile,'%I"Ready to send"');
- WRITELN(ScriptFile,'%W"2"');
- WRITELN(ScriptFile,'%XD',ProcommProtocol,'"',Filename,'"');
- WRITELN(ScriptFile,'')
-
- END; { PCBoardDownLoad }
-
-
- {**********************************************************************
- * PC Board Upload *
- **********************************************************************}
-
- PROCEDURE PCBoardUpLoad(Filename,
- Protocol : Strings;
- VAR ScriptFile : TEXT);
-
- VAR Description,
- ProcommProtocol : Strings;
-
- BEGIN
-
- REPEAT
-
- WRITELN;
- WRITELN;
- WRITELN(' ',
- '[----------------------------------------------]');
- WRITE('Description of file? ');
- READ(Description)
- UNTIL Description <> '';
-
- IF Protocol = CRCXmodem
- THEN
- ProcommProtocol := Xmodem
- ELSE
- ProcommProtocol := Protocol;
-
- WRITELN(ScriptFile,'%I"Main Board Command?"');
- WRITELN(ScriptFile,'%T"U;',Filename,';',Protocol,'!"');
- WRITELN(ScriptFile,'%I"Ready to receive"');
- WRITELN(ScriptFile,'%W"2"');
- WRITELN(ScriptFile,'%XU',ProcommProtocol,'"',Filename,'"');
- WRITELN(ScriptFile,'%I"Enter a description"');
- WRITELN(ScriptFile,'%W"1"');
- WRITELN(ScriptFile,'%T"',Description,'!"');
- WRITELN(ScriptFile,'');
-
- END; { PCBoardUpload }
-
-
- {**********************************************************************
- * PC Board File Transfer *
- **********************************************************************}
-
- PROCEDURE PCBoardFileTransfer(Protocol : Strings;
- VAR ScriptFile : TEXT);
-
- VAR Choice : CHAR;
- Filename : Strings;
-
- BEGIN
-
- WRITELN;
- WRITELN;
- WRITE('Filename to transfer(Return to stop)? ');
- READ(Filename);
-
- WHILE Filename <> '' DO
- BEGIN
-
- WRITELN;
- WRITE('Do you wish to (U)pload or (D)ownload<D>? ');
- READ(Choice);
-
- IF (Choice = 'U') OR (Choice = 'u')
- THEN
- PCBoardUpload(Filename,Protocol,ScriptFile)
- ELSE
- PCBoardDownload(Filename,Protocol,ScriptFile);
-
- WRITELN;
- WRITELN;
- WRITE('Filename to transfer(Return to stop)? ');
- READ(Filename)
-
- END { While }
-
- END; { FileTransfer }
-
-
- {**********************************************************************
- * PC Board Log Off *
- **********************************************************************}
-
- PROCEDURE PCBoardLogOff(VAR ScriptFile : TEXT);
-
- BEGIN
-
- WRITELN(ScriptFile,'%I"Main Board Command?"');
- WRITELN(ScriptFile,'%T"G!"');
- WRITELN(ScriptFile,'%W"5"');
- WRITELN(ScriptFile,'');
-
- WRITELN(ScriptFile,'%LC');
- WRITELN(ScriptFile,'%Q')
-
- END; { PCBoardLogOff }
-
-
- {**********************************************************************
- * PC Board *
- **********************************************************************}
-
- PROCEDURE PCBoard(FirstName,
- LastName,
- Password,
- BBSName,
- Protocol,
- EntryNumber : Strings;
- VAR ScriptFile : TEXT);
-
- BEGIN
-
- PCBoardSetup(BBSName,Emulation,EntryNumber,ScriptFile);
-
- PCBoardLogon(FirstName,LastName,Password,BBSName,ScriptFile);
-
- PCBoardFileTransfer(Protocol,ScriptFile);
-
- PCBoardLogoff(ScriptFile)
-
- END; { PCBoard }
-
-
- {**********************************************************************
- * Main Control Procedure *
- **********************************************************************}
-
- BEGIN
-
- ClrScr;
-
- Header;
-
- GetBBSChoice(BBS, BBSName, BBSEntry, Protocol);
-
- GetUserInfo(FirstName, LastName, Password);
-
- ASSIGN(ScriptFile, BBSName + CommandFileType);
- REWRITE(ScriptFile);
-
- PCBoard(FirstName,
- LastName,
- Password,
- BBSName,
- Protocol,
- BBSEntry,
- ScriptFile);
-
- CLOSE(ScriptFile)
-
- END.