home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 341.img / TCS161S.ZIP / WAITCALL.PAS < prev    next >
Pascal/Delphi Source File  |  1989-12-06  |  22KB  |  870 lines

  1. {$R-,S-,I-,D-,F+,V-,B-,N-,L+,O+ }
  2. {$M 65500,0,0 }
  3.  
  4. unit waitcall;
  5.  
  6. interface
  7.  
  8. uses dos,crt,qwik,
  9.      gentypes,statret,configrt,modem,gensubs,subs1,subs2,mailret,overlay,
  10.      overret1,mainr1,mainr2,mainmenu,getlogin,userret,protocol,Graph3;
  11.  
  12. function waitforacall:boolean;
  13.  
  14. implementation
  15.  
  16. function waitforacall:boolean;
  17.   const statwindx=2;
  18.         statwindy=1;
  19.     firstcolx=17;
  20.     firstline=1;
  21.     secondcolx=60;
  22.  
  23.  
  24.  
  25.   var wscount      :integer;
  26.       mustgetbaud  :boolean;
  27.       outf         :text;
  28.       nl           :netmailrec;
  29.       nla          :netlistrec;
  30.  
  31.     procedure col1;
  32.     begin
  33.       window (statwindx+firstcolx,statwindy+firstline,80,25);
  34.     end;
  35.  
  36.     procedure col2;
  37.     begin
  38.       window (statwindx+secondcolx,statwindy+firstline,80,25);
  39.     end;
  40.  
  41.    procedure seeknmfile (n:integer);
  42.    begin
  43.      seek (nmfile,n-1);
  44.    end;
  45.  
  46.    procedure seeknlifile (n:integer);
  47.    begin
  48.      seek (nlifile,n-1);
  49.    end;
  50.  
  51.       function numbbs:integer;
  52.    begin
  53.     numbbs:=filesize (nmfile);
  54.    end;
  55.  
  56.  
  57.    function numnetfiles:integer;
  58.    begin
  59.      numnetfiles:=filesize(nlifile)
  60.    end;
  61.  
  62. procedure delfile(laym:byte);
  63. var i    :integer;
  64.     n    :integer;
  65.     cnt  :integer;
  66.     c    :char;
  67.  
  68.  begin
  69.   n:=laym;
  70.   seeknlifile (n);
  71.   read (nlifile,nla);
  72.     for cnt:=n to numnetfiles-1 do
  73.      begin
  74.         seeknlifile (cnt+1);
  75.         read (nlifile,nla);
  76.         seeknlifile (cnt);
  77.         write (nlifile,nla)
  78.      end;
  79.    seeknlifile (numnetfiles);
  80.    truncate (nlifile);
  81.  end;
  82.  
  83.    procedure topwin;
  84.     begin;
  85.     window(3,7,79,14);
  86.     textcolor(statlinecolor);
  87.     end;
  88.  
  89.    procedure botwin;
  90.     begin;
  91.     window(3,18,79,22);
  92.     textcolor(splitcolor);
  93.     end;
  94.  
  95.  
  96.   procedure maybewritestatus;
  97.   begin
  98.     wscount:=wscount+1;
  99.     if wscount>800 then begin
  100.       writestatus;
  101.       wscount:=0
  102.     end
  103.   end;
  104.  
  105. (***
  106.  
  107.   function checkforhayesreport:boolean;  { Looks for CONNECT 300 }
  108.   var n:longint;
  109.       q:sstr;
  110.       p,b:integer;
  111.       k:char;
  112.       brate:baudratetype;
  113.   const lookfor:sstr=#13#10'CONNECT ';
  114.   begin
  115.     checkforhayesreport:=false;
  116.     if numchars=0 then exit;
  117.     p:=1;
  118.     q:='';
  119.     b:=0;
  120.     repeat
  121.       n:=now;
  122.       repeat until (now>n+1) or (numchars>0);
  123.       if numchars=0 then exit else k:=getchar;
  124.       if (k=#13) and (length(q)>0) then begin
  125.         val (q,b,p);
  126.         brate:=b110;
  127.         while (brate<=b19200) and
  128.               ((b<>baudarray[brate])
  129.                 or (not (brate in supportedrates)))
  130.               do brate:=succ(brate);
  131.         if brate<=b19200 then begin
  132.           parity:=false;
  133.           baudrate:=b;
  134.           checkforhayesreport:=true;
  135.           mustgetbaud:=false;
  136.           n:=now;
  137.           repeat until carrier or (now>n+1)
  138.         end;
  139.         exit
  140.       end;
  141.       if p>length(lookfor) then q:=q+k else begin
  142.         if k=lookfor[p] then p:=p+1 else begin
  143.           b:=b+1;
  144.           if b=2 then exit
  145.         end
  146.       end
  147.     until false
  148.   end;
  149.  
  150. ***)
  151.  
  152. { procedure receivecall;
  153.   var b:byte;
  154.       timeout,autoswitch:integer;
  155.       k:char;
  156.       brate:baudratetype;
  157.  
  158.     procedure nextrate (var b:baudratetype);
  159.     var ob:baudratetype;
  160.     begin
  161.       ob:=b;
  162.       repeat
  163.         b:=succ(b);
  164.         if b>b19200 then b:=b110;
  165.         if b=ob then exit
  166.       until b in supportedrates
  167.     end;
  168.  
  169.     procedure disconnect;
  170.     begin
  171.       if (carrier or local) then hangupmodem;
  172.       baudrate:=defbaudrate;
  173.       parity:=false;
  174.       setparam (usecom,baudrate,parity);
  175.       setupmodem
  176.     end;
  177.  
  178.     function seconds:integer;
  179.     var r:registers;
  180.     begin
  181.       r.ah:=$2c;
  182.       intr ($21,r);
  183.       seconds:=r.dh
  184.     end; }
  185.  
  186.   procedure receivecall;
  187.   var b:byte;
  188.       timeout,autoswitch:integer;
  189.       k:char;
  190.       brate:baudratetype;
  191.       matrix:anystr;
  192.       joemam:anystr;
  193.       brow:integer;
  194.  
  195.     procedure nextrate (var b:baudratetype);
  196.     var ob:baudratetype;
  197.     begin
  198.       ob:=b;
  199.       repeat
  200.         b:=succ(b);
  201.         if b>b19200 then b:=b110;
  202.         if b=ob then exit
  203.       until b in supportedrates
  204.     end;
  205.  
  206.     procedure disconnect;
  207.     begin
  208.       if carrier then hangupmodem;
  209.       baudrate:=defbaudrate;
  210.       parity:=false;
  211.       setparam (usecom,baudrate,parity);
  212.       setupmodem
  213.     end;
  214.  
  215.     function seconds:integer;
  216.     var r:registers;
  217.     begin
  218.       r.ah:=$2c;
  219.       intr ($21,r);
  220.       seconds:=r.dh
  221.     end;
  222.  
  223.   label abort,connected;
  224.   begin
  225.     local:=false;
  226.     online:=false;
  227.     textcolor (normbotcolor);
  228.   begin
  229.      matrix:=' ';
  230.      online:=true;
  231.      delay (200);
  232.     {if numchars>0 then b:=ord(waitchar);
  233.     if numchars>0 then k:=waitchar else k:=' ';}
  234.     if numchars>0 then begin
  235.     delay (100);
  236.     while numchars>0 do matrix:=matrix+getchar;
  237.     if (b=ord('1')) and (k<>'0') and (k<>'1') and (k<>'2') then begin
  238.        baudrate:=baudarray[b300];
  239.        goto connected;
  240.        end;
  241.     if pos('5',matrix)>0 then begin
  242.        baudrate:=baudarray[b1200];
  243.        goto connected;
  244.        end;
  245.     if pos('12',matrix)>0 then begin
  246.        baudrate:=baudarray[b1200];
  247.        goto connected;
  248.        end;
  249.     if pos('24',matrix)>0 then begin
  250.        baudrate:=baudarray[b2400];
  251.        goto connected;
  252.        end;
  253.     if  pos('11',matrix)>0 then begin
  254.        baudrate:=baudarray[b2400];
  255.        goto connected;
  256.        end;
  257.     if  pos('96',matrix)>0 then begin
  258.        baudrate:=baudarray[b9600];
  259.        goto connected;
  260.        end;
  261.     if pos('19',matrix)>0 then begin
  262.        baudrate:=baudarray[b19200];
  263.        goto connected;
  264.        end;
  265.     if pos('10',matrix)>0 then begin
  266.        baudrate:=baudarray[b2400];
  267.        goto connected;
  268.        end;
  269.     writeln (usr,matrix);
  270. end;
  271.   begin
  272.     local:=false;
  273.     online:=false;
  274.     textcolor (normbotcolor);
  275.     if not mustgetbaud then goto connected;
  276.  
  277.     brate:=b110;
  278.     parity:=false;
  279.     timeout:=timer+2;
  280.     sendchar ('H');
  281.     sendchar ('i');
  282.     sendchar ('t');
  283.     sendchar (' ');
  284.     sendchar ('[');
  285.     sendchar ('E');
  286.     sendchar ('n');
  287.     sendchar ('t');
  288.     sendchar ('e');
  289.     sendchar ('r');
  290.     sendchar (']');
  291.     sendchar (':');
  292.     repeat
  293.       nextrate (brate);
  294.       baudrate:=baudarray[brate];
  295.       textcolor (outlockcolor);
  296.       textbackground (0);
  297.       col2;
  298.       gotoxy(1,9);
  299.  
  300.       write (usr,'Trying ',baudrate,' ');
  301.  
  302.       setparam (usecom,baudrate,parity);
  303.       while numchars>0 do k:=getchar;
  304.       autoswitch:=seconds+3;
  305.       if autoswitch>59 then autoswitch:=autoswitch-60;
  306.       repeat until (not carrier) or (numchars>0) or (keyhit) or
  307.                    (timer>=timeout) or (autoswitch=seconds);
  308.       if timer>=timeout then hangupmodem;
  309.       if not carrier then goto abort;
  310.       if keyhit
  311.         then
  312.           begin
  313.             k:=bioskey;
  314.             case upcase(k) of
  315.               #13:goto connected;
  316.               'D':goto abort;
  317.             end
  318.           end
  319.         else
  320.           begin
  321.             if numchars>0 then begin
  322.               b:=ord(getchar);
  323.             end else b:=0;
  324.             if b<>13
  325.               then if b=141
  326.                 then parity:=true
  327.                 else
  328.                   begin
  329.                     delay (200);
  330.                     while numchars>0 do b:=ord(getchar)
  331.                   end
  332.           end
  333.     until (b=13) or (b=141) or (timer>timeout);
  334.     if timer<=timeout then begin
  335.       connected:
  336.       setparam (usecom,baudrate,parity);
  337.       if parity
  338.         then baudstr:='E,7'
  339.         else baudstr:='N,8';
  340.       baudstr:=strr(baudrate)+','+baudstr+',1';
  341.       online:=true;
  342.       urec.config:=[lowercase,linefeeds,eightycols];
  343.       window(1,1,80,25); clrscr; setcursor(cursoron);
  344.       writeln (usr,'User connected at '+baudstr+'.');
  345.       newcalls:=newcalls+1;
  346.       if carrier then exit
  347.     end;
  348.     abort:
  349.     disconnect
  350.   end;
  351.   end;
  352.   end;
  353.  
  354.  Procedure ExitProg;
  355.  Begin
  356.     dontanswer;
  357.     TextMode(80);
  358.     window (1,1,80,25);
  359.     textcolor (15);
  360.     textbackground (0);
  361.     clrscr;
  362.     textcolor (8);
  363.     writeln ('════════════════════════════════════════════════════════════════════════════');
  364.     textcolor (15);
  365.     writeln ('                           TCS ',ver,' - ',date);
  366.     writeln ('       Renegade Bithead - Lord Zombie - Barimor - Doc. Savage - Maniac');
  367.     Writeln ('                    The Viper - Lord Blix - Kid Devious');
  368.     textcolor (8);
  369.     writeln ('════════════════════════════════════════════════════════════════════════════');
  370.     ensureclosed;
  371.     halt(4)
  372.   end;
  373.  
  374.   procedure checkday;
  375.   begin
  376.     if lastdayup<>datestr(now) then begin
  377.       lastdayup:=datestr(now);
  378.       numdaysup:=numdaysup+1;
  379.       callstoday:=0;
  380.       writestatus
  381.     end
  382.   end;
  383.  
  384.   procedure useredit;
  385.   {$M 8192,0,0}           { Leave memory for child process }
  386. var
  387.   Command: string[127];
  388.  
  389. begin
  390.     Command:=('Uedit');
  391.     begin
  392.       SwapVectors;
  393.       Exec(GetEnv('COMSPEC'), '/C ' + Command);
  394.       SwapVectors;
  395.     end;
  396.    TextMode(80);
  397.    Clrscr;
  398. end;
  399.  
  400.  procedure Futil;
  401. var
  402.   Command2: string[127];
  403.  
  404. begin
  405.     TextMode(80);
  406.     ClrScr;
  407.     Command2:=('Futil');
  408.     begin
  409.       SwapVectors;
  410.       Exec(GetEnv('COMSPEC'), '/C ' + Command2);
  411.       SwapVectors;
  412.     end;
  413.    TextMode(80);
  414.    Clrscr;
  415. end;
  416.  
  417.  procedure Run_Config;
  418. var
  419.   Command2: string[127];
  420.  
  421. begin
  422.     TextMode(80);
  423.     ClrScr;
  424.     Command2:=('Config');
  425.     begin
  426.       SwapVectors;
  427.       Exec(GetEnv('COMSPEC'), '/C ' + Command2);
  428.       SwapVectors;
  429.     end;
  430.    TextMode(80);
  431.    Clrscr;
  432. end;
  433.  
  434.   procedure dotimedevent;
  435.   var tf:text;
  436.   begin
  437.     window (1,1,80,25);
  438.     clrscr;
  439.     writeln (usr,'Executing timed event: ',eventbatch);
  440.     writeln (usr);
  441.     assign (tf,'Door.bat');
  442.     rewrite (tf);
  443.     writeln (tf,eventbatch);
  444.     textclose (tf);
  445.     timedeventdate:=datestr(now);
  446.     ensureclosed;
  447.     halt (3)
  448.   end;
  449.  
  450.  
  451.   function statusscreen:char;
  452.  
  453.  
  454.     procedure percent (r1,r2:real);
  455.     begin
  456.       if (r2<1) then exit;
  457.       r2:=round((r1/r2)*1000)/10;
  458.       writeln (usr,r2:0:1,'%')
  459.     end;
  460.  
  461.     procedure drawstatus;
  462.     var totalidle,totalup,totalmins,r:real;
  463.         tmp:integer;
  464.  
  465.     begin
  466.     if screendef=0 then exit;
  467.       col1;
  468.       tmp:=timetillevent;
  469.       if (tmp<=30) then begin
  470.         gotoxy (1,0);
  471.         write (usr,'Timed event scheduled in ',tmp,' minutes!  ');
  472.         if (tmp<=5) then begin
  473.           dontanswer;
  474.           if tmp<=2 then dotimedevent;
  475.         end
  476.       end;
  477.       if carrier or keyhit then exit;
  478.       gotoxy (48,19); write(usr,timestr(now));
  479.       gotoxy (48,20); write(usr,datestr(now));
  480.       gotoxy (1,2);
  481.       writeln (usr,callstoday);
  482.       gotoxy (1,6);
  483.       tmp:=elapsedtime (numminsidle);
  484.       write (usr,tmp);
  485.       gotoxy (1,4);
  486.       writeln (usr,numdaysup);
  487.       r:=round(10*numcallers/numdaysup)/10;
  488.       writeln (usr,r:0:1);
  489. {      col2;
  490.       gotoxy (1,3);
  491.       totalidle:=numminsidle.total+elapsedtime(numminsidle);
  492.       writeln (usr,totalidle:0:0);
  493.       totalup:=totalidle+numminsused.total;
  494.       writeln (usr,totalup:0:0);
  495.       totalmins:=1440.0*(numdaysup-1.0)+timer;
  496.       if (totalup<1) or (totalmins<1) then exit;
  497.       percent (numminsused.total,totalmins);
  498.       percent (numminsxfer.total,totalmins);
  499.       percent (totalidle,totalmins);
  500.       percent (totalup,totalmins);
  501.       percent (totalmins-totalup,totalmins);
  502. }
  503.       col1;
  504.       gotoxy (1,1);
  505.       maybewritestatus
  506.     end;
  507.  
  508.  
  509.     procedure writeavail;
  510.     var ChatM:sstr; m:sstr;
  511.     begin
  512.       gotoxy (1,9);
  513. {TEST for chat
  514.       ChatM:=Timestr(Now);
  515.       If Chatm=Availtime then SysopAvailstr='YES';}
  516.       m:=sysopavailstr;
  517.       while length(m)<15 do m:=m+' ';
  518.       write (usr,m);
  519.       gotoxy (1,1)
  520.     end;
  521.  
  522.   var cnt,numsmail:integer;
  523.       k:char;
  524.       tmp:mstr;
  525.       b:byte;
  526.       done:boolean;
  527.  
  528.     function shouldexit:boolean;
  529.     begin
  530.       shouldexit:=done or carrier
  531.     end;
  532.  
  533.     procedure handlekey (k:char; beforeabout:boolean);
  534.     begin
  535.       b:=ord(k)-128;
  536.       case b of
  537.         availtogglechar:begin
  538.           toggleavail;
  539.           if not beforeabout then writeavail
  540.         end;
  541.         35:sendmodemstr ('ATH|',true);
  542.         59,60,61,62,63,64,65,66,67,68:begin
  543.           done:=true;
  544.           statusscreen:=k
  545.         end
  546.       end
  547.     end;
  548.  
  549.     procedure writefreespace;
  550.     var r:registers; tempfree:real; lp:integer; total:real;
  551.         csize:real;
  552.  
  553.       function unsigned (i:integer):real;
  554.       begin
  555.         if i>=0 then unsigned:=i else unsigned:=65536.0+i
  556.       end;
  557.  
  558.     begin
  559.     total:=0;
  560.     for lp:=3 to 15 do begin
  561.  
  562.       r.ah:=$1c;
  563.       r.dl:=lp;
  564.       intr ($21,r);
  565.  
  566.       if mem[r.ds:r.bx]=$f8 then begin
  567.           r.ah:=$36;
  568.           r.dl:=lp;
  569.           intr ($21,r);
  570.           csize:=unsigned(r.ax)*unsigned(r.cx);
  571.           tempfree:=(csize*unsigned(r.bx))/1000;
  572.           total:=total+tempfree/1000;
  573.           gotoxy(6,22);
  574.           write(usr,streal(total)+' megs');
  575.           end;
  576.  
  577.       end;
  578.     end;
  579.  
  580.     procedure writeboardname;
  581.     var xcoord:integer; nm:string[50];
  582.     begin
  583.     nm:='« '+longname+' »';
  584.     xcoord:=39-(length(nm) div 2);
  585.     gotoxy(xcoord,17); write(usr,nm);
  586.     end;
  587.  
  588.  
  589.     function interrupted (beforeabout:boolean):boolean;
  590.     begin
  591.       if keyhit then begin
  592.         k:=bioskey;
  593.         handlekey (k,beforeabout)
  594.       end;
  595.       done:=done or carrier;
  596.       interrupted:=done
  597.     end;
  598.  
  599.     procedure sendstring (x:lstr);
  600.     var cnt:integer;
  601.         k:char;
  602.     begin
  603.       for cnt:=1 to length(x) do begin
  604.         sendchar(x[cnt]);
  605.         delay (20);
  606.       end;
  607.       delay (50);
  608.       while numchars>0 do k:=getchar
  609.     end;
  610.  
  611.     procedure phonesringing;
  612.     begin
  613.     col2;
  614.     gotoxy(1,9);
  615.     write('« Incoming Call »');
  616.       sendstring ('  ATA'#13)
  617.     end;
  618.  
  619.     procedure connectcode (k:char);
  620.     var timer:word absolute $40:$6c;
  621.         t:word;
  622.         k2:char;
  623.         bd:baudratetype;
  624.     begin
  625.       t:=timer+18;
  626.       repeat
  627.       until (timer>t) or carrier or (numchars>0);
  628.       k2:=getchar;  { Will be #0 if no chars }
  629.       case k of
  630.         '1':case k2 of
  631.               #0:bd:=b300;
  632.               '0':bd:=b2400;
  633.               else exit
  634.             end;
  635.         '5':bd:=b1200;
  636.         else exit
  637.       end;
  638.       if bd in supportedrates then begin
  639.         parity:=false;
  640.         baudrate:=baudarray[bd];
  641.         mustgetbaud:=false;
  642.         t:=timer+18;
  643.         repeat until carrier or (timer>t)
  644.       end
  645.     end;
  646.  
  647.   begin
  648.     while numchars>0 do k:=getchar;
  649.     statusscreen:=#0;
  650.     done:=false;
  651.     window (1,1,80,25);
  652.     textcolor (normbotcolor);
  653.     clrscr;
  654.  
  655.     setcursor(cursoroff);
  656. if (screendef=1) then begin
  657.     window (statwindx,statwindy,80,25);
  658.     gotoxy (1,1);
  659. writeln(usr,'┌──────────────┬─────────────────────────┬────────────────┬──────────────┐');
  660. writeln(usr,'│ Last Caller: │                         │  Recent Calls: │              │');
  661. writeln(usr,'│ Calls Today: │                         │     New Posts: │              │');
  662. writeln(usr,'│ Total Calls: │                         │   New Uploads: │              │');
  663. writeln(usr,'│  Total Days: │                         │  New Feedback: │              │');
  664. writeln(usr,'│   Calls/Day: │                         │      New Mail: │              │');
  665. writeln(usr,'│   Mins Idle: │                         │    Sysop Mail: │              │');
  666. writeln(usr,'│ DSZ Logname: │                         │                │              │');
  667. writeln(usr,'│              │                         │                │              │');
  668. writeln(usr,'│ Sysop Avail: │                         │ System Status: │ Initializing │');
  669. writeln(usr,'├──────────────┴─────────────────────────┴────────────────┴──────────────┤');
  670. writeln(usr,'│                                                                        │');
  671. writeln(usr,'│ [Alt-A] Chat Available    ▀▀█▀▀ ▄▀▀▀▀ ▄▀▀▀▀                            │');
  672. writeln(usr,'│ [Alt-H] Hang Up Modem       █   █      ▀▀▀▄                            │');
  673. writeln(usr,'│                             █   ▀▄▄▄▄ ▄▄▄▄▀                            │');
  674. writeln(usr,'│                              Version '+ver+'                              │');
  675. writeln(usr,'│                                                                        │');
  676. writeln(usr,'│                                                                        │');
  677. writeln(usr,'├──────────────┬─────────────[ Special Keys ]────────────┬───────────────┤');
  678. writeln(usr,'│ Total Free   │ [F10] Local Login    [F7] Screen On/Off │ Time:         │');
  679. writeln(usr,'│ Drive Space: │ [F2]  Exit TCS       [F4] Read Feedback │ Date:         │');
  680. writeln(usr,'│              │ [F3]  Give Carrier   [F5] System Log    │ Node: 1       │');
  681. writeln(usr,'└──────────────┴─────────────────────────────────────────┴───────────────┘');
  682.  
  683.     if interrupted (true) then exit;
  684.     window (1,1,80,25);
  685.     textcolor (outlockcolor);
  686.  if jshutup then begin
  687.   if length(getenv('JMODEM'))<1 then
  688.     begin
  689.     Assign (outf,'SETJ.BAT');
  690.     rewrite(outf);
  691.     WriteLn(outf,'cls');
  692.     WriteLn(outf,'echo                 Telling Jmodem to shut its mouth - please wait');
  693.     writeln(outf,'SET JMODEM=SHUTUP');
  694.     WriteLn(outf,'MAIN.BAT');
  695.     textclose(outf);
  696.   end;
  697.  end;
  698.     if (getenv('DSZLOG')<>dszlogname) or (getenv('SKLOG')<>sklog) then
  699.     begin
  700.      Assign (outf,'SETLOG.BAT');
  701.      rewrite (outf);
  702.      WriteLn(outf,'Echo off');
  703.      WriteLn(outf,'cls');
  704.      WriteLn(outf,'echo The environment path for DSZLOG or SKLOG do not match');
  705.      WriteLn(outf,'echo those that you are using.  Now adjusting and reloading...');
  706.      WriteLn(outf,'SET DSZLOG='+dszlogname);
  707.      Writeln(outf,'SET SKLOG='+sklog);
  708.      Writeln(outf,'MAIN.BAT');
  709.      textclose(outf);
  710.     end;
  711.    {If timeStr(Now)=Bytime then Sysopavail:=TRUE;}
  712.     if interrupted (true) then exit;
  713.     writefreespace; writeboardname;
  714.     setupmodem;
  715.     numsmail:=getnummail(1)+numfeedback;
  716.     tmp:=getlastcaller;
  717.     col1;
  718.     gotoxy (1,1);
  719.     textcolor (normtopcolor);
  720.     write (usr,copy(tmp,1,20));
  721.     gotoxy (1,3);
  722.     write (usr,numcallers:0:0);
  723.     writeavail;
  724.     gotoxy(1,7); write(usr,dszlogname);
  725.     col2;
  726.     gotoxy (1,1);
  727.     writeln (usr,newcalls);
  728.     writeln (usr,newposts);
  729. {    writeln (usr,numminsused.total:0:0);
  730.     write (usr,numminsxfer.total:0:0);
  731.     gotoxy (1,10);}
  732.  
  733.     writeln(usr,newuploads);
  734.     writeln(usr,newfeedback);
  735.     writeln(usr,newmail);
  736.     writeln(usr,numsmail);
  737.     gotoxy(1,9);
  738.     writeln(usr,'Waiting.     ');
  739.     end else setcursor(cursoroff);
  740.       repeat
  741.       checkday;
  742.       drawstatus;
  743.       cnt:=0;
  744.       repeat
  745.         while hashayes and (not carrier) and (numchars>0) do begin
  746.           k:=getchar;
  747.           case k of
  748.             '2':phonesringing;
  749.             '1','5':connectcode (k)
  750.           end
  751.         end;
  752.         cnt:=cnt+1
  753.       until (cnt>=10000) or interrupted (false) or done
  754.     until done
  755.   end;
  756.  
  757. var k:char;
  758. label exit;
  759. begin
  760.   waitforacall:=false;
  761.   setparam (usecom,defbaudrate,false);
  762.   starttimer (numminsidle);
  763.   wscount:=0;
  764.   local:=false;
  765.   clrscr;
  766.   repeat
  767.     doanswer;
  768.     mustgetbaud:=true;
  769.     k:=statusscreen;
  770.  
  771.     if carrier then begin
  772.       receivecall;
  773.  
  774.       if carrier then begin
  775.         writestatus;
  776.         goto exit;
  777.       end;
  778.     end;
  779.     case ord(k)-128 of
  780.       59:begin
  781.           { local:=false;
  782.            online:=false;
  783.            waitforacall:=true;
  784.            goto exit }
  785.            clrscr;
  786.            writestatus;
  787.            halt (125);
  788.          end;
  789.       60:begin
  790.     col2;
  791.     gotoxy(1,9); write(usr,'Exiting   ');
  792.            writestatus;
  793.            exitprog;
  794.          end;
  795.       61:begin
  796.       writestatus;
  797.       col2; gotoxy(1,9);
  798.       write(usr,'Carrier On ');
  799.           sendmodemstr('ATA|',true);
  800.          end;
  801.       62:begin
  802.           window (1,1,80,25);
  803.           clrscr;
  804.            unum:=lookupuser (sysopname);
  805.              if unum=0 then begin
  806.                writeln ('No Sysop Created.');
  807.                delay (1000);
  808.               end;
  809.             unum:=1;
  810.             readurec;
  811.         urec.timetoday:=1000;
  812.        readfeedback;
  813.        newfeedback:=0;
  814.           end;
  815.       63:begin
  816.           window (1,1,80,25);
  817.           clrscr;
  818.           unum:=lookupuser (sysopname);
  819.            if unum=0 then begin
  820.             writeln ('No Sysop Created.');
  821.             delay (1000);
  822.            end;
  823.           unum:=1;
  824.           readurec;
  825.           urec.timetoday:=999;
  826.       viewsyslog;
  827.           delsyslog;
  828.           clrscr;
  829.          end;
  830.       64: begin
  831.        window(1,1,80,25);
  832. {       start_netmail;}
  833.           end;
  834.       65: begin;
  835.         screendef:=(1-screendef);
  836.         if (screendef=0) then begin
  837.                     clearscr;
  838.                     setcursor(cursoroff);
  839.                      end;
  840.       end;
  841.       66: Futil;
  842.       67: Run_Config;
  843.  
  844.       68:begin
  845.        dontanswer;
  846.            modeminlock:=true;
  847.            modemoutlock:=true;
  848.            local:=true;
  849.            online:=false;
  850.            writestatus;
  851.            newfeedback:=0;
  852.            newuploads:=0;
  853.            newcalls:=0;
  854.            newposts:=0;
  855.        newmail:=0;
  856.        setcursor(cursoron);
  857.        writestatus;
  858.            goto exit
  859.          end
  860.     end
  861.   until 0=1;
  862.   exit:
  863.   textcolor (normbotcolor);
  864.   window (1,1,80,25);
  865.   clrscr
  866. end;
  867.  
  868. begin
  869. end.
  870.