;script to automatically dial a CAT controller and download memory blocks ;Version 1.05 ;Copyright 2000 Jim Hartzell WA3UQD, wa3uqd@nauticom.net ;updated for version 4.7 ;REQUIRES "CAT-1000" connection directory entry in data folder, ;to dial and activate the modem automatically, modem must answer automatically ;or the dialing string must activate the modem proc main string pwd = "password here" ;modem password string dlf = "rptrsav.00" ;root name of file to be saved string dlfc ;concatenation with blknum to get filespec integer startblk = 1 ;starting block number, range of 1 to 8 integer endblk = 8 ;ending block number, must be >= starblk integer blknum ;block number pointer string strblknum ;block number pointer as a string value to send if !$SCRIPTMODE dial DATA "CAT-1000" ;dial entry CAT-1000 while $DIALING ;wait for dialing and login to complete endwhile endif if $CARRIER ;check for connection and send transmit "^M" ;C/R to wake up the controller waitfor "Password: " ;wait for password prompt then transmit pwd ;send modem password and C/R transmit "^m" else ;Error out of script if connection cannot be verified errormsg "Sorry Connection Failed!" exit endif waitfor "->" ;wait for login complete for blknum = startblk upto endblk ;download block numbers between startblk and endblk strfmt strblknum "%d" blknum ;convert block number to a string transmit "xfer/d", ;send transfer command transmit strblknum ;add the block number to the command transmit "^m" ;execute the transfer command waitfor "now..." ;wait for the OK to proceed strcpy dlfc dlf ;init root file name strcat dlfc,strblknum ;add block number to complete the filespec pause 1 ;CAT needs time to think getfile xmodem dlfc ;xmodem download while $XFERSTATUS ;tight loop to wait for download to complete yield ;give CPU time to download process endwhile ;end of loop if blknum < endblk ;get more time if not last block transmit "extn^m" ;extend the modem timer waitfor "extended" pause 1 ;CAT needs time to think endif ;end of get more time sequence endfor ;end of do 8 blocks loop transmit "exit^m" ;logoff endproc ;end of script