home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
153.img
/
TELES.ZIP
/
UNITX.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-07-25
|
36KB
|
1,125 lines
{$R-} {Range checking off}
{$B+} {Boolean complete evaluation on}
{$S+} {Stack checking on}
{$I+} {I/O checking on}
{$N-} {No numeric coprocessor}
{$V-}
Unit UnitX; {PartX renamed to Unit X for sanity's sake}
Interface
Uses
Crt,
Dos,
Common,
Unit0;
procedure readq(filen:astr);
procedure docitystate;
procedure dozipcode;
procedure dophone;
procedure dostreet;
procedure dojob;
procedure doscreen;
procedure finduser(var usernum:integer);
procedure post;
procedure p1;
function p2:boolean;
function rmail(n:integer):astr;
procedure dsr(uname:astr);
procedure ssm(dest:integer; s:astr);
procedure rsm;
procedure chbds;
procedure forwardmail;
procedure chcolors;
procedure mmacroo;
procedure readamsg;
procedure logon1;
function vote1x(qnum:integer; var vd:vdatar):boolean;
procedure wmsg;
procedure smail2(na:emary);
procedure initp1;
procedure getcallera(var c:char; var chkcom:boolean);
Implementation
procedure readq(filen:astr);
var ff,ff1:text; a,s,store:astr; i,x:integer; fuku,abort:boolean;
begin
assign(ff,filen);
{$I-} reset(ff); {$I+}
if ioresult=0 then begin
store:=copy(filen,1,pos('.',filen)-1)+'.ASW';
assign(ff1,store); {$I-} append(ff1); {$I+}
if ioresult<>0 then rewrite(ff1);
writeln(ff1,'User: '+nam);
repeat
fuku:=false;
readln(ff,a);
for i:=1 to length(a) do begin
if a[i]='*' then begin
prompt(copy(a,1,i-1));
x:=80-i; inputl(s,x);
writeln(ff1,copy(a,1,i-1)+s);
fuku:=true;
end;
end;
abort:=false;
if fuku=false then printacr(a,abort,next);
{ if fuku then writeln(f1,copy(a,1,length(a)-1)+s) else writeln(f1,a);}
until (eof(ff)) or (hangup);
close(ff); close(ff1);
end;
end;
procedure finduser(var usernum:integer);
var t,i,i1:integer;
nn:astr;
begin
input(nn,25);
usernum:=value(nn); if usernum>0 then begin
reset(uf);
if usernum>filesize(uf)-1 then begin
print('Unknown User.');
usernum:=0; end
else begin
seek(uf,usernum);
read(uf,user);
if user.deleted then begin
print('Unknown User.');
usernum:=0; end;
end;
close(uf); end
else begin
i:=1; i1:=systat.users; t:=(i1+i) div 2;
while ((i1-i)>1) and (srl[t].name<>nn) do begin
if srl[t].name<nn then
i:=t
else
i1:=t;
t:=(i1+i) div 2;
end;
usernum:=0;
if srl[i].name=nn then usernum:=srl[i].number;
if srl[i1].name=nn then usernum:=srl[i1].number;
if srl[t].name=nn then usernum:=srl[t].number;
if nn='NEW' then usernum:=-1;
if usernum=0 then print('Unknown User.');
end;
end;
procedure post;
var b:messagerec; i:astr; mesag:messages; a:anontyp; c:char;
begin
if (thisuser.sl<boards[board].postsl) or (rpost in thisuser.ac) then
print('Your access privledges do not include posting.')
else begin
if not rep then irt:='';
if ((ptoday>=seclev[thisuser.sl].posts) and (thisuser.sl<55)) then
print('Too many messages posted today.') else begin
a:=boards[board].anonymous;
if (a=no) and (pana in seclev[thisuser.sl].anst) then
a:=yes;
if rpostan in thisuser.ac then a:=no;
inmsg(mesag,a,i,true,false);
if mesag.ext<>0 then begin
b.message:=mesag;
b.title:=i;
b.owner:=usernum;
b.date:=daynum(date);
b.mage:=maxage(thisuser.sl);
if rvalidate in thisuser.ac then
b.messagestat:=unvalidated else b.messagestat:=validated;
if rmsg in thisuser.ac then b.messagestat:=deleted;
iscan;
if tnum>=boards[board].maxmsgs then deletem(1);
mary[0].message.number:=tnum+1;
mary[tnum]:=b;
bchanged:=true;
thisuser.msgpost:=thisuser.msgpost+1; ptoday:=ptoday+1;
systat.msgposttoday:=systat.msgposttoday+1;
sysoplog('+'+i+' posted on '+boards[board].name); topscr;
print('Message posted on '+boards[board].name+'.');
end;
end;
end;
end;
procedure docitystate;
begin
repeat
nl;
print('Enter your city & state seperated by a comma');
prompt(':');
inputl(thisuser.citystate,26);
until (pos(',',thisuser.citystate)<>0) or (hangup);
end;
procedure dostreet;
begin
repeat
nl;
print('Enter your mailing address: <House number> <Street> [APT#]');
prompt(':');
inputl(thisuser.street,21);
until (thisuser.street<>'') or (hangup);
end;
procedure dozipcode;
begin
repeat
print('Enter your zipcode (9 digit if available)');
print(' ##### or #####-####');
prompt(':');
input(thisuser.zipcode,10);
until (thisuser.zipcode<>'') or (hangup);
end;
procedure dojob;
begin
repeat
print('Enter your occupation');
prompt(':');
inputl(thisuser.occupation,40);
until (thisuser.occupation<>'') or (hangup);
end;
procedure doscreen;
var v:astr;
begin
nl;prompt('How many columns wide is your screen (32-80, <CR>=80) :');
ini(thisuser.linelen);
if thisuser.linelen=0 then thisuser.linelen:=80;
prompt('Number of lines per page (4-25, <CR>=25) : ');
input(v,2);
if v='' then thisuser.pagelen:=25;
if v<>'' then thisuser.pagelen:=value(v);
if thisuser.pagelen>25 then thisuser.pagelen:=25;
if thisuser.pagelen<4 then thisuser.pagelen:=4;
end;
procedure dophone;
var right:boolean;
begin
repeat
right:=true;
print('Enter your VOICE phone number in the');
print('form:');
print(' ###-###-####.'); prompt(':');
input(thisuser.ph,12);
if (copy(thisuser.ph,5,12)='000-0000') or (copy(thisuser.ph,5,3)='555')
or (copy(thisuser.ph,5,12)='111-1111') then
begin
print('GEE - I almost believe you.');
thisuser.ph:='';
end;
if (length(thisuser.ph)<>12) or (thisuser.ph[4]<>'-') or
(thisuser.ph[8]<>'-') then begin
print('Please enter the phone number correctly!'); right:=false; end;
until (right) or (hangup);
end;
procedure p1;
var c:char; tries,i,ii,t:integer; s,s1,s2:astr; tf:boolean; fi:text; pasw:astr;
done:boolean; choseansi,chosecolor:boolean;
procedure showstuff;
begin
nl;nl;printf(systat.gfilepath+'system');
nl;nl;printf(systat.gfilepath+'newuser');
tries:=0; pasw:='';
while (systat.boardpw<>pasw) and (not hangup) do begin
prompt('Newuser password :'); echo:=false; input(pasw,38);
echo:=true; tries:=tries+1;
{ if (pasw='OFF') or (pasw='BYE') then tries:=systat.tries+1;}
if tries>=(systat.tries) then
hangup:=true
else
if (systat.boardpw<>pasw) and (pasw<>'') then
sl1('Wrong newuser password: '+pasw);
end;
end;
procedure doname;
var i:integer;
begin
repeat
if systat.alias then print('Enter your first & last name, or your alias.') else
print('Enter your first & last name. Handles are not allowed!');
prompt(':'); input(thisuser.name,21); tf:=false;
nl;
if not (thisuser.name[1] in ['A'..'Z']) or (thisuser.name='') then tf:=true;
for i:=1 to systat.users do if srl[i].name=thisuser.name then begin
tf:=true;
print('That name is already being used.');
end;
assign(fi,systat.gfilepath+'trashcan.txt');{$I-} reset(fi); {$I+}
if ioresult=0 then begin
s2:=' '+thisuser.name+' ';
while not eof(fi) do begin
readln(fi,s1); if s1[length(s1)]=#1 then s1[length(s1)]:=' ' else s1:=s1+' ';
s1:=' '+s1; for i:=1 to length(s1) do s1[i]:=upcase(s1[i]);
if pos(s1,s2)<>0 then begin print('"'+copy(s1,pos(s1,s2),length(s1))+'" may not be used!');
tf:=true; end;
end;
close(fi);
end;
if tf and (not hangup) then begin
print(chr(7)+'Sorry, can''t use that name.');
t:=t+1;
sl1('Unacceptable name : '+thisuser.name);
end;
if t>=3 then hangup:=true;
until (tf=false) or hangup;
end;
procedure dorealname;
begin
repeat
nl; print('Enter your REAL first & last name.');
prompt (':');
inputl(thisuser.realname,21);
if (thisuser.realname='=') or (thisuser.realname='same') then
thisuser.realname:=thisuser.name;
until (thisuser.realname<>'') or (hangup);
end;
procedure docomputer;
var right:boolean;
begin
repeat
print('What kind of computer do you have?');
prompt(':');input(thisuser.computer,14);
until (thisuser.computer<>'');
end;
procedure dosex;
begin
nl; prompt('Your sex (M,F) ? ');
onek(thisuser.sex,'MF');
end;
procedure doage;
begin
repeat
nl;
prompt('What is your age in years? ');
ini(thisuser.age);
if thisuser.age<7 then print('Aren''t you a little too young?');
if thisuser.age>99 then print('Yeah, sure. That old!');
until (thisuser.age>6) and (thisuser.age<100) or (hangup);
end;
procedure dowherebbs;
begin
repeat
print('Where did you hear about this BBS?');
prompt(':');
inputl(thisuser.wherebbs,40);
until (thisuser.wherebbs<>'') or (hangup);
end;
procedure doansi;
begin
begin
choseansi:=false;
prompt('Can you display ANSI graphics (Y/N) ? ');
if yn then begin
thisuser.defaults:=thisuser.defaults+[ansi]; choseansi:=true;
prompt('Do you have a color monitor (Y/N) ? ');
if yn then begin thisuser.defaults:=thisuser.defaults+[color]; chosecolor:=true; end else chosecolor:=false;
end;
end;
end;
procedure dopw;
begin
tf:=false;
repeat
nl; print('Enter a password that you will use to log on again');
prompt(':'); input(thisuser.pw,20);
if length(thisuser.pw)<3 then
print('Must be 3 characters in length.')
else begin
prompt('Is this correct (Y/N) ? ');
tf:=yn;
end;
until tf or hangup;
end;
procedure doitall;
begin
showstuff;
doname;
dophone;
dorealname;
docomputer;
dosex;
doage;
docitystate;
dostreet;
dozipcode;
dojob;
dowherebbs;
doansi;
doscreen;
dopw;
end;
begin
t:=0;
thisuser.defaults:=[onekey,wordwrap,mmnu];
doitall;
repeat
done:=false;
cls;
cl(5);print('User Information Change');
nl;
print('[A] System Name - '+thisuser.name);
print('[B] Real Name - '+thisuser.realname);
print('[C] Phone # - '+thisuser.ph);
print('[D] Computer - '+thisuser.computer);
print('[E] Sex - '+thisuser.sex);
print('[F] Age - '+cstr(thisuser.age));
print('[G] City, State - '+thisuser.citystate);
print('[H] Address - '+thisuser.street);
print('[I] Zip Code - '+thisuser.zipcode);
print('[J] Occupation - '+thisuser.occupation);
print('[K] Heard from - '+thisuser.wherebbs);
prompt('[L] ANSI - ');
if choseansi then prompt('Enabled') else prompt('Disabled');
if (chosecolor) and (choseansi) then prompt(' w/ Color') else prompt(' w/o Color');
nl;
print('[M] Screen size - '+cstr(thisuser.linelen)+'X'+cstr(thisuser.pagelen));
print('[N] Password - '+thisuser.pw);
nl;
prt('Selection (A-J) to change, or Y when done :');
onek(c,'ABCDEFGHIJKLMNY');
case c of
'A':doname;
'B':dorealname;
'C':dophone;
'D':docomputer;
'E':dosex;
'F':doage;
'G':docitystate;
'H':dostreet;
'I':dozipcode;
'J':dojob;
'K':dowherebbs;
'L':doansi;
'M':doscreen;
'N':dopw;
'Y':done:=true;
end;
until (done) or (hangup);
end;
function p2:boolean;
var c:char; tries,i,ii,t:integer; s,s1,s2:astr; tf,tf1:boolean; fi:text; pasw:astr;
begin
tf1:=false;
if not hangup then begin
with thisuser do begin
deleted:=false; waiting:=0; laston:='Never.';loggedon:=0; msgpost:=0;
emailsent:=0; feedback:=0; linelen:=80; pagelen:=25;
ontoday:=0; illegal:=0;
option:=[]; dsl:=systat.newdsl; downloads:=0; uploads:=0;
ttimeon:=0.0; for i:=1 to 70 do res[i]:=0; note:='';
filepoints:=systat.newfp;
dlnscn:=[]; for i:=0 to 39 do dlnscn:=dlnscn+[i];
forusr:=0;
sl:=systat.newsl;
ac:=systat.newac; ar:=systat.newar;
for i:=1 to 20 do vote[i]:=0; qscan[1].ext:=1;
qscan[1].ltr:='A'; qscan[1].number:=-32767;
for i:=2 to 39 do qscan[i]:=qscan[1];
for i:=1 to 39 do qscn[i]:=true;
macro[1]:='This is the Ctrl-D Macro';
macro[2]:='This is the Ctrl-F Macro';
sbn:=0;
cols:=dcols;
end;
tf:=false;
nl;prompt('Please wait while I save your record ... ');
reset(uf);
ii:=0;
for i:=1 to filesize(uf)-1 do begin
seek(uf,i);
read(uf,user);
if user.deleted and (ii=0) then ii:=i;
end;
if ii=0 then usernum:=filesize(uf) else usernum:=ii;
seek(uf,usernum);
write(uf,thisuser);
close(uf);
isr(thisuser.name,usernum);
print('Saved.');nl;
lastcaller:=nam;
prompt('Your user number is ');cl(3);PRINT(cstr(usernum));
prompt('Your password is "');cl(4);PROMPT(thisuser.pw);cl(1);PRINT('".');
print('Please remember these, you will need them to log on again.');
nl;prt('Press any key to continue ...');getkey(c);nl;nl;
nl; nl;
cls;
readq(systat.gfilepath+'newuser.inf');
{ if incom then begin}
topscr;
if systat.app then begin
printf(systat.gfilepath+'newapp');
irt:='New User Application';
end;
nl; tf1:=true;
{ end;}
end;
p2:=tf1;
end;
function rmail(n:integer):astr;
var tu,cn,c:integer; f:file; mr,mr1:mailrec; u:userrec; dm:boolean;
begin
dm:=true; mailread:=true;
seek(mailfile,n); read(mailfile,mr); tu:=mr.destin;
if mr.msg.ext>128 then begin
for c:=0 to filesize(mailfile)-1 do begin
seek(mailfile,c); read(mailfile,mr1);
if (mr1.msg.ltr=mr.msg.ltr) and (mr1.msg.number=mr.msg.number)
and (mr.msg.ext=mr1.msg.ext) and (c<>n) and (mr1.destin<>-1) then
dm:=false;
end;
end;
if dm then begin
assign(f,filename(mr.msg)); {$I-} erase(f); {$I+} cn:=ioresult;
end;
mr.destin:=-1; mr.from:=0; mr.mage:=0;
seek(mailfile,n); write(mailfile,mr);
reset(uf);
if (tu>0) and (tu<filesize(uf)) then begin
seek(uf,tu); read(uf,u); u.waiting:=u.waiting-1;
seek(uf,tu); write(uf,u);if tu=1 then fw:=fw-1;
end;
close(uf);
rmail:=u.name+' #'+cstr(tu);
end;
procedure dsr(uname:astr);
var i,rn:integer; sr:smalrec;
begin
rn:=0;
for i:=1 to systat.users do
if srl[i].name=uname then
rn:=i;
if rn<>0 then begin
for i:=rn to systat.users-1 do srl[i]:=srl[i+1];
systat.users:=systat.users-1; savesystat;
rewrite(sf); for i:=0 to systat.users do write(sf,srl[i]); close(sf);
end else sl1('*** Couldn''t delete "'+uname+'"');
end;
procedure ssm(dest:integer; s:astr);
var x:smr; u:userrec;
begin
{$I-} reset(smf);{$I+}
if ioresult<>0 then rewrite(smf);
seek(smf,filesize(smf)); x.msg:=s; x.destin:=dest;
write(smf,x);
close(smf);
reset(uf);
if (dest>0) and (dest<=filesize(uf)) then begin
seek(uf,dest); read(uf,u);
if not (smw in u.option) then
begin u.option:=u.option+[smw]; seek(uf,dest); write(uf,u); end;
end;
close(uf);
if (dest=usernum) then thisuser.option:=thisuser.option+[smw];
end;
procedure rsm;
var x:smr; i:integer;
begin
{$I-} reset(smf); {$I+}
if ioresult=0 then begin
i:=0;
repeat
if i<=filesize(smf)-1 then begin seek(smf,i); read(smf,x); end;
while (i<filesize(smf)-1) and (x.destin<>usernum) do begin
i:=i+1; seek(smf,i); read(smf,x);
end;
if (x.destin=usernum) and (i<=filesize(smf)-1) then begin
print(x.msg);
seek(smf,i); x.destin:=-1; write(smf,x);
smread:=true;
end;
i:=i+1;
until (i>filesize(smf)-1) or hangup;
close(smf);
end;
end;
procedure chbds;
var i:astr; i1,ii:integer;
begin
repeat
nl;nl;CL(4);prompt('Boards to Q-scan marked with ''');cl(8);
prompt('*');cl(4);print('''');
nl; for ii:=1 to numboards do if boardac(ii) then begin
if thisuser.qscn[ii] then begin CL(8);prompt('* ');end else prompt(' ');
if boards[ii].key=' ' then BEGIN CL(4);PROMPT(cstr(ii));END else BEGIN CL(4);PROMPT(boards[ii].key);END;
PROMPT(' ');
CL(2);PROMPT(' : ');CL(3);PRINT(boards[ii].name);
end;
repeat
prt('Enter board #, Q, or ? :'); input(i,2);
ii:=value(i);
if (ii>0) and (ii<=numboards) then
if (boards[ii].key=' ') and boardac(ii) then thisuser.qscn[ii]:=
not thisuser.qscn[ii]
else
else begin
i1:=0;
for ii:=1 to numboards do if boards[ii].key=i then i1:=ii;
if (i1<>0) and (i<>' ') then if boardac(ii) then
thisuser.qscn[ii]:=not thisuser.qscn[ii];
end;
until (i='Q') or (i='?') or hangup;
until (i='Q') or hangup;
end;
procedure forwardmail;
var u:userrec; n:integer; i:astr; tf:boolean;
begin
nl;
print('If you forward your mail, all mail');
print('addressed to you will go to that person');
print('Now enter the user''s number, or just');
print('hit <CR> to deactivate mail forwarding.');
prt(': '); input(i,4);
n:=value(i);
nl;
if n=0 then begin
thisuser.forusr:=0;
print('Forwarding deactivated.');
end else begin
reset(uf); tf:=true;
if n>=filesize(uf) then tf:=false else begin
seek(uf,n); read(uf,u);
if u.deleted or (nomail in u.option) then tf:=false;
end;
if n=usernum then tf:=false;
if tf then begin
thisuser.forusr:=n;
print('Forwarding set to: '+u.name+' #'+cstr(n));
end else
print('Sorry, can''t forward to that user.');
close(uf);
end;
end;
procedure chcolors;
var mcol,ocol:byte; c,c1,c2:integer; cl:boolean; i:astr; done:boolean; ch:char;
function colo(n:integer):astr;
begin
case n of
0:colo:='Black';
1:colo:='Blue';
2:colo:='Green';
3:colo:='Cyan';
4:colo:='Red';
5:colo:='Magenta';
6:colo:='Yellow';
7:colo:='White';
end;
end;
function dt(n:integer):astr;
var i:astr;
begin
i:=colo(n and 7)+' on '+colo((n shr 4) and 7);
if (n and 8)<>0 then i:=i+', High Intensity';
if (n and 128)<>0 then i:=i+', Blinking';
dt:=i;
end;
function stf(n:integer):astr;
var i:astr;
begin
case n of
0:i:='Other';
1:i:='Default';
2:i:='Unused';
3:i:='Yes/No';
4:i:='Prompts';
5:i:='Note';
6:i:='Input line';
7:i:='Y/N question';
8:i:='Blinking';
9:i:='Other';
end;
i:=cstr(n)+'. '+i;
while length(i)<20 do i:=i+' ';
stf:=i;
end;
procedure liststf;
var c:integer;
begin
nl;
for c:=0 to 9 do begin
prompt(stf(c)); ansic(c); print(dt(thisuser.cols[cl,c]));
end;
nl;
end;
begin
cl:=color in thisuser.defaults;
nl; if cl then print('Set multiple colors.')
else print('Set B&W colors.');
ch:='?'; done:=false;
repeat
case ch of
'Q':done:=true;
'?':liststf;
'0'..'9':begin
nl; print('Current:'); c1:=value(ch); nl;
prompt(stf(c1)); ansic(c1); print(dt(thisuser.cols[cl,c1]));
nl; nl; print('Colors:'); nl;
for c:=0 to 7 do begin
prompt(cstr(c)+'. '+colo(c)+' '); setc(c); print(colo(c));
end;
ocol:=thisuser.cols[cl,c1]; nl;
prt('Foreground? '); onek(ch,#13+'01234567');
if ch=#13 then
mcol:= ocol and 7
else
mcol:=value(ch);
prt('Background? '); onek(ch,#13+'01234567');
if ch=#13 then
mcol:=mcol or (ocol and 112)
else
mcol:=mcol or (value(ch) shl 4);
ynq('Intensified? ');
if yn then mcol:=mcol or 8;
ynq('Blinking? ');
if yn then mcol:=mcol or 128;
nl; nl; prompt(stf(c1)); setc(mcol); print(dt(mcol));
nl; prompt('Is this correct? ');
if yn then thisuser.cols[cl,c1]:=mcol;
end;
end;
if not done then begin
nl; prt('Colors: 0-9,Q,? : '); onek(ch,'Q?0123456789');
end;
until done or hangup;
end;
procedure mmacroo;
var mc,c:char; n1,n,mcn,mn:integer; i:astr;
begin
nl; prt('Which (D,F,Q=Quit) :'); onek(c,'QDF');
if c<>'Q' then begin
nl;nl; mc:=c; print('Enter your macro now, Ctrl-'+mc);
print('to end macro. 79 Character limit.'); nl;if mc='D' then mcn:=4 else mcn:=6;
n:=1; i:=''; macok:=false; if mc='D' then mn:=1 else mn:=2;
repeat
getkey(c);
if (ord(c)<32) then
if not((c=#8) or (c=#10) or (c=#13) or (c=#14) or (c=#9) or (c=#16) or
(c=chr(mcn))) then c:=chr(0);
if c=#8 then if n<2 then c:=#0 else begin
oc(#8); oc(' '); oc(#8);
n:=n-1; c:=#0; if i[n]<#32 then begin
oc(#8); oc(' '); oc(#8);
end;
end;
if (c<>#0) and (c<>chr(mcn)) then begin
if (c=#16) or (c=#14) or (c=#9) or (c=#27) or (c=#2) then begin
cl(3);prompt('^'+chr(ord(c)+64));cl(1);
end
else oc(c);
i[n]:=c; n:=n+1;
if c=#13 then oc(chr(10));
end;
until (c=chr(mcn)) or (n=80) or hangup;
nl;
if n=80 then begin
print('Macro limit is 79 chars.');
print('That much saved.');
end;
i[0]:=chr(n-1);
print('Ctrl-'+mc+' macro is now:'); prompt('"');
for n1:=1 to length(i) do
if i[n1]>=' ' then
prompt(i[n1])
else
begin cl(3);prompt('^'+chr(64+ord(i[n1])));cl(1);end;
print('"'); dump;
prompt('Is this what you want? ');
if yn then begin thisuser.macro[mn]:=i; print('Macro saved.') end
else print('Macro not saved, then.');
macok:=true;
end;
end;
procedure readamsg;
var filv:text; i,n:astr; ii:integer; ll:integer; s:array [1..3] of astr; wa:integer;
begin
nl;nl;assign(filv,systat.gfilepath+'auto.msg'); ll:=0;
{$I-} reset(filv); {$I+}
if ioresult<>0 then commandline('No Auto-Message!') else begin
readln(filv,n);
if n[1]='@' then
if postn in seclev[thisuser.sl].anst then n:=copy(n,2,length(n))+' (Posted Anonymously)'
else n:='Anonymous';
if n[1]='!' then
if so then n:=copy(n,2,length(n))+' (Posted Anonymously)'
else n:='Anonymous';
cl(5); prompt('Auto message by: '); cl(3); print(n);
for ii:=1 to 3 do begin
readln(filv,i); s[ii]:=i; if length(i)>ll then ll:=length(i);
end;
close(filv);
end;
if okansi then for ii:=1 to ll do prompt('─'); nl;
for ii:=1 to 3 do begin cl(0); print(s[ii]); end;
if okansi then for ii:=1 to ll do prompt('─');
nl;nl;
(* if systat.quote then begin
wa:=0;
systat.quoteptr:=systat.quoteprt+1;
nl;nl;assign(filv,systat.gfilepath+'quotes.msg'); ll:=0;
{$I-} reset(filv); {$I+}
if ioresult<>0 then commandline('Sorry, none available!') else begin
readln(filv,n);
if n='' then wa:=wa+1;
if systat.quoteprt=wa
*)
end;
procedure logon1;
var fil:file of astr; lo:array[1..8] of astr; num:integer; i:astr; ul:text; c:char;
abort:boolean; var d1,d2:zlogt; zf:file of zlogt; n,z:integer; C1:INTEGER;
begin
realsl:=thisuser.sl; realdsl:=thisuser.dsl;
{ assign(fil,systat.gfilepath+'laston.dat');
reset(fil); for num:=1 to 8 do read(fil,lo[num]);
abort:=false;
cl(5);
print('Last few callers:'); nl;
if cs then c1:=0 else c1:=4;
repeat
c1:=c1+1;
if lo[c1]<>'' then printacr(lo[c1],abort,next); i:='';
until (c1=8) or (abort);
if (spd<>'KB') then begin
seek(fil,0); for num:=2 to 8 do write(fil,lo[num]);
i:=#3+#3+cstr(systat.callernum)+': '+#3+#1+nam;
write(fil,i);
end;
close(fil);} cls;
cl(3); prompt('You are caller '); cl(2);
prompt('#'); cl(4); print(cstr(systat.callernum));
if systat.callernum=32767 then begin
sysoplog('[> Value passed to number of callers was higher than the maximum');
sysoplog(' integer value. Caller number was reset to 1.');
systat.callernum:=1;
end;
if thisuser.laston=date then thisuser.ontoday:=thisuser.ontoday+1
else thisuser.ontoday:=1;
if systat.lastdate<>date then begin
nl; print('Running daily maintance ...');
commandline('Creating ZLOG.DAT ...');
assign(zf,systat.gfilepath+'zlog.dat');
{$I-} reset(zf); {$I+}
if ioresult<>0 then begin
rewrite(zf);
d1.date:='';
for n:=1 to 97 do
write(zf,d1);
end;
d1.date:=systat.lastdate;
d1.active:=systat.activetoday;
d1.calls:=systat.callstoday;
d1.post:=systat.msgposttoday;
d1.email:=systat.emailtoday;
d1.fback:=systat.fbacktoday;
d1.up:=systat.uptoday;
for n:=95 downto 0 do begin
seek(zf,n);
read(zf,d2);
seek(zf,n+1);
write(zf,d2);
end;
seek(zf,0);
write(zf,d1);
close(zf);
systat.lastdate:=date;
assign(ul,systat.gfilepath+'ysysop.log'); {$I-} erase(ul); {$I+} num:=ioresult;
sl1('');
sl1('Total Time On........: '+ cstr(systat.activetoday));
sl1('Calls Today..........: '+cstr(systat.callstoday));
sl1('Messages posted today: '+cstr(systat.msgposttoday));
sl1('Files u/l today......: '+cstr(systat.uptoday));
close(sysopf);
commandline('Patching System Log ...');
rename(sysopf,systat.gfilepath+'ysysop.log');
assign(sysopf,systat.gfilepath+'sysop.log');
rewrite(sysopf); writeln(sysopf); close(sysopf); append(sysopf);
assign(ul,systat.gfilepath+'user.log'); rewrite(ul); writeln(ul); close(ul);
with systat do begin
activetoday:=0; callstoday:=0; msgposttoday:=0; emailtoday:=0;
fbacktoday:=0; uptoday:=0;
end;
nl;
enddayf:=true;
end;
end;
function vote1x(qnum:integer; var vd:vdatar):boolean;
var cv,tv,ii:integer; ij,i,i1,i2:astr; c:char; abort,next,bb:boolean;
begin
i2:=' '; cls; bb:=false;
if vd.numa=0 then print('Inactive question.') else begin
cl(5);PROMPT('Question ');cl(2);PROMPT('#');cl(4);PRINT(cstr(qnum)+':');
nl; cl(7);print(vd.question); nl;
tv:=0; for ii:=1 to vd.numa do tv:=tv+vd.answ[ii].numres;
prompt('Users voting: ');cl(3);print(ctp(tv,systat.users)); if tv=0 then tv:=1;
nl; CL(0);print('0:No Comment');
ij:='Q0';
ii:=1; abort:=false;
while (ii<=vd.numa) do begin
ij:=ij+cstr(ii);
i1:=copy(vd.answ[ii].ans,1,25);
i1:=i1+copy(i2,1,25-length(i1))+#3+#2+' :';
i:=copy(cstr(vd.answ[ii].numres),1,3);
i1:=i1+copy(i2,1,3-length(i))+i+' '+ctp(vd.answ[ii].numres,tv);
printacr(#3+#4+cstr(ii)+#3+#7+':'+#3+#3+i1,abort,next);
ii:=ii+1;
end;
nl;nl;
i:='Your vote: '+vd.answ[thisuser.vote[qnum]].ans; print(i);
if not(rvoting in thisuser.ac) and (not hangup) and (thisuser.sl>10) then begin
ynq('Change it? '); if yn then begin
nl; prt('Which number (0-'+cstr(vd.numa)+') ? ');
onek(i[1],ij);
i[0]:=#1; ii:=value(i); if (i<>'') and (ii>=0) and (ii<=vd.numa) then begin
if thisuser.vote[qnum]<>0 then
vd.answ[thisuser.vote[qnum]].numres:=vd.answ[thisuser.vote[qnum]].numres-1;
thisuser.vote[qnum]:=ii;
if ii<>0 then vd.answ[ii].numres:=vd.answ[ii].numres+1;
bb:=true;
cls; print('Current Standings for question #'+cstr(qnum)+' : '); nl; print(vd.question); nl;
tv:=0; for ii:=1 to vd.numa do tv:=tv+vd.answ[ii].numres;
print('Users voting: '+ctp(tv,systat.users)); nl; if tv=0 then tv:=1;
abort:=false; ii:=1;
while (ii<=vd.numa) and (not abort) do begin
i1:=copy(vd.answ[ii].ans,1,25);
i1:=i1+copy(i2,1,25-length(i1))+' '+#3+#2+':';
i:=copy(cstr(vd.answ[ii].numres),1,3);
i1:=i1+copy(i2,1,3-length(i))+i+' '+ctp(vd.answ[ii].numres,tv);
if ii=thisuser.vote[qnum] then printacr(#3+#8+'*'+#3+#4+cstr(ii)+#3+#7+':'+#3+#3+i1,abort,next) else
printacr(' '+#3+#4+cstr(ii)+#3+#7+':'+#3+#3+i1,abort,next);
ii:=ii+1;
end;
end;
end;
end;
dump;
end;
vote1x:=bb;
end;
procedure wmsg;
var filvar:text; ii:integer; li:array[1..3] of astr; n:astr;
begin
nl;print('Enter three lines:'); nl;
for ii:=1 to 3 do begin
cl(9); prt(cstr(ii)+':'); cl(0); inputl(li[ii],77);
end;
n:=nam; if pana in seclev[thisuser.sl].anst then begin
nl; ynq('Anonymous? ');
if yn then
if realsl=255 then
n:='!'+n
else
n:='@'+n;
end;
prompt('Is this alright? ');
if yn then begin
assign(filvar,systat.gfilepath+'auto.msg');
rewrite(filvar); writeln(filvar,n);
for ii:=1 to 3 do writeln(filvar,li[ii]);
close(filvar); print('Auto-message saved.');
if (realsl<>255) or incom then begin
sysoplog('Changed Auto-message');
for ii:=1 to 3 do sysoplog(' '+li[ii]);
end;
end else prompt('Nothing saved.');
end;
procedure smail2(na:emary);
var f:messages; a:anontyp; i:astr; c1,t,cp,e:integer; mr:mailrec; us:userrec;
begin
if na[1]<>0 then begin
a:=no; if sanm in seclev[thisuser.sl].anst then a:=yes;
irt:='Mass Mail.';
inmsg(f,a,i,false,true);
if f.ext<>0 then begin
{$I-} reset(mailfile); {$I+}
if (ioresult<>0) then
{! 45. IOR^esult now returns different values corresponding to DOS error codes.}
rewrite(mailfile);
e:=filesize(mailfile);
if e=0 then cp:=0 else begin
cp:=-1; t:=e-1;
seek(mailfile,t); read(mailfile,mr);
while (t>0) and (mr.destin=-1) do begin
t:=t-1; seek(mailfile,t); read(mailfile,mr);
end;
cp:=t+1;
end;
seek(mailfile,cp);
mr.msg:=f; if lan then mr.from:=-usernum else mr.from:=usernum;
mr.title:=i; mr.date:=daynum(date);
mr.mage:=maxage(thisuser.sl);
c1:=1; nl; print('Sending mail to:');
while (na[c1]<>0) and (c1<=20) do begin
mr.destin:=na[c1];
write(mailfile,mr);
if na[c1]=1 then begin
thisuser.feedback:=thisuser.feedback+1;
ftoday:=ftoday+1;
fw:=fw+1;
end else begin
thisuser.emailsent:=thisuser.emailsent+1;
etoday:=etoday+1;
end;
seek(uf,na[c1]); read(uf,us);
us.waiting:=us.waiting+1; seek(uf,na[c1]); write(uf,us);
if na[c1]=usernum then thisuser.waiting:=thisuser.waiting+1;
i:=us.name+' #'+cstr(na[c1]);
sysoplog('Mult-mail sent to '+i);
print(' '+i);
c1:=c1+1;
end;
close(mailfile); topscr;
end;
end;
end;
procedure initp1;
var a:integer; filv:text; i:astr; d:astr;
begin
wantout:=true; lastcaller:='No one';
ldate:=daynum(date);
ch:=false; lil:=0; thisuser.pagelen:=20; buf:=''; chatcall:=false;
spd:=''; lastname:=''; ll:=''; i:=''; chatr:=''; textcolor(0);
cursoroff; textcolor(0);
assign(systatf,'status.dat');
reset(systatf); read(systatf,systat);close(systatf);
if systat.users>200 then delay(100) else delay(900);
assign(uf,systat.gfilepath+'user.lst');
assign(sf,systat.gfilepath+'names.lst');
assign(sysopf,systat.gfilepath+'sysop.log');
{$I-} append(sysopf); {$I+}
if ioresult<>0 then begin
rewrite(sysopf);
writeln(sysopf);
end;
assign(mailfile,systat.gfilepath+'email.dat');
iport;
assign(smf,systat.gfilepath+'shortmsg.dat');
assign(cf,systat.gfilepath+'chat.msg'); cfo:=false;
reset(sf); for a:=0 to systat.users do read(sf,srl[a]); close(sf);
for a:=systat.users+1 to maxusers do begin
srl[a].name:=''; srl[a].number:=0; end;
assign(ulf,systat.gfilepath+'uploads.dat');
reset(ulf); maxulb:=-1;
while not eof(ulf) do begin maxulb:=maxulb+1; read(ulf,uboards[maxulb]); end;
close(ulf);
hangup:=false;
incom:=false; outcom:=false;
echo:=true; doneday:=false;
assign(bf,systat.gfilepath+'boards.dat');
reset(bf);
numboards:=filesize(bf);
{ assign(xp,systat.gfilepath+'expro.dat');
reset(xp); numprotocals:=-1;
while not eof(xp) do begin numprotocals:=numprotocals+1; read(xp,protocals[numprotocals]); end;
close(xp);}
for a:=1 to numboards do
read(bf,boards[a]);
close(bf);
assign(slf,systat.gfilepath+'seclev.dat'); reset(slf); for a:=0 to 255 do read(slf,seclev[a]);
close(slf);
assign(uf,systat.gfilepath+'user.lst');
reset(uf);
if filesize(uf)>1 then begin seek(uf,1); read(uf,user); fw:=user.waiting;
end else fw:=0;
close(uf); textcolor(7); first_time:=true;
sl1(#3+#9+'-------------------->'+#3+#3+'System booted at '+time+#3+#9+'<-----------------');
end;
procedure getcallera(var c:char; var chkcom:boolean);
var rl,rl1:real; i:astr;
begin
if commpressed then c:=cinkey;
if c='2' then begin
chkcom:=true; rl:=timer; star;
while (c<>#13) and (abs(rl-timer)<0.2) do c:=cinkey;
end;
if chkcom then begin
if (answerbaud<2) or (not returna) then pr(systat.answer);
cursoron;
writeln('Answering Phone-Force: [1] 300 [2] 1200 [3] 2400 [4] 4800 [5] 9600 [H] Abort');
delay(50); dump; rl1:=timer; i:=''; rl:=0.0;
repeat
chkcom:=false;
if answerbaud>2 then begin
spd:=cstr(answerbaud);
chkcom:=true;
answerbaud:=0;
end;
if keypressed then begin c:=readkey;
if upcase(c)='H' then begin
chkcom:=true;
pr('A');
delay(200);
dump;
end;
case c of
'1':spd:='300';
'2':spd:='1200';
'3':spd:='2400';
'4':spd:='4800';
'5':spd:='9600';
end;
chkcom:=true;
end;
c:=cinkey;
if (rl<>0.0) and (abs(rl-timer)>2.0) and (c=#0) then c:=#13;
if (c<#32) and (c<>#13) then c:=#0;
if c<>#0 then
if c<>#13 then begin i:=i+c; rl:=timer; end else begin
if i=cstr(systat.result300) then begin spd:='300'; chkcom:=true; end;
if i=cstr(systat.result1200) then begin spd:='1200'; chkcom:=true; end;
if i=cstr(systat.result2400) then begin spd:='2400'; chkcom:=true; end;
if i=cstr(systat.result4800) then begin spd:='4800'; chkcom:=true; end;
if i=cstr(systat.result9600) then begin spd:='9600'; chkcom:=true; end;
if i=cstr(systat.nocarrier) then chkcom:=true;
rl:=0.0;
end;
if c=#13 then i:='';
if abs(timer-rl1)>45.0 then chkcom:=true;
until chkcom;
if abs(timer-rl1)>45.0 then begin c:='X'; lmsg:=true; end;
clrscr;
end;
if spd<>'KB' then incom:=true;
end;
END.