; M2(A).WAS - Logon to Noridian-M2 BBS ;*********************************************************************************** ;* M2(A).WAS Script for Institutional Providers to dial into Noridian-M2 BBS. * ;* Developed for Procomm Plus 4.8 or higher. (080202) * ;*********************************************************************************** #define SERVICE "NoridianM2.bbs" #define NET_PASS "" string szClaimFile ;variable to store claim file name string szFilePath ;variable to store path of file to transmit string szFileTransmit ;variable telling BBS which file to transmit. Format = "U [path/file]^M" integer CancelDial ;variable to cancel out of the script process following any prompt integer Choice = 0 proc main string szLoginID ;login variable string szPassword ;password variable szLoginID = "" ;NOTE: if a Login ID is entered within the quotes, the user will not be prompted to enter it prior to every connection szClaimFile = "BCTRANS.DAT" ;Institutional claim file szFilePath = "C:\WINPCACE" ;path of claim file while $TXCOUNT endwhile if $SCRIPTMODE != 5 set terminal type "ANSI-BBS" set port parity none set port databits 8 set port stopbits 1 set dialentry access DATA SERVICE CancelDial = 0 if success if nullstr szLoginID sdlginput "Login ID Entry" "Enter your Login ID:" szLoginID ;prompt for user BBS Login ID if success sdlginput "Password Entry" "Enter your password:" szPassword masked ;prompt for user BBS password if failure CancelDial = 1 endif else CancelDial = 1 endif endif if CancelDial < 1 if nullstr szPassword ;prompt user if they haven't yet been prompted for their password sdlginput "Password Entry" "Enter your password:" szPassword masked ;prompt for user BBS password if failure CancelDial = 1 endif endif endif if CancelDial < 1 Call FileExists ;error trap for existence of input path for the claim file if CancelDial < 1 ;continue if user hasn't cancelled out of prompt dial DATA SERVICE ;dial BBS endif endif else errormsg "A dialing directory entry for %s was not found. Create an\ entry for %s." SERVICE SERVICE endif endif if CancelDial < 1 ;continue if user hasn't cancelled out of prompt while $DIALING endwhile pause 1 if $CARRIER waitfor "Logon:" 15 ;wait for BBS screen to prompt for user ID transmit szLoginID ;tranmsit users BBS Login ID transmit "^M" waitfor "Password:" ;wait for BBS screen to prompt for user password transmit szPassword ;transmit users BBS password transmit "^M" waitfor "LO) Logoff" ;wait for BBS to display menu options transmit "1^M" ;transmit '1' to send file waitfor "rz waiting to receive." szFileTransmit = "U " strcat szFileTransmit szFilePath strcat szFileTransmit "^M" transmit szFileTransmit ;tell host that we're sending file sendfile ZMODEM szFilePath ;upload using ZMODEM protocol while $XFERSTATUS ;pause script while transferring yield ;yield processing endwhile waitfor "Press enter to continue" 1 ;wait for confirmation of receipt transmit "^M" waitfor "LO) Logoff" ;wait for BBS to display menu options transmit "LO^M" ;transmit 'LO' to logoff call Cleanup while $CARRIER ;loop while connected yield ;yield processing time endwhile sdlgmsgbox "Process Complete" "Process Complete - Connection Terminated" information OK Choice else errormsg "Sorry, connection not established." endif else errormsg "You have cancelled your attempt to establish a connection." endif endproc proc FileExists integer FileExistsTest ;variable to test for file existence string szusermsg FileExistsTest = 0 strcat szFilePath "\" ;create the path and name of the claim file strcat szFilePath szClaimFile ;(see previous comment) if isfile szFilePath ;check the default location (C:\WINPCACE) for the claim file to transmit FileExistsTest = 1 else while FileExistsTest < 1 ;if transmit file is not in default location, prompt user until a valid path and filename are provided szusermsg = "Enter " strcat szusermsg szClaimFile strcat szusermsg " path (i.e. 'C:\WINPCACE'):" sdlginput "Location of file to transmit" szusermsg szFilePath ;prompt user for location of claim file if SUCCESS ;user entered 'OK' at prompt strcat szFilePath "\" strcat szFilePath szClaimFile if isfile szFilePath ;verify path and filename exist FileExistsTest = 1 else errormsg "Path and/or file does not exist." endif else FileExistsTest = 2 ;user entered 'Cancel' at prompt CancelDial = 1 endif yield endwhile endif endproc proc Cleanup hangup ;hang up the phone line pause 2 ;pause to avoid hangup "noise" clear ;clear screen after hangup endproc