home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
189.img
/
TCS120S.ZIP
/
NEWNET.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1987-06-23
|
7KB
|
252 lines
Overlay Procedure Net_Send_Overlay;
var Finished,z:boolean;
Outs:array [1..30] of boolean;
procedure Send(xx:anystr);
var cnt:integer;
begin
for cnt:=1 to length(xx) do begin
sendchar (xx[cnt]);
write (usr,xx[cnt]);
end;
end;
Function There_Is_Any_Mail:boolean;
var out:anystr;
ct:integer;
a:boolean;
begin
gotoxy(11,9);
There_Is_Any_Mail:=false;
for ct:=1 to 30 do Outs[Ct]:=false;
ct:=0;
a:=false;
while (Ct<=30) do begin
cT:=ct+1;
out:=uploaddir+strr(ct)+'.Out';
if exist(out) then begin
There_Is_Any_Mail:=true;
a:=true;
Outs[ct]:=true;
write (usr,strr(ct)+' ');
end;
end;
end;
Procedure Send_The_Mail;
var going:anystr;
ct:integer;
Dest:Anystr;
joe:text;
Procedure ReadRec(Num:Integer);
var t:text;
begin
assign (t,uploaddir+strr(num)+'.out');
reset (t);
readln(t,Dest);
close(t);
gotoxy(14,13);
write(usr,Dest,' ');
end;
Function Call (var number:anystr):boolean;
var jo:integer;
ss,rest:anystr;
loc,cmp:mstr;
abt:Char;
begin
Setparam(1,1200,False);
gotoxy(9,14);
loc:=copy(Returning,1,3);
cmp:=copy(Dest,1,3);
rest:=copy(Dest,4,255);
if loc=cmp then writeln(usr,'Dialing Local: ',rest,' ')
else Writeln (usr,'Dialing: ',number,' ');
online:=false;
ss:=number;
if ss='' then exit;
if keypressed then begin
read (kbd,Abt);
gotoxy(9,14);
write(usr,'Aborted.. ');
end;
doanswer;
delay (200);
gotoxy(1,22);
send(^M);
delay(50);
send(^M);
send (' '^M);
delay(500);
if loc=cmp then send('ATDT'+rest+#13) else send ('ATDT'+extender+ss+#13);
jo:=25000;
Finished:=False;
repeat
jo:=jo-1;
if keypressed then Finished:=true;
gotoxy(70,13);
if (jo div 1000)<10 then write('0');
write(jo div 1000);
if carrier then Finished:=true;
until Finished or (jo<1);
gotoxy(1,22);
send (^M);
call:=carrier;
end;
Procedure Once_Got_Carrier;
begin
gotoxy(9,14);
writeln (usr,'Carrier detected.. ');
online:=true;
gotoxy (1,22);
delay (999);
send (^M^M^M' ');
writeln(usr,^j);
delay (3000);
send (^H^H^H^H^H^H^H^H);
Delay (200);
send ('PNET-FILE'+#13);
writeln(usr,^j);
delay (500);
if carrier then send ('***************');
end;
procedure Check_All_Mail(Start:Integer); { Almost Artificial Intelligence!! Yeah!! }
var Position,Cnt:Integer;
Out:text;
Tmp:Anystr;
Procedure Send_The_File (xx:lstr);
var comp:boolean;
sent:text;
begin
ymodem:=false;
Wxmodem:=false;
kermit:=false;
zmodem:=false;
delay (3000);
clearitall;
repeat until (numchars>0) or hungupon or keypressed;
if numchars>0 then begin
comp:=protocolxfer(true,true,uploaddir+xx);
assign (Sent,uploaddir+xx);
if comp then erase (Sent);
gotoxy(9,14);
IF comp then Writeln (USR,'EmuMail Transfer Successful.. ')
else Writeln (USR,'EmuMail Transfer Failed.. ');
delay(1000);
clearitall;
end;
end;
begin
gotoxy(21,10);
For Cnt:=1 to 30 do begin
if Outs[Cnt] then begin
assign(Joe,uploaddir+strr(cnt)+'.out');
reset(joe);
readln(Joe,Tmp);
close(Joe);
if tmp=dest then write(usr,cnt:1,' ');
end;
end;
position:=24;
for Cnt:=1 to 30 do begin
if Outs[Cnt] then begin
assign(Joe,uploaddir+strr(cnt)+'.out');
reset(joe);
readln(Joe,Tmp);
close(Joe);
if Tmp=Dest then begin
gotoxy(position,11);
write(usr,cnt:1,' ');
Send_The_File (strr(cnt)+'.out');
position:=position+2;
if cnt>9 then position:=position+1;
Outs[Cnt]:=false;
end;
end;
end;
end;
begin
ct:=0;
while (Ct<=30) do begin
cT:=ct+1;
if Outs[Ct] then begin
ReadRec(Ct);
if Call(Dest) then begin
Once_Got_Carrier;
gotoxy(18,10);
write(usr,' ');
gotoxy(24,11);
write(usr,' ');
Check_All_Mail(Ct);
end;
disconnect;
gotoxy(9,14);
writeln(usr,'Disconnecting.. ');
online:=false;
gotoxy(1,22);
delay (500);
send (^M' '^M);
end;
end;
end;
begin
modeminlock:=false;
modemoutlock:=false;
local:=false;
window (1,1,80,25);
clrscr;
gotoxy (1,9);
writeln(usr,'Outgoing:');
gotoxy (1,10);
writeln(usr,'Outgoing to Dest: ');
gotoxy (1,11);
writeln(usr,'Outgoing Already Sent: ');
gotoxy (1,13);
writeln(usr,'Destination: ');
gotoxy (63,13);
writeln(usr,'Time: [ ]');
gotoxy (1,14);
writeln(usr,'Status: ');
gotoxy (30,17);
writeln (USR,'EmuMail 1.02 (tm).');
gotoxy (1,18);
writeln (usr,'_______________________________________________________________________________');
gotoxy (5,20);
writeln(usr,'Modem Commands: ');
z:=There_Is_Any_Mail;
if Z then begin
gotoxy(1,22);
send (' '^M);
delay (500);
send (^M'AT S0=0'^M);
gotoxy(9,14);
writeln(usr,'Turning Off Auto-Answer.. ');
delay(1000);
Send_The_Mail;
if carrier then disconnect;
gotoxy(9,14);
Writeln (usr,'NetMail send complete.. Returning to BBS.. ');
gotoxy(1,22);
send (^M^M^M' ');
delay (200);
send (^M'AT S0=1'^M);
gotoxy(9,14);
writeln(usr,'Turning On Auto-Answer.. ');
delay(1000);
Async_Close;
Halt(0);
end else begin
gotoxy(9,14);
writeln(usr,'No NetMail.. Returning to BBS..');
Async_Close;
Halt(0);
end;
end;