home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / comm / inpcp100.zip / IPCP.SLT < prev    next >
Text File  |  1992-01-30  |  2KB  |  93 lines

  1. // Copyright 1992, FutureSoft Technologies.
  2. // For use with InComm:PcPDial, release 1.0.0
  3. // Feel free to use and modify this script however you see fit.
  4.  
  5. main()
  6. {
  7.    int f;
  8.    int t;
  9.    int keypress;
  10.    str connectfile[80];
  11.    str dialername[13];
  12.    str cmdline[14];
  13.    str connected[61];
  14.    str name[31];
  15.    str script[13];
  16.    str date_str[21];
  17.    str time_str[21];
  18.  
  19.    // Open log file
  20.  
  21.    usagelog("PCP.LOG");
  22.  
  23.    // Main menu
  24.  
  25.    box(20,10,50,13,2,0,112);
  26.    cursor_onoff(0);
  27.    pstraxy("1) Manager",21,11,112);
  28.    pstraxy("2) Dialer",21,12,112);
  29.    pstraxy("3) Manager Auto",34,11,112);
  30.    pstraxy("4) Exit",34,12,112);
  31.  
  32.    // Get user's choice
  33.    keypress = inkeyw();
  34.    clear_scr();
  35.    cursor_onoff(1);
  36.  
  37.    // Manager
  38.    if (keypress == '1') {
  39.       run("manager","",0);
  40.    }
  41.  
  42.    // Dialer
  43.    else if ((keypress == '2') || (keypress == '3')) {
  44.  
  45. // Change next line to reflect your Dialers Path
  46. // Keep the "connect.ic" portion intact.
  47.  
  48.       fdelete("C:\InComm\dialers\connect.ic");
  49.  
  50. // Change next line to reflect your Dialers Path
  51. // Keep the "*.cmd" portion intact.
  52.  
  53.       show_directory("C:\Incomm\Dialers\*.cmd");
  54.       clear_scr();
  55.       box(30,11,65,13,2,0,112);
  56.       pstraxy("Enter command file : ",31,12,112);
  57.       getsxy(dialername,12,52,12,112);
  58.       copystr("@",cmdline,0,1);
  59.       strcat(cmdline,dialername);
  60.       clear_scr();
  61.       if (keypress == '2')
  62.          run("dialer",cmdline,0);
  63.       else
  64.          run("manager",cmdline,0);
  65.  
  66. // Change next line to reflect your Dialers Path
  67. // Keep the "connect.ic" portion intact.
  68.  
  69.       copystr("C:\InComm\dialers\connect.ic",connectfile,0,100);
  70.  
  71.       f = fopen(connectfile,"r");
  72.       if (f != 0) {
  73.          fgets(name,100,f);
  74.          fgets(script,100,f);
  75.          fclose(f);
  76.  
  77.          copystr("Connected to : ",connected,0,15);
  78.          strcat(connected,name);
  79.          status_wind(connected,30);
  80.  
  81.          t = curtime();
  82.          time(time_str,t);
  83.          date(date_str,t);
  84.          strcat(date_str," ");
  85.          ustamp(date_str,1,0);
  86.          ustamp(time_str,0,0);
  87.          ustamp(connected,0,1);
  88.  
  89.          call(script,connectfile);
  90.       }
  91.    }
  92. }
  93.