Skip to content

Commit 9723e13

Browse files
authored
Create mainmenu.p
1 parent c24e278 commit 9723e13

File tree

1 file changed

+204
-0
lines changed

1 file changed

+204
-0
lines changed

mainmenu.p

+204
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
Program MainMenu.v1170607;
2+
3+
/////////////////////////////////////////////////////////////////////////////
4+
// MODULE ID: MAINMENU
5+
// Description:
6+
/////////////////////////////////////////////////////////////////////////////
7+
uses
8+
Variants,
9+
Classes,
10+
Databases,
11+
Math, // GAMES - RANDOM
12+
Datetime, // Formating Timestamp (profile for example)
13+
Display, // Color Names
14+
Strings, //
15+
ANSISockets, // Extends Session to Support ANSI/AVATAR/PIPE/WWIV commands!
16+
Environment, // Add FILE routines, etc.
17+
Chains; // Add Chain Memory and Chaining...
18+
19+
Const
20+
SHOR=#196; {─}
21+
SVER=#179; {│} {�}
22+
SCRS=#197; {┼}
23+
STLT=#180; {┤}
24+
STRT=#195; {├}
25+
STUP=#193; {┴}
26+
STDN=#194; {┬}
27+
SLTL=#218; {┌}
28+
SLTR=#191; {┐}
29+
SLBL=#192; {└}
30+
SLBR=#217; {┘}
31+
32+
var
33+
ScriptRoot:String;
34+
Ws,Ss:String;
35+
36+
{$I includes/screencrt.inc}
37+
{$I includes/bbskit.inc}
38+
{$I plugins/title.inc}
39+
{$I plugins/filelist.inc}
40+
{$I plugins/profile.inc}
41+
{$I plugins/kinghill.inc}
42+
{$I /var/www/CMS/im.inc}
43+
44+
Function MinutesLeft:String;
45+
var
46+
i64:Int64;
47+
48+
Begin
49+
If Chain.ReadLargeint('TIMELIMIT')<Timestamp then begin
50+
FastWriteln('|0CYou have used all of your time for this connection.'+#13#10#13#10+
51+
'|0EYou can reconnect and enjoy another hour if your would like.');
52+
Result:='0';
53+
Hangup;
54+
End
55+
Else Begin
56+
i64:=Chain.ReadLargeint('TIMELIMIT')-Timestamp;
57+
Result:=IntToStr(i64 div 60);
58+
End;
59+
End;
60+
61+
procedure AboutExchangeBBS;
62+
Begin
63+
Title;
64+
FastWrite(1,5,'|0BExchange Bulletin Board System is a collection of 35 years experience in BBS'+#13#10+
65+
'development. Originally started using a "|07Tandy Model I|0B" computer from Radio'+#13#10+
66+
'shack, using the purchased source code to (|0EY|0B)our (|0EB|0B)ulletin (|0EB|0B)oard (|0ES|0B)ystem.'+#13#10#13#10+
67+
'Which used a video fossil, everything you wrote to the screen was sent to the'+#13#10+
68+
'modem. And of course anything received from the modem was redirected to the'+#13#10+
69+
'local keyboard buffer. It took a little buffering in itself, as the keyboard'+#13#10
70+
'buffer was 4 bytes.'+#13#10#13#10);
71+
FastWrite("|0EYBBS was written in Tandy's Basic, and was about 30 pages long printed out."+#13#10#13#10+
72+
'|0AIt had just the basic functionality, new user sign-up, sysop feedback, chat,'+#13#10+
73+
'one message base, one public and one private file area, you could upload and'+#13#10+
74+
'download using xmodem-checksum protocol, a bbs listing, and goodbye screen.'+#13#10#13#10+
75+
'|03It did not have any doorway or online games, no oneliners, etc.'+#13#10);
76+
if PauseBar="S" then exit;
77+
Title;
78+
FastWrite(1,5,'|0BYBBS evolved in to |07Cygnus-X|0B (name inspired by |0CRush |09Hemisphere LP|0B), when the'+#13#10+
79+
'code was ported to my "|07Tandy Model 4p|0B" just before I moved from Tampa to'+#13#10+
80+
'Fort Walton Beach Florida.'+#13#10#13#10+
81+
'By now (1985-ish), I had implemented support for ANSI color, and embedded a'+#13#10+
82+
'couple BBS games - |0FKing of the Hill|0B (thanks to Joe Griffith in Tampa), and'+#13#10+
83+
'some card games, and a basic chess engine (Thanks to Eric T. of "The Zoo BBS"'+#13#10+
84+
'in Tampa). These few features made the BBS very attractive in FWB.'+#13#10#13#10+
85+
'Cygnus-X was later rewritten from scratch when I got a |07Tandy 1000|0B (PC Clone)...'+#13#10+
86+
'where I attempted to implement |0AFidonet|0B support with very little guidance or'+#13#10+
87+
'knowledge of the |0AFTSC specifications|0B. This version of the code was called'+#13#10+
88+
'|0EXenophone BBS, |0Bwhich I still have to this date - a self contained BBS.'+#13#10);
89+
if PauseBar="S" then exit;
90+
Title;
91+
FastWrite(1,5,'|0B35 years later, I developed this from scratch using a compiler I have been'+#13#10+
92+
'writing since 2000, called |0DModern Pascal|0B. |0EExchangeBBS|0B is a mental repository'+#13#10+
93+
'of everything I had incorporated over the years.'+#13#10#13#10+
94+
'ExchangeBBS supports multiple languages even a humours one called |0EJive|0B.'+#13#10#13#10+
95+
'ExchangeBBS utilized the |0EHalcyon7 xBase|0B code which is built-in to Modern Pascal'+#13#10+
96+
'for all data storage, even the hundred thousand plus messages.'+#13#10#13#10+
97+
'ExchangeBBS incorporates different echo mail and mail relay solutions,'+#13#10+
98+
'allowing the BBS to be a true exchange of information. I also own gigabytes'+#13#10+
99+
'of CD-ROM collections from the BBS era, all are online for users to download'+#13#10+
100+
'to your system using one of the transfer protocols that I have recoded.'+#13#10#13#10+
101+
'Another fine point to share, is all of this BBS is released to the public as'+#13#10+
102+
'|0CFree Open Source|0B on |0CGitHub|0B and here on the system itself.');
103+
Pause;
104+
End;
105+
106+
Procedure BBSListing;
107+
Begin
108+
CLS(14,0);
109+
DisplayFileEx(ScriptRoot+'ansasc/bbslisting',True);
110+
// Pause;
111+
End;
112+
113+
Procedure DoorGames;
114+
Begin
115+
While Connected do begin
116+
If not Chain.ReadBoolean('EXPERT') then begin
117+
CLS(7,0);
118+
DisplayFileEx(ScriptRoot+'ansasc/doors');
119+
End;
120+
{$IFDEF CODERUNNER}
121+
If Session.CountWaiting then Session.ReadStr(Session.CountWaiting,500);
122+
{$ENDIF}
123+
Ws:=#13#10#27+"[0;40;37m "+#27+"[1;33m�"+#27+"[0;33m�"+#27+"[1;30m�"+#27+"[0m "+#27+"[1;31mD"+#27+"[35mo"+#27+
124+
"[0;35mo"+#27+"[31mr"+#27+"[32ms "+#27+"[1;31mM"+#27+"[35me"+#27+"[0;35mn"+#27+"[31mu"+#13#10#27+
125+
"[37m�"+#27+"[1m�"+#27+"[33mٳ�"+#27+"[0;33m��"+#27+"[37m "+#27+"[1;35m"+MinutesLeft()+#27+"[36m "+#27+"[0;35mMinutes Left"+#13#10#27+
126+
"[37m "+#27+"[1;30m�"+#27+"[0;33m��"+#27+"[37m "+#27+"[1;31mC"+#27+"[35mh"+#27+"[0;35mo"+#27+"[31mi"+#27+"[37mc"+#27+"[1;30me:|0E";
127+
//Ws:=Ask(#13#10+'|0E[|0D'+FormatTimestamp('HH:NN am/pm',Timestamp)+'|0E] [|0A'+MinutesLeft()+' |0Bminutes left|0E] Which door would you like to run?',' ');
128+
Ws:=Ask(Ws,' ');
129+
If Ws<>'' then
130+
Case Ws[1] of
131+
'I','i':doIMLogin();
132+
'K','k':if Chain.ReadLongint('SECLEVEL')>9 then doKingOfTheHill //koth
133+
Else begin
134+
FastWriteln('This feature requires a permanent account.'+#13#10);
135+
Pause;
136+
End;
137+
'X','x':Break;
138+
End;
139+
End;
140+
End;
141+
142+
Procedure NewsListing;
143+
Begin
144+
CLS(14,0);
145+
DisplayFileEx(ScriptRoot+'ansasc/news',True);
146+
// Pause;
147+
End;
148+
149+
Begin
150+
ScriptRoot:=ExtractFilePath(ExecFilename);
151+
InitFastTTT;
152+
If not Chain.ReadBoolean('HASANSI') then Session.SetASCIIMode;
153+
If Chain.ReadBoolean('HASANSI') then Session.SetANSIMode;
154+
If Chain.ReadBoolean('HASUTF8') then Session.SetUTF8Mode;
155+
While Connected do begin
156+
If not Chain.ReadBoolean('EXPERT') then begin
157+
CLS(7,0);
158+
DisplayFileEx(ScriptRoot+'ansasc/mainmenu');
159+
End;
160+
{$IFDEF CODERUNNER}
161+
If Session.CountWaiting then Session.ReadStr(Session.CountWaiting,500);
162+
{$ENDIF}
163+
Ws:=#13#10#27+"[0;40;37m "+#27+"[1;33m�"+#27+"[0;33m�"+#27+"[1;30m�"+#27+"[0m "+#27+"[1;34mM"+#27+"[0;36ma"+#27+
164+
"[1;30mi"+#27+"[0;34mn"+#27+"[37m "+#27+"[1;36mM"+#27+"[34me"+#27+"[0;36mn"+#27+"[1;30mu"+#13#10#27+
165+
"[0m�"+#27+"[1m�"+#27+"[33mٳ�"+#27+"[0;33m��"+#27+"[37m "+#27+"[1;36m"+MinutesLeft()+" "+#27+"[0;36mMinutes Left"+#13#10#27+
166+
"[37m "+#27+"[1;30m�"+#27+"[0;33m��"+#27+"[37m "+#27+"[1;36mC"+#27+"[34mom"+#27+"[0;36mma"+#27+"[1;30mnd"+#27+"[0;34m:";
167+
//Ws:=Ask(#13#10+'|0E[|0D'+FormatTimestamp('HH:NN am/pm',Timestamp)+'|0E] [|0A'+MinutesLeft()+' |0Bminutes left|0E] What would you like to do?',' ');
168+
Ws:=Ask(Ws+'|0E',' ');
169+
If Ws<>'' then
170+
Case Ws[1] of
171+
'A','a':AboutExchangeBBS;
172+
'B','b':BBSListing;
173+
'D','d':DoorGames;
174+
'F','f':FileAreaSelect;
175+
'G','g':Break;
176+
'K','k':if Chain.ReadLongint('SECLEVEL')>9 then doKingOfTheHill //koth
177+
Else begin
178+
FastWriteln('This feature requires a permanent account.'+#13#10);
179+
Pause;
180+
End;
181+
'N','n':NewsListing;
182+
'P','p':if Chain.ReadLongint('SECLEVEL')>9 then EditProfile
183+
Else begin
184+
FastWriteln('This feature requires a permanent account.'+#13#10);
185+
Pause;
186+
End;
187+
'X','x':Begin
188+
Chain.Store('EXPERT',not Chain.ReadBoolean('EXPERT'));
189+
If Chain.ReadBoolean('EXPERT') then FastWriteln('Expert mode on.')
190+
Else FastWriteln('Expert mode off.');
191+
End;
192+
'?':If Chain.ReadBoolean('EXPERT') then begin
193+
CLS(7,0);
194+
DisplayFileEx(ScriptRoot+'ansasc/mainmenu');
195+
End;
196+
'@':Begin
197+
DisposeFastTTT;
198+
Chain.Run(ScriptRoot+'mainmenu.p');
199+
End;
200+
End;
201+
End;
202+
DisposeFastTTT;
203+
Chain.Run(ScriptRoot+'goodbye.p');
204+
End.

0 commit comments

Comments
 (0)