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

  1. /* sample RhinoCom script that connects to the OS/2 Shareware BBS */
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6. CR = '0d'x
  7. NL = '0a'x
  8. ESC = '1b'x
  9.  
  10. /*
  11.  *  Check the phone number field of the RhinoCom Notebook.
  12.  *  If the number has not been filled in, ask the user for one,
  13.  *  and place it in the field.
  14.  */
  15.  
  16. RQUERY 'phone-number'
  17. phone = rc
  18. if phone = '' then do
  19.   ENTRYFIELD '"Enter Phone Number" "OS/2 Shareware BBS"'
  20.   phone = rc
  21.   if phone = '' then signal error1
  22.   rset 'phone-number' phone
  23. end
  24.  
  25. /*
  26.  *  Do the same thing for the Username field.  This is a
  27.  *  little different because Username is a named macro.
  28.  *  Notice that we add a CR to the users response.
  29.  */
  30.  
  31. RQUERY '@username'
  32. username = rc
  33. if username = '' then do
  34.   ENTRYFIELD '"Enter Username" "OS/2 Shareware BBS"'
  35.   username = rc
  36.   if username = '' then signal error1
  37.   NMDefine "named M'username'"username
  38. end
  39.  
  40. /*
  41.  *  And again for the password.  Notice that the entryfield for
  42.  *  this one echoes *'s instead of the characters typed.
  43.  */
  44.  
  45. RQUERY 'password'
  46. password = rc
  47. if password = '' then do
  48.   ENTRYFIELD 'UNREADABLE "Enter Password" "OS/2 Shareware BBS"'
  49.   password = rc
  50.   if password = '' then signal error1
  51.   rset 'password' password
  52. end
  53.  
  54. /*
  55.  *  set up response strings
  56.  */
  57.  
  58. 'RESPONSE 1 MATCH /What is your name:/ /EXEC username/'
  59. 'RESPONSE 2 MATCH /[Y,n]?/ /WRITE '||CR||'/'
  60. 'RESPONSE 3 MATCH /Password:/ /EXEC password/'
  61. 'RESPONSE 4 MATCH /Press ENTER to continue/ /WRITE '||CR||'/'
  62. 'RESPONSE 5 MATCH /More [Y,n,=]?/ /WRITE '||CR||'/'
  63. 'RESPONSE 6 MATCH /Do you wish to check for mail? [Y,n]/ /WRITE n/'
  64. 'RESPONSE 7 MATCH /Do you wish to check for new files? [Y,n]/ /WRITE n/'
  65. 'RESPONSE 8 MATCH /MAIN:/ //'
  66.  
  67. DIAL
  68. call SysSleep 1
  69. rsay CR||NL||'Dialing . . .'||CR||NL||CR||NL
  70.  
  71. /*
  72.  *  as the response strings are activated, cancel them
  73.  *  check for #8, which indicates we are done
  74.  */
  75.  
  76. TIMEOUT 1
  77. n = 0
  78. resp_num = 0
  79. do while n <= 60
  80.   n = n + 1
  81.   WAITANY 1 2 3 4 5 6 7 8
  82.   resp_num = rc
  83.   if ( resp_num > 0 ) & ( resp_num < 9 ) then do
  84.     RESPONSE resp_num CANCEL
  85.     n = n - 2
  86.   end
  87.   if resp_num = 8 then leave
  88. end
  89.  
  90. /*
  91.  *  make sure all the response strings get canceled
  92.  */
  93.  
  94.  
  95. RESPONSE 1 CANCEL 
  96. RESPONSE 2 CANCEL
  97. RESPONSE 3 CANCEL
  98. RESPONSE 4 CANCEL
  99. RESPONSE 5 CANCEL
  100. RESPONSE 6 CANCEL
  101. RESPONSE 7 CANCEL
  102. RESPONSE 8 CANCEL
  103.  
  104. exit
  105.  
  106. /*
  107.  *  signal error
  108.  */
  109.  
  110. error1:
  111. exit
  112.