home *** CD-ROM | disk | FTP | other *** search
- /* REXX
- ******
- ** DO NOT Remove this HEADER or script will not work *******
- **
- ** Look at the REXX Help files included with ZOC for more information on
- ** the REXX Scripting Language and Functions.
- **
- ** This script is designed to allow Synchronet BBS Software to
- ** Automatically make a QWK Call with Telnet using the Terminal Program
- ** ZOC v3.13. It should work when calling any version of Synchronet,
- ** however I have not tested this with older versions of ZOC.
- **
- ** ** NOTE: Some changes *may* be necessary to work with your system.
- ** Especially if the BBS has modified the [Pause] prompt or
- ** the QWK: Menu Prompt. Look over it, this version works with
- ** Unmodified Synchronet v2.x and v3. It's pretty intuitive as to
- ** what the script is doing.
- **
- ** ** This is the first version of this script. It may not be perfect,
- ** so you can find a newer version at the below, or just edit the dam
- ** thing yourself! :=)
- **
- ** This script will probably work with other BBS Software with only a few
- ** modifications.
- **
- ** This script is designed to work with a Terminal Program called ZOC which
- ** is available for Win95/98/NT and OS/2.
- **
- ** You can obtain ZOC at any of the below addresses.
- **
- ** To contact me or find a new version :
- **
- ** telnet://wasteland.darktech.org
- ** telnet://wasteland.detour.net
- **
- ** http://wasteland.darktech.org
- **
- ** http://www.emtec.com/
- **
- ** Email: pg@wasteland.darktech.org
- */
-
- /* TRACE A */ /* Turn on (Uncomment) to Debug Script */
-
- number= "vert.sync3.net" /* Change to your HUBS address */
- name= "QWKID" /* Change to your BBS QWK ID */
- pwd= "QWKPW" /* Your QWK ID Accounts PW on HUB */
- repfile= "c:\sbbs\data\vert.rep" /* Path and Name of your REP File */
- dldir= "c:\sbbs\data" /* Path to your SBBS\DATA Dir */
-
- CALL ZocTimeout 60
-
- /******************************************/
- /* dial number and wait until we get in */
- /* retry until three times or success */
- /******************************************/
- done= "no"
- DO 3 UNTIL DONE="yes"
-
- CALL ZocCls
- CALL ZocSetDevice "TELNET"
- CALL ZocDial number
-
- timeout= ZocWait("[TELNET] CONNECT")
-
- /* if no timeout (ie. if connected) */
- IF timeout=0 THEN DO
-
- /* log in (send name/password) */
-
- /* Might need these lines if calling a HUB Using FrontDoor */
-
- /* CALL ZocWait "Press <ESC> twice to login"
- CALL ZocSend "^[^["
- */
-
- /* Might need to change these lines below if */
- /* your Hub has modified their Login Prompts */
-
- CALL ZocWait "NN: "
- CALL ZocSend name||"^M"
- CALL ZocWait "PW: "
- CALL ZocSend pwd||"^M"
-
-
- /* Might need to change pause prompts below */
- /* if your Hub has modified his Pause Prompt */
-
- /* Wait for the QWK Prompt */
- CALL ZocRespond "[Pause]", "^M"
-
- CALL ZocWait "QWK: "
-
- CALL ZocRespond "[Pause]"
-
- DONE= "yes"
- END
-
- END /* DO 3 */
-
- /******************************************/
- /* now that we're logged in, we check if */
- /* there is a file to upload (and do it) */
- /******************************************/
- QwkUpload:
- IF stream(repfile,"C","QUERY EXISTS")\="" THEN DO
-
- CALL ZocSend "U" /* choice 'U' in the QWK menu */
- CALL ZocWait "Protocol"
- CALL ZocSend "Z" /* Select Zmodem Protocol */
- CALL ZocWait "Hang"
- CALL ZocSend "N" /* Say NO to Hang-UP Question */
- /* upload it */
-
- status= ZocUpload("ZMODEM", repfile)
-
- /* if OK, delete it */
- IF status="##OK##" THEN DO
- CALL ZocShell "DEL "||repfile
- CALL ZocWriteLn "REXX : QWK Upload is Complete!"
- CALL ZocTimeout 20
- timeout= ZocWait("QWK:")
- IF timeout=0 THEN DO
- SIGNAL DownloadStart
- END
- END
- END
- ELSE DO
- CALL ZocWriteLn "REXX : No QWK REP File to be Uploaded!"
- SIGNAL DownloadStart
- END
-
- /******************************************/
- /* now see if there's a QWK packet for */
- /* us to download */
- /******************************************/
- DownloadStart:
-
- CALL ZocSend "D" /* choice 'D' from the QWK menu */
-
- CALL ZocTimeout 240
- result= ZocWaitMux("No new", "Filename", "Protocol")
- SELECT
- WHEN result=0 THEN SIGNAL NoDownload
- WHEN result=1 THEN SIGNAL QwkDownload
- WHEN result=2 THEN SIGNAL QwkDownload
- WHEN result=640 THEN SIGNAL MoreTime
- END
-
-
- NoDownload:
- CALL ZocWriteLn "REXX : No New Messages! - Exiting Script"
- CALL ZocTimeout 5
- SIGNAL Finish
-
-
- QwkDownload:
- CALL ZocSend "Z" /* Zmodem Protocol Selection */
- CALL ZocSend "N" /* Say No To hang up after question */
-
- result= ZocDownload("ZMODEM", dldir)
- IF result="##ERROR##" THEN DO
- CALL ZocBeep 2
- CALL ZocWriteLn "REXX : Error Downloading QWK File!"
- SIGNAL Finish
- END
- ELSE DO
- CALL ZocTimeout 20
- timeout= ZocWait("QWK: ")
- IF timeout=0 THEN DO
- CALL ZocWriteLn "REXX : QWK Download Completed"
- SIGNAL Finish
- END
- END
-
- MoreTime:
-
- CALL ZocWriteLn "REXX : I am Waiting Longer for QWK Packing to Complete!"
- CALL ZocTimeout 30
- timeout= ZocWait("Protocol")
- IF timeout=640 THEN DO
- SIGNAL ErrorPacking
- END
-
- ErrorPacking:
- CALL ZocBeep 2
- CALL ZocWriteLn "REXX : ERROR - QWK Packing Timed Out!"
- SIGNAL Finish
-
- /******************************************/
- /* OK, everything done. */
- /* Sign off */
- /******************************************/
- Finish:
- CALL ZocWriteLn "REXX : QWK Polling is Complete Exiting Script!"
-
- CALL ZocSend "Q" /* choice 'Q' in the QWK menu */
-
- CALL ZocTimeout 20
- timeout= ZocWait("[TELNET]")
- IF timeout=0 THEN DO
- CALL ZocHangup
- CALL ZocEndZoc
- EXIT
- END
- ELSE DO
- CALL ZocWriteLn "REXX : QWK Polling is Complete Exiting Script! (No DISCONNECT Info Received)"
- CALL ZocHangup
- CALL ZocEndZoc
- EXIT
- END
-