home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / rhinodem.zip / rcdemo.dat / cpcugmix.rrx < prev    next >
Text File  |  1995-09-19  |  3KB  |  126 lines

  1. /* sample RhinoCom script that connects to the MIX */
  2. /* (Capital PC Users Group BBS) */
  3.  
  4. /*  
  5.  * Load all the system functions
  6.  *  ( we will use SysSleep )
  7.  */
  8.  
  9. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  10. call SysLoadFuncs
  11.  
  12. /*
  13.  *  create convenient symbols for carriage return and newline
  14.  */
  15.  
  16. CR = '0d'x
  17. NL = '0a'x
  18.  
  19. /*
  20.  *  Check the phone number field of the RhinoCom Notebook.
  21.  *  If the number has not been filled in, ask the user for one,
  22.  *  and place it in the field.
  23.  */
  24.  
  25. RQUERY 'phone-number'
  26. phone = rc
  27. if phone = '' then do
  28.   ENTRYFIELD '"Enter Phone Number" "CPCUG MIX"'
  29.   phone = rc
  30.   if phone = '' then signal error1
  31.   rset 'phone-number' phone
  32. end
  33.  
  34. /*
  35.  *  Do the same thing for the Username field.  This is a
  36.  *  little different because Username is a named macro.
  37.  *  Notice that we add a CR to the users response.
  38.  */
  39.  
  40. RQUERY '@username'
  41. username = rc
  42. if username = '' then do
  43.   ENTRYFIELD '"Enter Username" "CPCUG MIX"'
  44.   username = rc
  45.   if username = '' then signal error1
  46.   NMDefine "named M'username'"username
  47. end
  48.  
  49. /*
  50.  *  And again for the password.  Notice that the entryfield for
  51.  *  this one echoes *'s instead of the characters typed.
  52.  */
  53.  
  54. RQUERY 'password'
  55. password = rc
  56. if password = '' then do
  57.   ENTRYFIELD 'UNREADABLE "Enter Password" "CPCUG MIX"'
  58.   password = rc
  59.   if password = '' then signal error1
  60.   rset 'password' password
  61. end
  62.  
  63. /*
  64.  *  set up response strings
  65.  */
  66.  
  67. 'RESPONSE 1 MATCH /What is your first name?/ /EXEC username/'
  68. 'RESPONSE 2 MATCH /Password (Dots will echo)?/ /EXEC password/'
  69. 'RESPONSE 3 MATCH /More?/ /WRITE '||CR||'/'
  70. "RESPONSE 4 MATCH /Scan Message Base Since 'Last Read' (Enter)=yes?/ /WRITE y"||CR||'/'
  71. 'RESPONSE 5 MATCH /Press (Enter) to continue?/ /WRITE '||CR||'/'
  72. 'RESPONSE 6 MATCH /Do you want graphics (Enter)=no?/ /WRITE '||CR||'/'
  73. 'RESPONSE 7 MATCH /Main Board Command?/ //'
  74.  
  75. /*
  76.  *  dial the phone
  77.  */
  78.  
  79. DIAL
  80. call SysSleep 1
  81. rsay CR||NL||'Dialing . . .'||CR||NL||CR||NL
  82.  
  83. /*
  84.  *  as the response strings are activated, cancel them
  85.  *  checking for #7, which indicates we are done
  86.  */
  87.  
  88. TIMEOUT 1
  89. n = 0
  90. resp_num = 0
  91. do while n <= 60
  92.   n = n + 1
  93.   WAITANY
  94.   resp_num = rc
  95.   if ( resp_num > 0 ) & ( resp_num < 8 ) then do
  96.     RESPONSE resp_num CANCEL
  97.     n = n - 5
  98.   end
  99.   if resp_num = 7 then leave
  100. end
  101.  
  102. /*
  103.  *  make sure all the response strings get canceled
  104.  */
  105.  
  106. RESPONSE 1 CANCEL 
  107. RESPONSE 2 CANCEL
  108. RESPONSE 3 CANCEL
  109. RESPONSE 4 CANCEL
  110. RESPONSE 5 CANCEL
  111. RESPONSE 6 CANCEL
  112. RESPONSE 7 CANCEL
  113.  
  114. if resp_num \= 7 then do
  115.   rsay nl cr 'Timeout Error logging onto CPCUG MIX' nl cr
  116. end
  117. exit
  118.  
  119. /*
  120.  *  signal errors
  121.  */
  122.  
  123. error1:
  124. exit
  125.  
  126.