home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / f / finet93a.zip / SCRIPTS.ZIP / FINET1.SLT next >
Text File  |  1993-01-01  |  4KB  |  132 lines

  1. //  this is provided by one of FINET's nodes
  2. //  REPLACE occurences of the word "node" with your node id.
  3.  
  4. // used by showname():
  5. //
  6. int       statline =  49;                     // Telix status line row
  7. int       statback =   4;                     // status line background color
  8. int       statfore =  14;                     // status line foreground color
  9.  
  10. str node_path[] = "C:\TRANSFER\NODE.RLY";
  11. str number_to_dial[] = "29";
  12. int times_to_dial = 5;
  13. str capfile[] = "ON";
  14. str cap_filename[] = "FINET.CAP";
  15. str usefile[] = "ON";
  16. str use_filename[] = "FINET.USE";
  17.  
  18. str       failed[] = "Logon failed.";
  19.  
  20. main()
  21. // make backup copy of mail upload packet, "NODE.rly"
  22. dos("copy c:\transfer\NODE.rly d:\pcrelay\fibak\rly.sav",0);
  23.         dial_hub();
  24.         logon();
  25.         backup();
  26.  
  27. dial_hub()
  28. {
  29.         if (capfile=="ON") capture(cap_filename);
  30.         if (usefile=="ON") usagelog(use_filename);
  31.         dial(number_to_dial,times_to_dial,1);
  32.         if (carrier())
  33.                 {
  34.                 return;
  35.                 }
  36.         else
  37.                 {
  38.                 status_wind("Unable to connect",50);
  39.                 hangup();
  40.                 exittelix();
  41.                 }
  42. }
  43. //  main routine
  44. //
  45.  
  46. logon()
  47.  
  48. {
  49.   alarm(1);
  50.   showname();
  51.  
  52.   if (! waitfor("RST name?", 60))
  53.   {
  54.     prints(failed);
  55.     return;
  56.   }
  57.   delay(2);
  58.   cputs("fname;lname;password;!;D;FIHUB;/G^M");
  59.  
  60.   if (! waitfor("fe64", 60))
  61.   {
  62.     prints(failed);
  63.     return;
  64.   }
  65.     delay(2);
  66.     status_wind("Sending Packet",10);
  67.     send('Z',node_path);
  68.  
  69.   if (! waitfor("**", 800))
  70.   {
  71.     prints(failed);
  72.     return;
  73.   }
  74.     delay(2);
  75.     status_wind("Receiving Packet",10);
  76.     receive('Z',"");
  77.     return;
  78. }
  79.  
  80. backup()
  81. {
  82.  
  83. //        make backup of old in.rly packet, if exists
  84. // we assume that dsz is used and overwrite is enable of new file over
  85. // old file in.rly.
  86.       status_wind("making backup of in.rly packets",20);
  87.       dos("if exist d:\pcrelay\fibak\in.2 copy d:\pcrelay\fibak\in.2 d:\pcrelay\fibak\in.3",0);
  88.       dos("if exist d:\pcrelay\fibak\in.2 del d:\pcrelay\fibak\in.2",0);
  89.       dos("if exist d:\pcrelay\fibak\in.1 ren d:\pcrelay\fibak\in.1 d:\pcrelay\fibak\in.2",0);
  90. //        make backup of present in.rly packet
  91.       dos("copy c:\transfer\in.rly d:\pcrelay\fibak\in.1",0);
  92.       hangup();
  93.       exittelix();
  94.       return;
  95. }
  96.  
  97. //  Function:     showname
  98. //  Description:  Displays the name of the system you're connected to, or
  99. //                "Alt-Z for Help" if you're not connected to anything.
  100. //
  101. //                You can plug this into ANY logon script file, just call it
  102. //                as shown in main().
  103. //
  104. //                This routine will overwrite the "Alt-Z for Help" message,
  105. //                but I think it's worth it.  If you don't like this feature,
  106. //                set the Anonymous option in SLCONFIG to 'y' (YES).
  107. //  Parameters:   none
  108. //  Returns:      nothing
  109. //
  110. showname()
  111. {
  112.   str       name[14];                         // name to display
  113.   int       x, y;                             // old cursor position
  114.  
  115.   x = getx();                                 // save current position
  116.   y = gety();                                 //
  117.  
  118.   substr(_entry_name, 0, 14, name);           // get the current BBS name
  119.   if ((strlen(name) == 0) || (! carrier()))   // no name or not connected?
  120.     name = "Alt-Z for Help";                  //   then display help message
  121.  
  122.   strcat(name, "              ");             // pad name with spaces
  123.  
  124.   pstraxy( name, 1, statline,                 // display it
  125.            (statback * 16) + statfore
  126.          );
  127.  
  128.   gotoxy(x, y);                               // return to saved position
  129. }
  130.