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

  1. // Copyright 1992, FutureSoft Technologies.
  2. // Feel free to use and modify this script however you see fit.
  3.  
  4. main()
  5. {
  6.    str disconnect_str[100];
  7.    int ch;
  8.    int f;
  9.    int idx;
  10.    str temp[100],stamp[100];
  11.    int t;
  12.    str date_str[20];
  13.    str time_str[20];
  14.  
  15.    cputs("@^M");
  16.    delay(20);
  17.    cputs("D^M");
  18.  
  19.    while ((ch=cgetct(40)) != -1) {
  20.       strcat(disconnect_str,ch);
  21.       printc(ch);
  22.    }
  23.  
  24.    if (strposi(disconnect_str,"DISCONNECT") != -1) {
  25.       t = curtime();
  26.       time(time_str,t);
  27.       date(date_str,t);
  28.       strcat(date_str," ");
  29.       ustamp(date_str,1,0);
  30.       ustamp(time_str,0,0);
  31.  
  32.       idx = strpos(disconnect_str,"D/");
  33.       if (idx != -1) {
  34.          substr(disconnect_str,idx,100,temp);
  35.          idx = strpos(temp,"@")-4;
  36.          substr(temp,0,idx,stamp);
  37.          ustamp(stamp,0,1);
  38.       }
  39.       else
  40.          ustamp("Corrupted Disconnect string from SprintNet",1,1);
  41.  
  42.       call("IPCP");
  43.    }
  44.    else {
  45.  
  46.       ustamp("Disconnect Unsuccessful",0,1);
  47.       status_wind("Unsuccessful Disconnect!",50);
  48.    }
  49. }
  50.