home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / crs-rose.zip / CRS-ROSE.SLT next >
Text File  |  1993-02-09  |  6KB  |  179 lines

  1. // Telix script to log onto CRS and upload/download mail using
  2. // the Rosemail door.  Set download protocol to ZMODEM in
  3. // Rosemail door.  Substitute NAME, DIALING ENTRIES, PASSWORD and
  4. // location of .REP file.  Recompile with CS.EXE.
  5. //
  6. // Compliments of Robert Walker, February 10, 1993.  Updates to
  7. // follow along with HSLINK script.
  8. //
  9. // Function SHOWDAT() replaces "Press ALT-Z for Help" with date
  10. //
  11. str user_name[]   = "ROBERT WALKER";          // INSERT YOUR NAME
  12. str number_list[] = "7 8 9 10 11 12";         // INSERT DIALING DIRECTORY ENTRY NUMBERS
  13. str pass_word[]   = "12345678";               // INSERT YOUR PASSWORD
  14. str file_name[]   = "c:\olx\rep\crs.REP";     // INSERT COMPLETE PATH AND NAME
  15.                                               // OF YOUR CRS.REP FILE
  16. int       statline =  24;                     // Telix status line row
  17. int       statback =   3;                     // status line background color
  18. int       statfore =   0;                     // status line foreground color
  19.  
  20. main()
  21. {
  22.    int stat;
  23.    int t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11;
  24.    int tmark;
  25.    int half_sec;
  26.    int pop_time;
  27.  
  28.    clear_scr();
  29.  
  30.    showname();                                // REPLACES "PRESS ALT-Z FOR HELP"
  31.                                               // WITH DATE
  32.    capture("CRS.CAP");                        // OPEN A CAPTURE FILE
  33.    redial(number_list,0,1);                   // DIAL THE NUMBER(S)
  34.  
  35.    t1 = track("# to use", 0);
  36.    t2 = track(" graphics", 0);
  37.    t3 = track("first name?", 0);
  38.    t4 = track("Password",0);
  39.    t5 = track("(CR)more,(N)o More?", 0);
  40.    t6 = track("Scan Message Base", 0);
  41.    t7 = track("Main Board Command?", 0);
  42.    t9 = track("RoseMail Command", 0);
  43.    t10 = track("<NO TRANFER>", 0);
  44.    t11 = track("NO CARRIER", 0);
  45.  
  46.    pop_time=30;                               // POP-UP WINDOW DELAY TIME
  47.    half_sec=2;                                // GLOBAL SCRIPT DELAY IN 1/10ths
  48.                                               // OF A SECOND.  INCREASE IF YOU
  49.                                               // USE A HIGH-SPEED MODEM
  50.    tmark = timer_start(1800);
  51.  
  52.       while (1)
  53.       {
  54.          terminal();
  55.          stat = track_hit(0);
  56.  
  57.          if (stat == t1)                      // language to use
  58.          {
  59.             delay(half_sec);
  60.             cputc('1');
  61.             cputc('^M');
  62.             track_free(t1);
  63.          }
  64.          else if (stat == t2)                 // do you want graphics
  65.          {
  66.             delay(half_sec);
  67.             cputs("N Q");
  68.             cputc('^M');
  69.             track_free(t2);
  70.          }
  71.          else  if (stat == t3)                // what is your first name
  72.          {
  73.             delay(half_sec);
  74.             cputs(user_name);
  75.             cputc('^M');
  76.             track_free(t3);
  77.             track_free(t2);
  78.          }
  79.          else  if (stat == t4)                // what is your password
  80.          {
  81.             delay(half_sec);
  82.             cputs(pass_word);
  83.             cputc('^M');
  84.             track_free(t4);
  85.          }
  86.          else if (stat == t5)                 // more?
  87.          {
  88.             delay(half_sec);
  89.             cputs("n");
  90.             cputc('^M');
  91.          }
  92.          else if (stat == t6)                 // scan message base?
  93.          {
  94.             delay(half_sec);
  95.             cputs("n");
  96.             cputc('^M');
  97.             track_free(t6);
  98.          }
  99.          else if (stat == t7)                 // main board command
  100.          {
  101.             delay(half_sec);
  102.             cputs("ROSEMAIL");
  103.             cputc('^M');
  104.             track_free(t7);
  105.          }
  106.          else if (stat == t9)                 // RoseMail command?
  107.          {
  108.             track_free(t9);
  109.             delay(half_sec);
  110.             if (filefind(file_name, 0))       // is there a .REP in the upload dir
  111.             {
  112.                status_wind("REPLIES ", pop_time);
  113.                cputs("U");
  114.                cputc('^M');
  115.                delay_scr(half_sec);
  116.                send('Z',file_name);           // there is a .REP so send it
  117.                delay_scr(half_sec);
  118.                delay_scr(half_sec);
  119.                fdelete(file_name);            // delete the .REP file
  120.                delay(half_sec);
  121.                cputs("D Y G");                // let's download now
  122.                cputc('^M');
  123.                track_free(t9);
  124.             }
  125.             else
  126.             {
  127.                delay(half_sec);               // there was *NO* .REP file
  128.                cputs("D Y G");                // so let's just download
  129.                cputc('^M');
  130.                track_free(t9);
  131.             }
  132.          }
  133.          else if (stat == t10)                // no messages were found
  134.          {
  135.             status_wind("NO MESSAGES FOUND", pop_time);
  136.             cputs("g");
  137.             cputc('^M');
  138.             track_free(t10);
  139.          }
  140.          else if (stat == t11)                // no carrier
  141.          {
  142.             timer_free(tmark);
  143.             capture("*CLOSE*");
  144.             hangup();
  145.             exittelix(0,1);
  146.          }
  147.          else if (not carrier (1))
  148.          {
  149.             capture("*CLOSE*");
  150.             hangup();
  151.             exittelix(0,1);
  152.          }
  153.       }
  154.       timer_free(tmark);
  155.       track_free(0);
  156.       hangup();
  157.       exittelix(0,1);
  158.  
  159. }
  160.  
  161. showname()                                    // function to insert date
  162. {
  163.   str       s[15];
  164.   str       name[15];                         // name to display
  165.   int       x, y;                             // old cursor position
  166.   date(curtime(),s);                          //
  167.                                               //
  168.   x = getx();                                 // save current position
  169.   y = gety();                                 //
  170.                                               //
  171.   substr(_entry_name, 0, 14, name);           // get the current BBS name
  172.   if ((strlen(name) == 0) || (! carrier()))   // no name or not connected?
  173.   strcat(s, "    ");             // pad name with spaces
  174.   pstraxy("   ", 1, statline, (statback * 16) + statfore);
  175.   pstraxy(s, 4, statline, (statback * 16) + statfore);
  176.   gotoxy(x, y);                               // return to saved position
  177. }
  178.  
  179.