home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 January / CHIPCD1_98.iso / software / tipsy / zoc / install.fil / SCRIPT / RXSAMPLE / MANUAL / LOGIN2.ZRX < prev    next >
Text File  |  1996-09-16  |  2KB  |  69 lines

  1. /* A REXX sample to show how to log into a bbs and do 
  2.    work automatically */
  3.  
  4. CALL ZocTimeout 60   /* general time out */
  5.  
  6. /***** Wait for name prompt or bail out *****/
  7. timeout= ZocWait("Name?")
  8. IF timeout=0 THEN DO
  9.    /* received "Name?" */
  10.    CALL ZocSend "Zaphod^M"
  11. END
  12. ELSE DO
  13.    /* Ouch, "Name?" was not received */
  14.    CALL ZocWriteln "ERROR (Name)!!"
  15.    SIGNAL BailOut   /* this command jumps to the end */
  16. END
  17.  
  18. /***** Wait for password prompt or bail out *****/
  19. timeout= ZocWait("Password?")
  20. IF timeout=0 THEN DO
  21.    /* received "Password?" */
  22.    CALL ZocSend "HeartOfGold^M"
  23. END
  24. ELSE DO
  25.    /* Ouch, "Password?" was not received */
  26.    CALL ZocWriteln "ERROR (Password)!!"
  27.    CALL ZocHangup
  28.    SIGNAL BailOut
  29. END
  30.  
  31. /***** Skip host's intro screens             *****/
  32. /***** (and probably security feature)       *****/
  33.  
  34. CALL ZocReply "Press ENTER to continue", "^M" 
  35. CALL ZocReply "Enter your birthdate", "270466^M" 
  36.  
  37. CALL ZocWait "Main Menu"    /* we just assume that it will work */
  38.                             /* and don't check the timeout      */
  39.  
  40. CALL ZocReply "Press ENTER to continue"  /* cancel ZocReply commands */
  41. CALL ZocReply "Enter your birthdate"
  42.  
  43. /***** Wait for the prompt and go to the      *****/
  44. /***** mail area and download a mail packet   *****/
  45. /***** using the Zmodem protocol              *****/
  46.  
  47. CALL ZocWait "your choice>"
  48. CALL ZocSend "MAIL^M"
  49.  
  50. CALL ZocWait "your choice>"
  51. CALL ZocSend "RECEIVE^M"
  52.  
  53. CALL ZocWait "protocol>"
  54. CALL ZocSend "ZMODEM^M"
  55.  
  56. /* download into C:\MAIL directory */
  57. CALL ZocDownload "ZMODEM", "C:\MAIL"
  58.  
  59. /***** Go back to the main menu and log off   *****/
  60.  
  61. CALL ZocSend "QUIT^M"
  62.  
  63. CALL ZocWait "your choice>"
  64. CALL ZocSend "LOGOUT^M"
  65.  
  66. BailOut:  /* this is the target for the SIGNAL command */ 
  67. CALL ZocHangup
  68. EXIT
  69.