From 5e81182bf71ff056bcae24c9ec75f3b73ecaaaaa Mon Sep 17 00:00:00 2001 From: sk-5 Date: Fri, 28 Jun 2013 09:24:25 -0700 Subject: [PATCH] Added Menu Command *T to toggle sysop availablility Added Menu Command 1L for oneliners Added Oneliners UNIT. New Files : MISC/ONELH.* - Oneliners headers MISC/ONELE.* - Oneliners Footer MISC/ONELM.* - Oneliners Middle ONELM.* Options : ~AN (Anon - Yes/No) ~AT (Anon - True/False) ~DA (Date Added) ~DE (Date Edited - Not Used Yet) ~OL (The Oneliner) ~RN (Record Number) ~U# (User ID with '#') ~U1 (User ID without '#') ~UN (User Name) ~UL (User Name Lowercase) ~US (First 2 Letters of Username - iNiQUiTY Style) ~UU (First 2 letters of username lowercase) modified: MENUS.PAS new file: MISC/ONELE.ANS new file: MISC/ONELE.ASC new file: MISC/ONELH.ANS new file: MISC/ONELH.ASC new file: MISC/ONELM.ASC new file: ONELINER.PAS modified: RENEGADE.PAS --- SOURCE/MENUS.PAS | 2125 +++++++++++++++++++++-------------------- SOURCE/MISC/ONELE.ANS | 1 + SOURCE/MISC/ONELE.ASC | 1 + SOURCE/MISC/ONELH.ANS | 7 + SOURCE/MISC/ONELH.ASC | 12 + SOURCE/MISC/ONELM.ASC | 1 + SOURCE/ONELINER.PAS | 320 +++++++ SOURCE/RENEGADE.PAS | 2 +- 8 files changed, 1414 insertions(+), 1055 deletions(-) create mode 100644 SOURCE/MISC/ONELE.ANS create mode 100644 SOURCE/MISC/ONELE.ASC create mode 100644 SOURCE/MISC/ONELH.ANS create mode 100644 SOURCE/MISC/ONELH.ASC create mode 100644 SOURCE/MISC/ONELM.ASC create mode 100644 SOURCE/ONELINER.PAS diff --git a/SOURCE/MENUS.PAS b/SOURCE/MENUS.PAS index 3ef36fd..dee28e5 100644 --- a/SOURCE/MENUS.PAS +++ b/SOURCE/MENUS.PAS @@ -1,1054 +1,1071 @@ -{$IFDEF WIN32} -{$I DEFINES.INC} -{$ENDIF} - -{$A+,B-,D+,E-,F+,I-,L+,N-,O-,R-,S+,V-} - -UNIT Menus; - -INTERFACE - -USES - Common, - MyIO; - -PROCEDURE AutoExecCmd(AutoCmd: AStr); -PROCEDURE MenuExec; -PROCEDURE LoadMenuPW; -PROCEDURE MainMenuHandle(VAR Cmd: AStr); -PROCEDURE FCmd(CONST Cmd: AStr; VAR CmdToExec: Byte; VAR CmdExists,CmdNotHid: Boolean); -PROCEDURE DoMenuExec(Cmd: AStr; VAR NewMenuCmd: AStr); -PROCEDURE DoMenuCommand(VAR Done: Boolean; - Cmd, - MenuOption: AStr; - VAR NewMenuCmd: AStr; - NodeActivityDesc: AStr); - -IMPLEMENTATION - -USES - Arcview, - Archive1, - Archive2, - Archive3, - Automsg, - BBSList, - Boot, - Bulletin, - CUser, - Doors, - Email, - File0, - File1, - File2, - File3, - File5, - File6, - File7, - File8, - File9, - File10, - File11, - File12, - File13, - File14, - Mail0, - Mail1, - Mail2, - Mail3, - Mail4, - Menus2, - Menus3, - MiscUser, - MsgPack, - Multnode, - OffLine, - Script, - Stats, - LineChat, - Sysop1, - Sysop2, - SysOp2G, - Sysop3, - Sysop4, - SysOp5, - Sysop6, - Sysop7, - Sysop8, - Sysop9, - Sysop10, - Sysop11, - SysOp12, - TimeBank, - TimeFunc, - Vote; - - - (* - I := 1; - Newmenucmd := ''; - while ((I <= Noc) and (Newmenucmd = '') ) do - begin - if (Menucommand^[I].Ckeys = 'FIRSTCMD') then - begin - if (Aacs(Menucommand^[I].Acs)) then - begin - Newmenucmd := 'FIRSTCMD'; - Domenuexec(Cmd,Newmenucmd); - end; - end; - inc(I); - end; - *) -PROCEDURE AutoExecCmd(AutoCmd: AStr); -VAR - NewMenuCmd: AStr; - Counter: Byte; - Done: Boolean; -BEGIN - NewMenuCmd := ''; - Done := FALSE; - Counter := 1; - WHILE (Counter <= NumCmds) AND (NewMenuCmd = '') AND (NOT Done) AND (NOT HangUp) DO - BEGIN - IF (MemCmd^[Counter].Ckeys = AutoCmd) then - IF (AACS(MemCmd^[Counter].ACS)) THEN - BEGIN - NewMenuCmd := AutoCmd; - DoMenuCommand(Done, - MemCmd^[Counter].CmdKeys, - MemCmd^[Counter].Options, - NewMenuCmd, - MemCmd^[Counter].NodeActivityDesc); - END; - Inc(Counter); - END; -END; - -PROCEDURE MenuExec; -VAR - Cmd, - NewMenuCmd: AStr; - Done: Boolean; -BEGIN - MainMenuHandle(Cmd); - IF ((Copy(Cmd,1,2) = '\\') AND (SysOp)) THEN - BEGIN - DoMenuCommand(Done,Copy(Cmd,1,2),Copy(Cmd,3,Length(Cmd) - 2),NewMenuCmd,'Activating SysOp Cmd'); - IF (NewMenuCmd <> '') THEN - Cmd := NewMenuCmd - ELSE - Cmd := ''; - END; - NewMenuCmd := ''; - REPEAT - DoMenuExec(Cmd,NewMenuCmd) - UNTIL (NewMenuCmd = '') OR (HangUp); -END; - -PROCEDURE CheckHelpLevel; -BEGIN - IF (MemMenu.ForceHelpLevel <> 0) THEN - CurHelpLevel := MemMenu.ForceHelpLevel - ELSE IF (Novice IN ThisUser.Flags) OR (OkRIP) THEN - CurHelpLevel := 2 - ELSE - CurHelpLevel := 1; -END; - -PROCEDURE LoadMenuPW; -VAR - s: Str20; - NACC: Boolean; -BEGIN - LoadMenu; - NACC := FALSE; - IF (NOT AACS(MemMenu.ACS)) OR (MemMenu.Password <> '') THEN - BEGIN - NACC := TRUE; - IF (MemMenu.Password <> '') THEN - BEGIN - NL; - Prt('Password: '); - GetPassword(s,20); - IF (s = MemMenu.Password) THEN - NACC := FALSE; - END; - IF (NACC) THEN - BEGIN - PrintF('NOACCESS'); - IF (NoFile) THEN - BEGIN - NL; - Print('Access denied.'); - PauseScr(FALSE); - END; - CurMenu := FallBackMenu; - LoadMenu; - END; - END; - IF (NOT NACC) THEN - CheckHelpLevel; -END; - -PROCEDURE CheckForceLevel; -BEGIN - IF (CurHelpLevel < MemMenu.ForceHelpLevel) THEN - CurHelpLevel := MemMenu.ForceHelpLevel; -END; - -PROCEDURE GetCmd(VAR Cmd: AStr); -VAR - S1, - SS, - SaveSS, - SHas0, - SHas1: AStr; - C: Char; - CmdToExec, - Counter, - SaveCurrentColor: Byte; - Key: Word; - GotCmd, - Has0, - Has1, - Has2: Boolean; -BEGIN - Cmd := ''; - IF (Buf <> '') THEN - IF (Buf[1] = '`') THEN - BEGIN - Buf := Copy(Buf,2,(Length(Buf) - 1)); - Counter := Pos('`',Buf); - IF (Counter <> 0) THEN - BEGIN - Cmd := AllCaps(Copy(Buf,1,(Counter - 1))); - Buf := Copy(Buf,(Counter + 1),(Length(Buf) - Counter)); - NL; - Exit; - END; - END; - - SHas0 := '?'; - SHas1 := ''; - Has0 := FALSE; - Has1 := FALSE; - Has2 := FALSE; - - - FOR CmdToExec := 1 TO NumCmds DO - IF ((CmdToExec <= (NumCmds - GlobalCmds)) OR NOT (NoGlobalUsed IN MemMenu.MenuFlags)) THEN - IF (AACS(MemCmd^[CmdToExec].ACS)) THEN - IF (MemCmd^[CmdToExec].CKeys[0] = #1) THEN - BEGIN - Has0 := TRUE; - SHas0 := SHas0 + MemCmd^[CmdToExec].CKeys; - END - ELSE IF ((MemCmd^[CmdToExec].CKeys[1] = '/') AND (MemCmd^[CmdToExec].CKeys[0] = #2)) THEN - BEGIN - Has1 := TRUE; - SHas1 := SHas1 + MemCmd^[CmdToExec].CKeys[2]; - END - ELSE - Has2 := TRUE; - - SaveCurrentColor := CurrentColor; - - GotCmd := FALSE; - SS := ''; - - IF (Trapping) THEN - Flush(TrapFile); - - IF (NOT (HotKey IN ThisUser.Flags)) OR (ForceLine IN MemMenu.MenuFlags) THEN - InputMain(Cmd,60,[UpperOnly,NoLineFeed]) - ELSE - BEGIN - - REPEAT - - Key := GetKey; - IF (Key = F_UP) OR (Key = F_DOWN) OR (Key = F_LEFT) OR (Key = F_RIGHT) THEN - BEGIN - CASE Key OF - F_UP : IF (Pos(#255,MenuKeys) > 0) THEN - BEGIN - Cmd := 'UP_ARROW'; - GotCmd := TRUE; - Exit; - END; - F_DOWN : - IF (Pos(#254,MenuKeys) > 0) THEN - BEGIN - Cmd := 'DOWN_ARROW'; - GotCmd := TRUE; - Exit; - END; - F_LEFT : - IF (Pos(#253,MenuKeys) > 0) THEN - BEGIN - Cmd := 'LEFT_ARROW'; - GotCmd := TRUE; - Exit; - END; - F_RIGHT : - IF (Pos(#252,MenuKeys) > 0) THEN - BEGIN - Cmd := 'RIGHT_ARROW'; - GotCmd := TRUE; - Exit; - END; - END; - END; - - C := UpCase(Char(Key)); - SaveSS := SS; - IF (SS = '') THEN - BEGIN - IF (C = #13) THEN - GotCmd := TRUE; - IF ((C = '/') AND ((Has1) OR (Has2) OR (SysOp))) THEN - SS := '/'; - IF (((FQArea) OR (RQArea) OR (MQArea) OR (VQArea)) AND (C IN ['0'..'9'])) THEN - BEGIN - SS := C; - IF (RQArea) AND (HiMsg <= 9) THEN - GotCmd := TRUE - ELSE IF (FQArea) AND (NumFileAreas <= 9) THEN - GotCmd := TRUE - ELSE IF (MQArea) AND (NumMsgAreas <= 9) THEN - GotCmd := TRUE - ELSE IF (VQArea) AND (GetTopics <= 9) THEN - GotCmd := TRUE; - END - ELSE IF (Pos(C,SHas0) <> 0) THEN - BEGIN - GotCmd := TRUE; - SS := C; - END; - END - ELSE IF (SS = '/') THEN - BEGIN - IF (C = ^H) THEN - SS := ''; - IF ((C = '/') AND ((Has2) OR (SysOp))) THEN - SS := SS + '/'; - IF ((Pos(C,SHas1) <> 0) AND (Has1)) THEN - BEGIN - GotCmd := TRUE; - SS := SS + C; - END; - END - ELSE IF (Copy(SS,1,2) = '//') THEN - BEGIN - IF (C = #13) THEN - GotCmd := TRUE - ELSE IF (C = ^H) THEN - Dec(SS[0]) - ELSE IF (C = ^X) THEN - BEGIN - FOR Counter := 1 TO (Length(SS) - 2) DO - BackSpace; - SS := '//'; - SaveSS := SS; - END - ELSE IF ((Length(SS) < 62) AND (C >= #32) AND (C <= #127)) THEN - SS := SS + C; - END - ELSE IF ((Length(SS) >= 1) AND (SS[1] IN ['0'..'9']) AND ((FQArea) OR (RQArea) OR (MQArea) OR (VQArea))) THEN - BEGIN - IF (C = ^H) THEN - Dec(SS[0]); - IF (C = #13) THEN - GotCmd := TRUE; - IF (C IN ['0'..'9']) THEN - BEGIN - SS := SS + C; - IF (VQArea) AND (Length(SS) = Length(IntToStr(GetTopics))) THEN - GotCmd := TRUE - ELSE IF (RQArea) AND (Length(SS) = Length(IntToStr(HiMsg))) THEN - GotCmd := TRUE - ELSE IF (MQArea) AND (Length(SS) = Length(IntToStr(NumMsgAreas))) THEN - GotCmd := TRUE - ELSE IF (FQArea) AND (Length(SS) = Length(IntToStr(NumFileAreas))) THEN - GotCmd := TRUE; - END; - END; - - IF ((Length(SS) = 1) AND (Length(SaveSS) = 2)) THEN - SetC(SaveCurrentColor); - - IF (SaveSS <> SS) AND (NOT (NoMenuPrompt IN MemMenu.MenuFlags)) THEN - BEGIN - IF (Length(SS) > Length(SaveSS)) THEN - Prompt(SS[Length(SS)]); - IF (Length(SS) < Length(SaveSS)) THEN - BackSpace; - END; - - IF ((NOT (SS[1] IN ['0'..'9'])) AND ((Length(SS) = 2) AND (Length(SaveSS) = 1))) THEN - UserColor(6); - - UNTIL ((GotCmd) OR (HangUp)); - - CursorOn(TRUE); - - UserColor(1); - - IF (Copy(SS,1,2) = '//') THEN - SS := Copy(SS,3,(Length(SS) - 2)); - - Cmd := SS; - END; - - (* Test *) - IF (CurMenu <> General.FileListingMenu) THEN - NL; - - IF (Pos(';',Cmd) <> 0) THEN - IF (Copy(Cmd,1,2) <> '\\') THEN - BEGIN - IF (HotKey IN ThisUser.Flags) THEN - BEGIN - S1 := Copy(Cmd,2,(Length(Cmd) - 1)); - IF (Copy(S1,1,1) = '/') THEN - Cmd := Copy(S1,1,2) - ELSE - Cmd := S1[1]; - S1 := Copy(S1,(Length(Cmd) + 1),(Length(S1) - Length(Cmd))); - END - ELSE - BEGIN - S1 := Copy(Cmd,(Pos(';',Cmd) + 1),(Length(Cmd) - Pos(';',Cmd))); - Cmd := Copy(Cmd,1,(Pos(';',Cmd) - 1)); - END; - WHILE (Pos(';',S1) <> 0) DO - S1[Pos(';',S1)] := ^M; - Buf := S1; - END; -END; - -PROCEDURE MainMenuHandle(VAR Cmd: AStr); -VAR - NewArea: Integer; -BEGIN - TLeft; - - CheckForceLevel; - - IF ((ForcePause IN MemMenu.MenuFlags) AND (CurHelpLevel > 1) AND (LastCommandGood)) THEN - PauseScr(FALSE); - LastCommandGood := FALSE; - MenuAborted := FALSE; - Abort := FALSE; - - ShowThisMenu; - - AutoExecCmd('EVERYTIME'); - - IF (General.MultiNode) THEN - Check_Status; - - IF ((NOT (NoMenuPrompt IN MemMenu.MenuFlags)) AND (NOT MenuAborted)) AND NOT - (OKAnsi AND (NoGenericAnsi IN MemMenu.MenuFlags) AND NOT (OkAvatar OR OKRIP)) AND NOT - (OkAvatar AND (NoGenericAvatar IN MemMenu.MenuFlags) AND NOT OkRIP) AND NOT - (OkRIP AND (NoGenericRIP IN MemMenu.MenuFlags)) THEN - BEGIN - - IF (CurMenu <> General.FileListingMenu) THEN - NL; - - IF (AutoTime IN MemMenu.MenuFlags) THEN - Print('^3[Time Left:'+CTim(NSL)+']'); - Prompt(MemMenu.MenuPrompt); - END; - - TempPause := (Pause IN ThisUser.Flags); - - GetCmd(Cmd); - - IF (Cmd = '') AND (Pos(#13,MenuKeys) > 0) THEN - Cmd := 'ENTER'; - - IF (Cmd = '?') THEN - BEGIN - Cmd := ''; - Inc(CurHelpLevel); - IF (CurHelpLevel > 3) THEN - CurHelpLevel := 3; - END - ELSE - CheckHelpLevel; - - CheckForceLevel; - - IF (FQArea) OR (MQArea) OR (VQArea) OR (RQArea) THEN - BEGIN - NewArea := StrToInt(Cmd); - IF ((NewArea <> 0) OR (Cmd[1] = '0')) THEN - BEGIN - IF (FQArea) AND (NewArea >= 1) AND (NewArea <= NumFileAreas) THEN - ChangeFileArea(CompFileArea(NewArea,1)) - ELSE IF (MQArea) AND (NewArea >= 1) AND (NewArea <= NumMsgAreas) THEN - ChangeMsgArea(CompMsgArea(NewArea,1)) - ELSE IF (VQArea) AND (NewArea >= 1) AND (NewArea <= NumVotes) THEN - VoteOne(NewArea) - ELSE IF (RQArea) AND (NewArea >= 1) AND (NewArea <= HiMsg) THEN - IF NOT (MAForceRead IN MemMsgArea.MAFlags) OR (NewArea <= Msg_On) THEN - BEGIN - Msg_On := (NewArea - 1); - TReadPrompt := 18; - END - ELSE - Print('You must read all of the messages in this area.'); - Cmd := ''; - END; - END; -END; - -PROCEDURE FCmd(CONST Cmd: AStr; VAR CmdToExec: Byte; VAR CmdExists,CmdNotHid: Boolean); -VAR - Done: Boolean; -BEGIN - Done := FALSE; - REPEAT - Inc(CmdToExec); - IF (CmdToExec <= NumCmds) AND (Cmd = MemCmd^[CmdToExec].CKeys) THEN - BEGIN - CmdExists := TRUE; - IF (OkSecurity(CmdToExec,CmdNotHid)) THEN - Done := TRUE; - END; - IF ((CmdToExec > (NumCmds - GlobalCmds)) AND (NoGlobalUsed IN MemMenu.MenuFlags)) THEN - BEGIN - CmdToExec := 0; - CmdExists := FALSE; - Done := TRUE; - END; - UNTIL (CmdToExec > NumCmds) OR (Done) OR (HangUp); - IF (CmdToExec > NumCmds) THEN - CmdToExec := 0; -END; - -PROCEDURE DoMenuExec(Cmd: AStr; VAR NewMenuCmd: AStr); -VAR - CmdToExec: Byte; - CmdACS, - CmdNotHid, - CmdExists, - Done: Boolean; -BEGIN - IF (NewMenuCmd <> '') THEN - BEGIN - Cmd := NewMenuCmd; - NewMenuCmd := ''; - END; - CmdACS := FALSE; - CmdExists := FALSE; - CmdNotHid := FALSE; - Done := FALSE; - CmdToExec := 0; - REPEAT - FCmd(Cmd,CmdToExec,CmdExists,CmdNotHid); - IF (CmdToExec <> 0) THEN - BEGIN - CmdACS := TRUE; - DoMenuCommand(Done, - MemCmd^[CmdToExec].CmdKeys, - MemCmd^[CmdToExec].Options, - NewMenuCmd, - MemCmd^[CmdToExec].NodeActivityDesc); - END; - UNTIL ((CmdToExec = 0) OR (Done) OR (HangUp)); - IF (NOT Done) AND (Cmd <> '') THEN - IF ((NOT CmdACS) AND (Cmd <> '')) THEN - BEGIN - NL; - IF ((CmdNotHid) AND (CmdExists)) THEN - Print('Insufficient clearence for this command.') - ELSE - Print('Invalid command.'); - END; -END; - -PROCEDURE DoMenuCommand(VAR Done: Boolean; - Cmd, - MenuOption: AStr; - VAR NewMenuCmd: AStr; - NodeActivityDesc: AStr); -VAR - MHeader: MHeaderRec; - TempStr: AStr; - SaveMenu: Byte; - NoCmd: Boolean; -BEGIN - NewMenuToLoad := FALSE; - NewMenuCmd := ''; - NoCmd := FALSE; - Abort := FALSE; - LastCommandOvr := FALSE; - - IF ((Cmd[1] + Cmd[2]) <> 'NW') THEN - Update_Node(NodeActivityDesc,TRUE); - - CASE Cmd[1] OF - '$' : CASE Cmd[2] OF - 'D' : Deposit; - 'W' : Withdraw; - '+' : Inc(ThisUser.lCredit,StrToInt(MenuOption)); - '-' : Inc(ThisUser.Debit,StrToInt(MenuOption)); - ELSE - NoCmd := TRUE; - END; - '/' : CASE Cmd[2] OF - 'F': BEGIN - MCIAllowed := FALSE; - PrintF(MCI(MenuOption)); - MCIAllowed := TRUE; - END; - ELSE - NoCmd := TRUE; - END; - '-' : CASE Cmd[2] OF - 'C' : lStatus_Screen(100,MenuOption,FALSE,MenuOption); - 'F' : PrintF(MCI(MenuOption)); - 'L' : Prompt(MenuOption); - 'Q' : ReadQ(General.MiscPath+MenuOption); - 'R' : ReadASW1(MenuOption); - 'S' : SysOpLog(MCI(MenuOption)); - ';' : BEGIN - TempStr := MenuOption; - WHILE (Pos(';',TempStr) > 0) DO - TempStr[Pos(';',TempStr)] := ^M; - Buf := TempStr; - END; - '$' : IF (SemiCmd(MenuOption,1) <> '') THEN - BEGIN - IF (SemiCmd(MenuOption,2) = '') THEN - Prt(': ') - ELSE - Prt(SemiCmd(MenuOption,2)); - GetPassword(TempStr,20); - IF (TempStr <> SemiCmd(MenuOption,1)) THEN - BEGIN - Done := TRUE; - IF (SemiCmd(MenuOption,3) <> '') THEN - Print(SemiCmd(MenuOption,3)); - END; - END; - 'Y' : IF (SemiCmd(MenuOption,1) <> '') AND NOT (PYNQ(SemiCmd(MenuOption,1),0,FALSE)) THEN - BEGIN - Done := TRUE; - IF (SemiCmd(MenuOption,2) <> '') THEN - Print(SemiCmd(MenuOption,2)); - END; - 'N' : IF (SemiCmd(MenuOption,1) <> '') AND (PYNQ(SemiCmd(MenuOption,1),0,FALSE)) THEN - BEGIN - Done := TRUE; - IF (SemiCmd(MenuOption,2) <> '') THEN - Print(SemiCmd(MenuOption,2)); - END; - '^','/','\' : - DoChangeMenu(Done,NewMenuCmd,Cmd[2],MenuOption); - ELSE - NoCmd := TRUE; - END; - 'A' : CASE Cmd[2] OF - 'A','C','M','T' : - DoArcCommand(Cmd[2]); - 'E' : ExtractToTemp; - 'G' : UserArchive; - 'R' : ReZipStuff; - ELSE - NoCmd := TRUE; - END; - 'B' : CASE Cmd[2] OF - '?' : BatchDLULInfo; - - 'C' : IF (UpCase(MenuOption[1]) = 'U') THEN - ClearBatchULQueue - ELSE - ClearBatchDLQueue; - 'D' : BatchDownload; - 'L' : IF (UpCase(MenuOption[1]) = 'U') THEN - ListBatchULFiles - ELSE - ListBatchDLFiles; - 'R' : IF (UpCase(MenuOption[1]) = 'U') THEN - RemoveBatchULFiles - ELSE - RemoveBatchDLFiles; - - 'U' : BatchUpload(FALSE,0); - ELSE - NoCmd := TRUE; - END; - 'D' : CASE Cmd[2] OF - 'P','C','D','G','S','W','-','3' : - DoDoorFunc(Cmd[2],MenuOption); - ELSE - NoCmd := TRUE; - END; - 'F' : CASE Cmd[2] OF - 'A' : FileAreaChange(Done,MenuOption); - 'B' : DownloadFile(MenuOption,[lIsAddDLBatch]); - 'C' : CheckFilesBBS; - 'D' : DownloadFile(MenuOption,[]); - 'F' : SearchFileDescriptions; - 'L' : ListFileSpec(MenuOption); - 'N' : NewFilesScanSearchType(MenuOption); - 'P' : SetFileAreaNewScanDate; - 'S' : SearchFileSpec; - 'U' : UploadFile; - 'V' : ViewDirInternalArchive; - 'Z' : ToggleFileAreaScanFlags; - '@' : CreateTempDir; - '#' : BEGIN - NL; - Print('Enter the number of a file area to change to.'); - IF (Novice IN ThisUser.Flags) THEN - PauseScr(FALSE); - END; - ELSE - NoCmd := TRUE; - END; - 'H' : CASE Cmd[2] OF - 'C' : IF PYNQ(MenuOption,0,FALSE) THEN - BEGIN - CLS; - PrintF('LOGOFF'); - HangUp := TRUE; - HungUp := FALSE; - END; - 'I' : HangUp := TRUE; - 'M' : BEGIN - NL; - Print(MenuOption); - HangUp := TRUE; - END; - ELSE - NoCmd := TRUE; - END; - 'L' : CASE Cmd[2] OF - '1' : TFilePrompt := 1; - '2' : TFilePrompt := 2; - '3' : TFilePrompt := 3; - '4' : TFilePrompt := 4; - '5' : TFilePrompt := 5; - '6' : TFilePrompt := 6; - '7' : TFilePrompt := 7; - '8' : TFilePrompt := 8; - ELSE - NoCmd := TRUE; - END; - 'M' : CASE Cmd[2] OF - 'A' : MessageAreaChange(Done,MenuOption); - 'E' : SSMail(MenuOption); - 'K' : ShowEMail; - 'L' : SMail(TRUE); - 'M' : ReadMail; - 'N' : StartNewScan(MenuOption); - 'P' : IF (ReadMsgArea = -1) THEN - BEGIN - NL; - Print('^7This option is not available when reading private messages!^1'); - END - ELSE - BEGIN - IF (MAPrivate IN MemMsgArea.MAFlags) THEN - BEGIN - NL; - Post(-1,MHeader.From,PYNQ('Is this to be a private message? ',0,FALSE)) - END - ELSE - Post(-1,MHeader.From,FALSE); - END; - 'R' : ReadAllMessages(MenuOption); - 'S' : BEGIN - Abort := FALSE; - Next := FALSE; - ScanMessages(MsgArea,FALSE,MenuOption); - END; - 'U' : BEGIN - LoadMsgArea(MsgArea); - UList(MemMsgArea.ACS); - END; - 'Y' : ScanYours; - 'Z' : ToggleMsgAreaScanFlags; - '#' : BEGIN - NL; - Print('Enter the number of a message area to change to.'); - IF (Novice IN ThisUser.Flags) THEN - PauseScr(FALSE); - END; - ELSE - NoCmd := TRUE; - END; - 'N' : CASE Cmd[2] OF - 'A' : ToggleChatAvailability; - 'D' : Dump_Node; - 'O' : BEGIN - LListNodes; - IF (Novice IN ThisUser.Flags) THEN - PauseScr(FALSE); - END; - 'P' : Page_User; - 'G' : MultiLine_Chat; - 'S' : LSend_Message(MenuOption); - 'T' : IF AACS(General.Invisible) THEN - BEGIN - IsInvisible := NOT IsInvisible; - LoadNode(ThisNode); - IF (IsInvisible) THEN - Include(NodeR.Status,NInvisible) - ELSE - Exclude(NodeR.Status,NInvisible); - SaveNode(ThisNode); - NL; - Print('Invisible mode is now '+ShowOnOff(IsInvisible)); - END; - (* Consider deleting this cmd *) - 'W' : BEGIN - LoadNode(ThisNode); - NodeR.ActivityDesc := MenuOption; - SaveNode(ThisNode); - END; - ELSE - NoCmd := TRUE; - END; - 'O' : CASE Cmd[2] OF - '1','2' : - TShuttleLogon := Ord(Cmd[2]) - 48; - 'A' : AutoValidationCmd(MenuOption); - 'B' : GetUserStats(MenuOption); - 'C' : RequestSysOpChat(MenuOption); - 'F' : ChangeARFlags(MenuOption); - 'G' : ChangeACFlags(MenuOption); - 'L' : BEGIN - IF (Pos(';',MenuOption) > 0) THEN - BEGIN - MenuOption := Copy(MenuOption,Pos(';',MenuOption) + 1,(Length(MenuOption)) - (Pos(';',MenuOption))); - TempStr := Copy(MenuOption,1,(Pos(';',MenuOption) - 1)); - END - ELSE - TempStr := '0'; - TodaysCallers(StrToInt(TempStr),MenuOption); - END; - 'P' : CStuff(StrToInt(MenuOption),2,ThisUser); - 'R' : ChangeConference(MenuOption); - 'S' : Bulletins(MenuOption); - 'U' : UList(MenuOption); - ELSE - NoCmd := TRUE; - END; - 'Q' : CASE Cmd[2] OF - 'Q' : RGQuote(MenuOption); - ELSE - NoCmd := TRUE; - END; - 'R' : CASE Cmd[2] OF - '#' : BEGIN - NL; - Print('Enter the number of a message to read it.'); - END; - 'A' : TReadPrompt := 1; - '-' : IF (Msg_On > 1) THEN - TReadPrompt := 2 - ELSE - BEGIN - NL; - Print('You are already at the first message.'); - END; - 'M' : TReadPrompt := 3; - 'X' : TReadPrompt := 4; - 'E' : TReadPrompt := 5; - 'R' : TReadPrompt := 6; - 'I' : IF (NOT (MAForceRead IN MemMsgArea.MAFlags)) OR (CoSysOp) THEN - TReadPrompt := 7 - ELSE - Print('You must read all of the messages in this area.'); - 'B' : TReadPrompt := 8; - 'F' : TReadPrompt := 9; - 'C' : TReadPrompt := 10; - 'D' : TReadPrompt := 11; - 'H' : TReadPrompt := 12; - 'G' : IF (NOT (MAForceRead IN MemMsgArea.MAFlags)) OR (CoSysOp) THEN - TReadPrompt := 13 - ELSE - Print('^7You must read all of the messages in this area!^1'); - 'Q' : IF (NOT (MAForceRead IN MemMsgArea.MAFlags)) OR (CoSysOp) THEN - TReadPrompt := 14 - ELSE - Print('^7You must read all of the messages in this area!^1'); - 'L' : TReadPrompt := 15; - 'U' : TReadPrompt := 16; - 'T' : TReadPrompt := 17; - 'N' : TReadPrompt := 18; - 'S' : TReadPrompt := 19; - 'V' : TReadPrompt := 20; - 'J' : TReadPrompt := 21; - ELSE - NoCmd := TRUE; - END; - 'U' : CASE Cmd[2] OF - 'A' : ReplyAutoMsg; - 'R' : ReadAutoMsg; - 'W' : WriteAutoMsg; - ELSE - NoCmd := TRUE; - END; - 'V' : CASE Cmd[2] OF - '#' : BEGIN - NL; - Print('Enter the number of the topic to vote on.'); - IF (Novice IN ThisUser.Flags) THEN - PauseScr(FALSE); - END; - 'A' : AddTopic; - 'L' : ListTopics(TRUE); - 'R' : Results(FALSE); - 'T' : TrackUser; - 'U' : Results(TRUE); - 'V' : VoteAll; - ELSE - NoCmd := TRUE; - END; - 'T' : CASE Cmd[2] OF - 'A' : BBSList_Add; - 'E' : BBSList_Edit; - 'D' : BBSList_Delete; - 'V' : BBSList_View; - 'X' : BBSList_xView; - ELSE - NoCmd := TRUE; - END; - '!' : CASE Cmd[2] OF - 'P' : SetMessageAreaNewScanDate; - 'D' : DownloadPacket; - 'U' : UploadPacket(FALSE); - ELSE - NoCmd := TRUE; - END; - '*' : CASE Cmd[2] OF - '=' : ShowCmds(MenuOption); - 'B' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Message Area Editor'); - MessageAreaEditor; - END; - 'C' : IF (CheckPW) THEN - ChangeUser; - 'D' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Entered Dos Emulator'); - MiniDOS; - END; - 'E' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Event Editor'); - EventEditor; - END; - 'F' : IF (CheckPW) THEN - BEGIN - SysOpLog('* File Area Editor'); - FileAreaEditor; - END; - 'V' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Vote Editor'); - VotingEditor; - END; - 'L' : IF (CheckPW) THEN - ShowLogs; - 'N' : TEdit1; - 'P' : IF (CheckPW) THEN - BEGIN - SysOpLog('* System Configuration Editor'); - SystemConfigurationEditor; - END; - 'R' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Conference Editor'); - ConferenceEditor; - END; - 'U' : IF (CheckPW) THEN - BEGIN - SysOpLog('* User Editor'); - UserEditor(UserNum); - END; - 'X' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Protocol Editor'); - ProtocolEditor; - END; - 'Z' : BEGIN - SysOpLog('* History Editor'); - HistoryEditor; - END; - '1' : BEGIN - SysOpLog('* Edited Files'); - EditFiles; - END; - '2' : BEGIN - SysOpLog('* Sorted Files'); - Sort; - END; - '3' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Read Private Messages'); - ReadAllMessages(''); - END; - '4' : IF (MenuOption = '') THEN - Do_Unlisted_Download - ELSE - UnlistedDownload(MenuOption); - '5' : BEGIN - SysOpLog('* Rechecked files'); - ReCheck; - END; - '6' : IF (CheckPW) THEN - UploadAll; - '7' : ValidateFiles; - '8' : AddGIFSpecs; - '9' : PackMessageAreas; - '#' : IF (CheckPW) THEN - BEGIN - SysOpLog('* Menu Editor'); - SaveMenu := CurMenu; - MenuEditor; - CurMenu := SaveMenu; - LoadMenu; - END; - '$' : DirF(TRUE); - '%' : DirF(FALSE); - ELSE - NoCmd := TRUE; - END; - ELSE - NoCmd := TRUE; - END; - LastCommandGood := NOT NoCmd; - IF (LastCommandOvr) THEN - LastCommandGood := FALSE; - IF (NoCmd) THEN - IF (CoSysOp) THEN - BEGIN - TempStr := 'Invalid command keys: '+Cmd[1]+Cmd[2]+' '+Cmd; - NL; - Print(TempStr); - SysOpLog(TempStr); - END; - - IF ((Cmd[1] + Cmd[2]) <> 'NW') THEN - Update_Node('',FALSE); - - IF (NewMenuToLoad) THEN - BEGIN - LoadMenuPW; - LastCommandGood := FALSE; - IF (NewMenuCmd = '') THEN - AutoExecCmd('FIRSTCMD'); - END; -END; - -END. +{$IFDEF WIN32} +{$I DEFINES.INC} +{$ENDIF} + +{$A+,B-,D+,E-,F+,I-,L+,N-,O-,R-,S+,V-} + +UNIT Menus; + +INTERFACE + +USES + Common, + MyIO; + +PROCEDURE AutoExecCmd(AutoCmd: AStr); +PROCEDURE MenuExec; +PROCEDURE LoadMenuPW; +PROCEDURE MainMenuHandle(VAR Cmd: AStr); +PROCEDURE FCmd(CONST Cmd: AStr; VAR CmdToExec: Byte; VAR CmdExists,CmdNotHid: Boolean); +PROCEDURE DoMenuExec(Cmd: AStr; VAR NewMenuCmd: AStr); +PROCEDURE DoMenuCommand(VAR Done: Boolean; + Cmd, + MenuOption: AStr; + VAR NewMenuCmd: AStr; + NodeActivityDesc: AStr); + +IMPLEMENTATION + +USES + Arcview, + Archive1, + Archive2, + Archive3, + Automsg, + BBSList, + Boot, + Bulletin, + CUser, + Doors, + Email, + Events, + File0, + File1, + File2, + File3, + File5, + File6, + File7, + File8, + File9, + File10, + File11, + File12, + File13, + File14, + Mail0, + Mail1, + Mail2, + Mail3, + Mail4, + Menus2, + Menus3, + MiscUser, + MsgPack, + Multnode, + OffLine, + Script, + Stats, + LineChat, + Sysop1, + Sysop2, + SysOp2G, + Sysop3, + Sysop4, + SysOp5, + Sysop6, + Sysop7, + Sysop8, + Sysop9, + Sysop10, + Sysop11, + SysOp12, + TimeBank, + TimeFunc, + Vote, + OneLiner; + + + (* + I := 1; + Newmenucmd := ''; + while ((I <= Noc) and (Newmenucmd = '') ) do + begin + if (Menucommand^[I].Ckeys = 'FIRSTCMD') then + begin + if (Aacs(Menucommand^[I].Acs)) then + begin + Newmenucmd := 'FIRSTCMD'; + Domenuexec(Cmd,Newmenucmd); + end; + end; + inc(I); + end; + *) +PROCEDURE AutoExecCmd(AutoCmd: AStr); +VAR + NewMenuCmd: AStr; + Counter: Byte; + Done: Boolean; +BEGIN + NewMenuCmd := ''; + Done := FALSE; + Counter := 1; + WHILE (Counter <= NumCmds) AND (NewMenuCmd = '') AND (NOT Done) AND (NOT HangUp) DO + BEGIN + IF (MemCmd^[Counter].Ckeys = AutoCmd) then + IF (AACS(MemCmd^[Counter].ACS)) THEN + BEGIN + NewMenuCmd := AutoCmd; + DoMenuCommand(Done, + MemCmd^[Counter].CmdKeys, + MemCmd^[Counter].Options, + NewMenuCmd, + MemCmd^[Counter].NodeActivityDesc); + END; + Inc(Counter); + END; +END; + +PROCEDURE MenuExec; +VAR + Cmd, + NewMenuCmd: AStr; + Done: Boolean; +BEGIN + MainMenuHandle(Cmd); + IF ((Copy(Cmd,1,2) = '\\') AND (SysOp)) THEN + BEGIN + DoMenuCommand(Done,Copy(Cmd,1,2),Copy(Cmd,3,Length(Cmd) - 2),NewMenuCmd,'Activating SysOp Cmd'); + IF (NewMenuCmd <> '') THEN + Cmd := NewMenuCmd + ELSE + Cmd := ''; + END; + NewMenuCmd := ''; + REPEAT + DoMenuExec(Cmd,NewMenuCmd) + UNTIL (NewMenuCmd = '') OR (HangUp); +END; + +PROCEDURE CheckHelpLevel; +BEGIN + IF (MemMenu.ForceHelpLevel <> 0) THEN + CurHelpLevel := MemMenu.ForceHelpLevel + ELSE IF (Novice IN ThisUser.Flags) OR (OkRIP) THEN + CurHelpLevel := 2 + ELSE + CurHelpLevel := 1; +END; + +PROCEDURE LoadMenuPW; +VAR + s: Str20; + NACC: Boolean; +BEGIN + LoadMenu; + NACC := FALSE; + IF (NOT AACS(MemMenu.ACS)) OR (MemMenu.Password <> '') THEN + BEGIN + NACC := TRUE; + IF (MemMenu.Password <> '') THEN + BEGIN + NL; + Prt('Password: '); + GetPassword(s,20); + IF (s = MemMenu.Password) THEN + NACC := FALSE; + END; + IF (NACC) THEN + BEGIN + PrintF('NOACCESS'); + IF (NoFile) THEN + BEGIN + NL; + Print('Access denied.'); + PauseScr(FALSE); + END; + CurMenu := FallBackMenu; + LoadMenu; + END; + END; + IF (NOT NACC) THEN + CheckHelpLevel; +END; + +PROCEDURE CheckForceLevel; +BEGIN + IF (CurHelpLevel < MemMenu.ForceHelpLevel) THEN + CurHelpLevel := MemMenu.ForceHelpLevel; +END; + +PROCEDURE GetCmd(VAR Cmd: AStr); +VAR + S1, + SS, + SaveSS, + SHas0, + SHas1: AStr; + C: Char; + CmdToExec, + Counter, + SaveCurrentColor: Byte; + Key: Word; + GotCmd, + Has0, + Has1, + Has2: Boolean; +BEGIN + Cmd := ''; + IF (Buf <> '') THEN + IF (Buf[1] = '`') THEN + BEGIN + Buf := Copy(Buf,2,(Length(Buf) - 1)); + Counter := Pos('`',Buf); + IF (Counter <> 0) THEN + BEGIN + Cmd := AllCaps(Copy(Buf,1,(Counter - 1))); + Buf := Copy(Buf,(Counter + 1),(Length(Buf) - Counter)); + NL; + Exit; + END; + END; + + SHas0 := '?'; + SHas1 := ''; + Has0 := FALSE; + Has1 := FALSE; + Has2 := FALSE; + + + FOR CmdToExec := 1 TO NumCmds DO + IF ((CmdToExec <= (NumCmds - GlobalCmds)) OR NOT (NoGlobalUsed IN MemMenu.MenuFlags)) THEN + IF (AACS(MemCmd^[CmdToExec].ACS)) THEN + IF (MemCmd^[CmdToExec].CKeys[0] = #1) THEN + BEGIN + Has0 := TRUE; + SHas0 := SHas0 + MemCmd^[CmdToExec].CKeys; + END + ELSE IF ((MemCmd^[CmdToExec].CKeys[1] = '/') AND (MemCmd^[CmdToExec].CKeys[0] = #2)) THEN + BEGIN + Has1 := TRUE; + SHas1 := SHas1 + MemCmd^[CmdToExec].CKeys[2]; + END + ELSE + Has2 := TRUE; + + SaveCurrentColor := CurrentColor; + + GotCmd := FALSE; + SS := ''; + + IF (Trapping) THEN + Flush(TrapFile); + + IF (NOT (HotKey IN ThisUser.Flags)) OR (ForceLine IN MemMenu.MenuFlags) THEN + InputMain(Cmd,60,[UpperOnly,NoLineFeed]) + ELSE + BEGIN + + REPEAT + + Key := GetKey; + IF (Key = F_UP) OR (Key = F_DOWN) OR (Key = F_LEFT) OR (Key = F_RIGHT) THEN + BEGIN + CASE Key OF + F_UP : IF (Pos(#255,MenuKeys) > 0) THEN + BEGIN + Cmd := 'UP_ARROW'; + GotCmd := TRUE; + Exit; + END; + F_DOWN : + IF (Pos(#254,MenuKeys) > 0) THEN + BEGIN + Cmd := 'DOWN_ARROW'; + GotCmd := TRUE; + Exit; + END; + F_LEFT : + IF (Pos(#253,MenuKeys) > 0) THEN + BEGIN + Cmd := 'LEFT_ARROW'; + GotCmd := TRUE; + Exit; + END; + F_RIGHT : + IF (Pos(#252,MenuKeys) > 0) THEN + BEGIN + Cmd := 'RIGHT_ARROW'; + GotCmd := TRUE; + Exit; + END; + END; + END; + + C := UpCase(Char(Key)); + SaveSS := SS; + IF (SS = '') THEN + BEGIN + IF (C = #13) THEN + GotCmd := TRUE; + IF ((C = '/') AND ((Has1) OR (Has2) OR (SysOp))) THEN + SS := '/'; + IF (((FQArea) OR (RQArea) OR (MQArea) OR (VQArea)) AND (C IN ['0'..'9'])) THEN + BEGIN + SS := C; + IF (RQArea) AND (HiMsg <= 9) THEN + GotCmd := TRUE + ELSE IF (FQArea) AND (NumFileAreas <= 9) THEN + GotCmd := TRUE + ELSE IF (MQArea) AND (NumMsgAreas <= 9) THEN + GotCmd := TRUE + ELSE IF (VQArea) AND (GetTopics <= 9) THEN + GotCmd := TRUE; + END + ELSE IF (Pos(C,SHas0) <> 0) THEN + BEGIN + GotCmd := TRUE; + SS := C; + END; + END + ELSE IF (SS = '/') THEN + BEGIN + IF (C = ^H) THEN + SS := ''; + IF ((C = '/') AND ((Has2) OR (SysOp))) THEN + SS := SS + '/'; + IF ((Pos(C,SHas1) <> 0) AND (Has1)) THEN + BEGIN + GotCmd := TRUE; + SS := SS + C; + END; + END + ELSE IF (Copy(SS,1,2) = '//') THEN + BEGIN + IF (C = #13) THEN + GotCmd := TRUE + ELSE IF (C = ^H) THEN + Dec(SS[0]) + ELSE IF (C = ^X) THEN + BEGIN + FOR Counter := 1 TO (Length(SS) - 2) DO + BackSpace; + SS := '//'; + SaveSS := SS; + END + ELSE IF ((Length(SS) < 62) AND (C >= #32) AND (C <= #127)) THEN + SS := SS + C; + END + ELSE IF ((Length(SS) >= 1) AND (SS[1] IN ['0'..'9']) AND ((FQArea) OR (RQArea) OR (MQArea) OR (VQArea))) THEN + BEGIN + IF (C = ^H) THEN + Dec(SS[0]); + IF (C = #13) THEN + GotCmd := TRUE; + IF (C IN ['0'..'9']) THEN + BEGIN + SS := SS + C; + IF (VQArea) AND (Length(SS) = Length(IntToStr(GetTopics))) THEN + GotCmd := TRUE + ELSE IF (RQArea) AND (Length(SS) = Length(IntToStr(HiMsg))) THEN + GotCmd := TRUE + ELSE IF (MQArea) AND (Length(SS) = Length(IntToStr(NumMsgAreas))) THEN + GotCmd := TRUE + ELSE IF (FQArea) AND (Length(SS) = Length(IntToStr(NumFileAreas))) THEN + GotCmd := TRUE; + END; + END; + + IF ((Length(SS) = 1) AND (Length(SaveSS) = 2)) THEN + SetC(SaveCurrentColor); + + IF (SaveSS <> SS) AND (NOT (NoMenuPrompt IN MemMenu.MenuFlags)) THEN + BEGIN + IF (Length(SS) > Length(SaveSS)) THEN + Prompt(SS[Length(SS)]); + IF (Length(SS) < Length(SaveSS)) THEN + BackSpace; + END; + + IF ((NOT (SS[1] IN ['0'..'9'])) AND ((Length(SS) = 2) AND (Length(SaveSS) = 1))) THEN + UserColor(6); + + UNTIL ((GotCmd) OR (HangUp)); + + CursorOn(TRUE); + + UserColor(1); + + IF (Copy(SS,1,2) = '//') THEN + SS := Copy(SS,3,(Length(SS) - 2)); + + Cmd := SS; + END; + + (* Test *) + IF (CurMenu <> General.FileListingMenu) THEN + NL; + + IF (Pos(';',Cmd) <> 0) THEN + IF (Copy(Cmd,1,2) <> '\\') THEN + BEGIN + IF (HotKey IN ThisUser.Flags) THEN + BEGIN + S1 := Copy(Cmd,2,(Length(Cmd) - 1)); + IF (Copy(S1,1,1) = '/') THEN + Cmd := Copy(S1,1,2) + ELSE + Cmd := S1[1]; + S1 := Copy(S1,(Length(Cmd) + 1),(Length(S1) - Length(Cmd))); + END + ELSE + BEGIN + S1 := Copy(Cmd,(Pos(';',Cmd) + 1),(Length(Cmd) - Pos(';',Cmd))); + Cmd := Copy(Cmd,1,(Pos(';',Cmd) - 1)); + END; + WHILE (Pos(';',S1) <> 0) DO + S1[Pos(';',S1)] := ^M; + Buf := S1; + END; +END; + +PROCEDURE MainMenuHandle(VAR Cmd: AStr); +VAR + NewArea: Integer; +BEGIN + TLeft; + + CheckForceLevel; + + IF ((ForcePause IN MemMenu.MenuFlags) AND (CurHelpLevel > 1) AND (LastCommandGood)) THEN + PauseScr(FALSE); + LastCommandGood := FALSE; + MenuAborted := FALSE; + Abort := FALSE; + + ShowThisMenu; + + AutoExecCmd('EVERYTIME'); + + IF (General.MultiNode) THEN + Check_Status; + + IF ((NOT (NoMenuPrompt IN MemMenu.MenuFlags)) AND (NOT MenuAborted)) AND NOT + (OKAnsi AND (NoGenericAnsi IN MemMenu.MenuFlags) AND NOT (OkAvatar OR OKRIP)) AND NOT + (OkAvatar AND (NoGenericAvatar IN MemMenu.MenuFlags) AND NOT OkRIP) AND NOT + (OkRIP AND (NoGenericRIP IN MemMenu.MenuFlags)) THEN + BEGIN + + IF (CurMenu <> General.FileListingMenu) THEN + NL; + + IF (AutoTime IN MemMenu.MenuFlags) THEN + Print('^3[Time Left:'+CTim(NSL)+']'); + Prompt(MemMenu.MenuPrompt); + END; + + TempPause := (Pause IN ThisUser.Flags); + + GetCmd(Cmd); + + IF (Cmd = '') AND (Pos(#13,MenuKeys) > 0) THEN + Cmd := 'ENTER'; + + IF (Cmd = '?') THEN + BEGIN + Cmd := ''; + Inc(CurHelpLevel); + IF (CurHelpLevel > 3) THEN + CurHelpLevel := 3; + END + ELSE + CheckHelpLevel; + + CheckForceLevel; + + IF (FQArea) OR (MQArea) OR (VQArea) OR (RQArea) THEN + BEGIN + NewArea := StrToInt(Cmd); + IF ((NewArea <> 0) OR (Cmd[1] = '0')) THEN + BEGIN + IF (FQArea) AND (NewArea >= 1) AND (NewArea <= NumFileAreas) THEN + ChangeFileArea(CompFileArea(NewArea,1)) + ELSE IF (MQArea) AND (NewArea >= 1) AND (NewArea <= NumMsgAreas) THEN + ChangeMsgArea(CompMsgArea(NewArea,1)) + ELSE IF (VQArea) AND (NewArea >= 1) AND (NewArea <= NumVotes) THEN + VoteOne(NewArea) + ELSE IF (RQArea) AND (NewArea >= 1) AND (NewArea <= HiMsg) THEN + IF NOT (MAForceRead IN MemMsgArea.MAFlags) OR (NewArea <= Msg_On) THEN + BEGIN + Msg_On := (NewArea - 1); + TReadPrompt := 18; + END + ELSE + Print('You must read all of the messages in this area.'); + Cmd := ''; + END; + END; +END; + +PROCEDURE FCmd(CONST Cmd: AStr; VAR CmdToExec: Byte; VAR CmdExists,CmdNotHid: Boolean); +VAR + Done: Boolean; +BEGIN + Done := FALSE; + REPEAT + Inc(CmdToExec); + IF (CmdToExec <= NumCmds) AND (Cmd = MemCmd^[CmdToExec].CKeys) THEN + BEGIN + CmdExists := TRUE; + IF (OkSecurity(CmdToExec,CmdNotHid)) THEN + Done := TRUE; + END; + IF ((CmdToExec > (NumCmds - GlobalCmds)) AND (NoGlobalUsed IN MemMenu.MenuFlags)) THEN + BEGIN + CmdToExec := 0; + CmdExists := FALSE; + Done := TRUE; + END; + UNTIL (CmdToExec > NumCmds) OR (Done) OR (HangUp); + IF (CmdToExec > NumCmds) THEN + CmdToExec := 0; +END; + +PROCEDURE DoMenuExec(Cmd: AStr; VAR NewMenuCmd: AStr); +VAR + CmdToExec: Byte; + CmdACS, + CmdNotHid, + CmdExists, + Done: Boolean; +BEGIN + IF (NewMenuCmd <> '') THEN + BEGIN + Cmd := NewMenuCmd; + NewMenuCmd := ''; + END; + CmdACS := FALSE; + CmdExists := FALSE; + CmdNotHid := FALSE; + Done := FALSE; + CmdToExec := 0; + REPEAT + FCmd(Cmd,CmdToExec,CmdExists,CmdNotHid); + IF (CmdToExec <> 0) THEN + BEGIN + CmdACS := TRUE; + DoMenuCommand(Done, + MemCmd^[CmdToExec].CmdKeys, + MemCmd^[CmdToExec].Options, + NewMenuCmd, + MemCmd^[CmdToExec].NodeActivityDesc); + END; + UNTIL ((CmdToExec = 0) OR (Done) OR (HangUp)); + IF (NOT Done) AND (Cmd <> '') THEN + IF ((NOT CmdACS) AND (Cmd <> '')) THEN + BEGIN + NL; + IF ((CmdNotHid) AND (CmdExists)) THEN + Print('Insufficient clearence for this command.') + ELSE + Print('Invalid command.'); + END; +END; + +PROCEDURE DoMenuCommand(VAR Done: Boolean; + Cmd, + MenuOption: AStr; + VAR NewMenuCmd: AStr; + NodeActivityDesc: AStr); +VAR + MHeader: MHeaderRec; + TempStr: AStr; + SaveMenu: Byte; + NoCmd: Boolean; +BEGIN + NewMenuToLoad := FALSE; + NewMenuCmd := ''; + NoCmd := FALSE; + Abort := FALSE; + LastCommandOvr := FALSE; + + IF ((Cmd[1] + Cmd[2]) <> 'NW') THEN + Update_Node(NodeActivityDesc,TRUE); + + CASE Cmd[1] OF + '$' : CASE Cmd[2] OF + 'D' : Deposit; + 'W' : Withdraw; + '+' : Inc(ThisUser.lCredit,StrToInt(MenuOption)); + '-' : Inc(ThisUser.Debit,StrToInt(MenuOption)); + ELSE + NoCmd := TRUE; + END; + '/' : CASE Cmd[2] OF + 'F': BEGIN + MCIAllowed := FALSE; + PrintF(MCI(MenuOption)); + MCIAllowed := TRUE; + END; + ELSE + NoCmd := TRUE; + END; + '-' : CASE Cmd[2] OF + 'C' : lStatus_Screen(100,MenuOption,FALSE,MenuOption); + 'F' : PrintF(MCI(MenuOption)); + 'L' : Prompt(MenuOption); + 'Q' : ReadQ(General.MiscPath+MenuOption); + 'R' : ReadASW1(MenuOption); + 'S' : SysOpLog(MCI(MenuOption)); + ';' : BEGIN + TempStr := MenuOption; + WHILE (Pos(';',TempStr) > 0) DO + TempStr[Pos(';',TempStr)] := ^M; + Buf := TempStr; + END; + '$' : IF (SemiCmd(MenuOption,1) <> '') THEN + BEGIN + IF (SemiCmd(MenuOption,2) = '') THEN + Prt(': ') + ELSE + Prt(SemiCmd(MenuOption,2)); + GetPassword(TempStr,20); + IF (TempStr <> SemiCmd(MenuOption,1)) THEN + BEGIN + Done := TRUE; + IF (SemiCmd(MenuOption,3) <> '') THEN + Print(SemiCmd(MenuOption,3)); + END; + END; + 'Y' : IF (SemiCmd(MenuOption,1) <> '') AND NOT (PYNQ(SemiCmd(MenuOption,1),0,FALSE)) THEN + BEGIN + Done := TRUE; + IF (SemiCmd(MenuOption,2) <> '') THEN + Print(SemiCmd(MenuOption,2)); + END; + 'N' : IF (SemiCmd(MenuOption,1) <> '') AND (PYNQ(SemiCmd(MenuOption,1),0,FALSE)) THEN + BEGIN + Done := TRUE; + IF (SemiCmd(MenuOption,2) <> '') THEN + Print(SemiCmd(MenuOption,2)); + END; + '^','/','\' : + DoChangeMenu(Done,NewMenuCmd,Cmd[2],MenuOption); + ELSE + NoCmd := TRUE; + END; + '1' : CASE Cmd[2] OF + 'L' : DoOneLiners; + END; + 'A' : CASE Cmd[2] OF + 'A','C','M','T' : + DoArcCommand(Cmd[2]); + 'E' : ExtractToTemp; + 'G' : UserArchive; + 'R' : ReZipStuff; + ELSE + NoCmd := TRUE; + END; + 'B' : CASE Cmd[2] OF + '?' : BatchDLULInfo; + + 'C' : IF (UpCase(MenuOption[1]) = 'U') THEN + ClearBatchULQueue + ELSE + ClearBatchDLQueue; + 'D' : BatchDownload; + 'L' : IF (UpCase(MenuOption[1]) = 'U') THEN + ListBatchULFiles + ELSE + ListBatchDLFiles; + 'R' : IF (UpCase(MenuOption[1]) = 'U') THEN + RemoveBatchULFiles + ELSE + RemoveBatchDLFiles; + + 'U' : BatchUpload(FALSE,0); + ELSE + NoCmd := TRUE; + END; + 'D' : CASE Cmd[2] OF + 'P','C','D','G','S','W','-','3' : + DoDoorFunc(Cmd[2],MenuOption); + ELSE + NoCmd := TRUE; + END; + 'F' : CASE Cmd[2] OF + 'A' : FileAreaChange(Done,MenuOption); + 'B' : DownloadFile(MenuOption,[lIsAddDLBatch]); + 'C' : CheckFilesBBS; + 'D' : DownloadFile(MenuOption,[]); + 'F' : SearchFileDescriptions; + 'L' : ListFileSpec(MenuOption); + 'N' : NewFilesScanSearchType(MenuOption); + 'P' : SetFileAreaNewScanDate; + 'S' : SearchFileSpec; + 'U' : UploadFile; + 'V' : ViewDirInternalArchive; + 'Z' : ToggleFileAreaScanFlags; + '@' : CreateTempDir; + '#' : BEGIN + NL; + Print('Enter the number of a file area to change to.'); + IF (Novice IN ThisUser.Flags) THEN + PauseScr(FALSE); + END; + ELSE + NoCmd := TRUE; + END; + 'H' : CASE Cmd[2] OF + 'C' : IF PYNQ(MenuOption,0,FALSE) THEN + BEGIN + CLS; + PrintF('LOGOFF'); + HangUp := TRUE; + HungUp := FALSE; + END; + 'I' : HangUp := TRUE; + 'M' : BEGIN + NL; + Print(MenuOption); + HangUp := TRUE; + END; + ELSE + NoCmd := TRUE; + END; + 'L' : CASE Cmd[2] OF + '1' : TFilePrompt := 1; + '2' : TFilePrompt := 2; + '3' : TFilePrompt := 3; + '4' : TFilePrompt := 4; + '5' : TFilePrompt := 5; + '6' : TFilePrompt := 6; + '7' : TFilePrompt := 7; + '8' : TFilePrompt := 8; + ELSE + NoCmd := TRUE; + END; + 'M' : CASE Cmd[2] OF + 'A' : MessageAreaChange(Done,MenuOption); + 'E' : SSMail(MenuOption); + 'K' : ShowEMail; + 'L' : SMail(TRUE); + 'M' : ReadMail; + 'N' : StartNewScan(MenuOption); + 'P' : IF (ReadMsgArea = -1) THEN + BEGIN + NL; + Print('^7This option is not available when reading private messages!^1'); + END + ELSE + BEGIN + IF (MAPrivate IN MemMsgArea.MAFlags) THEN + BEGIN + NL; + Post(-1,MHeader.From,PYNQ('Is this to be a private message? ',0,FALSE)) + END + ELSE + Post(-1,MHeader.From,FALSE); + END; + 'R' : ReadAllMessages(MenuOption); + 'S' : BEGIN + Abort := FALSE; + Next := FALSE; + ScanMessages(MsgArea,FALSE,MenuOption); + END; + 'U' : BEGIN + LoadMsgArea(MsgArea); + UList(MemMsgArea.ACS); + END; + 'Y' : ScanYours; + 'Z' : ToggleMsgAreaScanFlags; + '#' : BEGIN + NL; + Print('Enter the number of a message area to change to.'); + IF (Novice IN ThisUser.Flags) THEN + PauseScr(FALSE); + END; + ELSE + NoCmd := TRUE; + END; + 'N' : CASE Cmd[2] OF + 'A' : ToggleChatAvailability; + 'D' : Dump_Node; + 'O' : BEGIN + LListNodes; + IF (Novice IN ThisUser.Flags) THEN + PauseScr(FALSE); + END; + 'P' : Page_User; + 'G' : MultiLine_Chat; + 'S' : LSend_Message(MenuOption); + 'T' : IF AACS(General.Invisible) THEN + BEGIN + IsInvisible := NOT IsInvisible; + LoadNode(ThisNode); + IF (IsInvisible) THEN + Include(NodeR.Status,NInvisible) + ELSE + Exclude(NodeR.Status,NInvisible); + SaveNode(ThisNode); + NL; + Print('Invisible mode is now '+ShowOnOff(IsInvisible)); + END; + (* Consider deleting this cmd *) + 'W' : BEGIN + LoadNode(ThisNode); + NodeR.ActivityDesc := MenuOption; + SaveNode(ThisNode); + END; + ELSE + NoCmd := TRUE; + END; + 'O' : CASE Cmd[2] OF + '1','2' : + TShuttleLogon := Ord(Cmd[2]) - 48; + 'A' : AutoValidationCmd(MenuOption); + 'B' : GetUserStats(MenuOption); + 'C' : RequestSysOpChat(MenuOption); + 'F' : ChangeARFlags(MenuOption); + 'G' : ChangeACFlags(MenuOption); + 'L' : BEGIN + IF (Pos(';',MenuOption) > 0) THEN + BEGIN + MenuOption := Copy(MenuOption,Pos(';',MenuOption) + 1,(Length(MenuOption)) - (Pos(';',MenuOption))); + TempStr := Copy(MenuOption,1,(Pos(';',MenuOption) - 1)); + END + ELSE + TempStr := '0'; + TodaysCallers(StrToInt(TempStr),MenuOption); + END; + 'P' : CStuff(StrToInt(MenuOption),2,ThisUser); + 'R' : ChangeConference(MenuOption); + 'S' : Bulletins(MenuOption); + 'U' : UList(MenuOption); + ELSE + NoCmd := TRUE; + END; + 'Q' : CASE Cmd[2] OF + 'Q' : RGQuote(MenuOption); + ELSE + NoCmd := TRUE; + END; + 'R' : CASE Cmd[2] OF + '#' : BEGIN + NL; + Print('Enter the number of a message to read it.'); + END; + 'A' : TReadPrompt := 1; + '-' : IF (Msg_On > 1) THEN + TReadPrompt := 2 + ELSE + BEGIN + NL; + Print('You are already at the first message.'); + END; + 'M' : TReadPrompt := 3; + 'X' : TReadPrompt := 4; + 'E' : TReadPrompt := 5; + 'R' : TReadPrompt := 6; + 'I' : IF (NOT (MAForceRead IN MemMsgArea.MAFlags)) OR (CoSysOp) THEN + TReadPrompt := 7 + ELSE + Print('You must read all of the messages in this area.'); + 'B' : TReadPrompt := 8; + 'F' : TReadPrompt := 9; + 'C' : TReadPrompt := 10; + 'D' : TReadPrompt := 11; + 'H' : TReadPrompt := 12; + 'G' : IF (NOT (MAForceRead IN MemMsgArea.MAFlags)) OR (CoSysOp) THEN + TReadPrompt := 13 + ELSE + Print('^7You must read all of the messages in this area!^1'); + 'Q' : IF (NOT (MAForceRead IN MemMsgArea.MAFlags)) OR (CoSysOp) THEN + TReadPrompt := 14 + ELSE + Print('^7You must read all of the messages in this area!^1'); + 'L' : TReadPrompt := 15; + 'U' : TReadPrompt := 16; + 'T' : TReadPrompt := 17; + 'N' : TReadPrompt := 18; + 'S' : TReadPrompt := 19; + 'V' : TReadPrompt := 20; + 'J' : TReadPrompt := 21; + ELSE + NoCmd := TRUE; + END; + 'U' : CASE Cmd[2] OF + 'A' : ReplyAutoMsg; + 'R' : ReadAutoMsg; + 'W' : WriteAutoMsg; + ELSE + NoCmd := TRUE; + END; + 'V' : CASE Cmd[2] OF + '#' : BEGIN + NL; + Print('Enter the number of the topic to vote on.'); + IF (Novice IN ThisUser.Flags) THEN + PauseScr(FALSE); + END; + 'A' : AddTopic; + 'L' : ListTopics(TRUE); + 'R' : Results(FALSE); + 'T' : TrackUser; + 'U' : Results(TRUE); + 'V' : VoteAll; + ELSE + NoCmd := TRUE; + END; + 'T' : CASE Cmd[2] OF + 'A' : BBSList_Add; + 'E' : BBSList_Edit; + 'D' : BBSList_Delete; + 'V' : BBSList_View; + 'X' : BBSList_xView; + ELSE + NoCmd := TRUE; + END; + '!' : CASE Cmd[2] OF + 'P' : SetMessageAreaNewScanDate; + 'D' : DownloadPacket; + 'U' : UploadPacket(FALSE); + ELSE + NoCmd := TRUE; + END; + '*' : CASE Cmd[2] OF + '=' : ShowCmds(MenuOption); + 'B' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Message Area Editor'); + MessageAreaEditor; + END; + 'C' : IF (CheckPW) THEN + ChangeUser; + 'D' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Entered Dos Emulator'); + MiniDOS; + END; + 'E' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Event Editor'); + EventEditor; + END; + 'F' : IF (CheckPW) THEN + BEGIN + SysOpLog('* File Area Editor'); + FileAreaEditor; + END; + 'V' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Vote Editor'); + VotingEditor; + END; + 'L' : IF (CheckPW) THEN + ShowLogs; + 'N' : TEdit1; + 'P' : IF (CheckPW) THEN + BEGIN + SysOpLog('* System Configuration Editor'); + SystemConfigurationEditor; + END; + 'R' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Conference Editor'); + ConferenceEditor; + END; + 'T' : IF (CheckPW) THEN + BEGIN + mem[Seg0040:$0017] := mem[Seg0040:$0017] XOR 16; + IF (SysOpAvailable) THEN + BEGIN + SysOpLog('* Turned on chat availablity'); + END + ELSE + BEGIN + SysOpLog('* Turned off chat availablity'); + END; + END; + 'U' : IF (CheckPW) THEN + BEGIN + SysOpLog('* User Editor'); + UserEditor(UserNum); + END; + 'X' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Protocol Editor'); + ProtocolEditor; + END; + 'Z' : BEGIN + SysOpLog('* History Editor'); + HistoryEditor; + END; + '1' : BEGIN + SysOpLog('* Edited Files'); + EditFiles; + END; + '2' : BEGIN + SysOpLog('* Sorted Files'); + Sort; + END; + '3' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Read Private Messages'); + ReadAllMessages(''); + END; + '4' : IF (MenuOption = '') THEN + Do_Unlisted_Download + ELSE + UnlistedDownload(MenuOption); + '5' : BEGIN + SysOpLog('* Rechecked files'); + ReCheck; + END; + '6' : IF (CheckPW) THEN + UploadAll; + '7' : ValidateFiles; + '8' : AddGIFSpecs; + '9' : PackMessageAreas; + '#' : IF (CheckPW) THEN + BEGIN + SysOpLog('* Menu Editor'); + SaveMenu := CurMenu; + MenuEditor; + CurMenu := SaveMenu; + LoadMenu; + END; + '$' : DirF(TRUE); + '%' : DirF(FALSE); + ELSE + NoCmd := TRUE; + END; + ELSE + NoCmd := TRUE; + END; + LastCommandGood := NOT NoCmd; + IF (LastCommandOvr) THEN + LastCommandGood := FALSE; + IF (NoCmd) THEN + IF (CoSysOp) THEN + BEGIN + TempStr := 'Invalid command keys: '+Cmd[1]+Cmd[2]+' '+Cmd; + NL; + Print(TempStr); + SysOpLog(TempStr); + END; + + IF ((Cmd[1] + Cmd[2]) <> 'NW') THEN + Update_Node('',FALSE); + + IF (NewMenuToLoad) THEN + BEGIN + LoadMenuPW; + LastCommandGood := FALSE; + IF (NewMenuCmd = '') THEN + AutoExecCmd('FIRSTCMD'); + END; +END; + +END. diff --git a/SOURCE/MISC/ONELE.ANS b/SOURCE/MISC/ONELE.ANS new file mode 100644 index 0000000..dc8cad2 --- /dev/null +++ b/SOURCE/MISC/ONELE.ANS @@ -0,0 +1 @@ +%LF ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ%LF \ No newline at end of file diff --git a/SOURCE/MISC/ONELE.ASC b/SOURCE/MISC/ONELE.ASC new file mode 100644 index 0000000..258bb4f --- /dev/null +++ b/SOURCE/MISC/ONELE.ASC @@ -0,0 +1 @@ +%LF |15ÄÄÄ |07ÄÄ ÄÄ ÄÄ|08ÄÄÄ ÄÄ ÄÄ Ä |03ÄÄ ÄÄ Ä Ä |11ÄÄ Ä Ä ÄÄ |03ÄÄ ÄÄ Ä Ä |08ÄÄÄ ÄÄ ÄÄ|07 ÄÄÄ ÄÄ |15ÄÄ ÄÄ%LF diff --git a/SOURCE/MISC/ONELH.ANS b/SOURCE/MISC/ONELH.ANS new file mode 100644 index 0000000..5601d68 --- /dev/null +++ b/SOURCE/MISC/ONELH.ANS @@ -0,0 +1,7 @@ +[?7hÛÛÛÛÛÛÛßßßßßßßßßßßßßßßßßßßßßß ßßÛÛÛ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛÛÛÛÛÛÛ + ßßßßßßßß ²²ÛÛÛÛÛ ²²ÛÛÛÛÛ ²²ÛÛÛÛ ²ÛÛ ²ÛÛ ²²ÛÛÛÛÛ ²²ÛÛÛÛ ²²ÛÛÛÛÛ ²²ÛÛÛÛ ßßßßßßßß + ÛÛÛÛÛÛÛÛ ²ÛÛÛÛÛÛ ²ÛÛÛÛÛÛ ²ÛÛÛ ß ÛÛÛ ÛÛÛ ²ÛÛÛÛÛÛ ²ÛÛÛ ß ²ÛÛßÛÛÛ ²ÛÛÛ ß ÛÛÛÛÛÛÛÛ + ÛÛÛÛÛÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ + ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛÛ Ü ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛÛ Ü ÛÛÛ ÛÛ Ü ÛÛÛÛ ÛÛÛÛÛÛÛÛ + ÜÜÜÜÜÜÜÜ ÛÛÛÛÛ²Û ÛÛÛ Û²Û ÛÛÛÛÛ² ÛßÛ ÛßÛ ÛÛÛ Û²Û ÛÛÛÛÛ² Û²Û ÛÛ² ÛÛÛÛÛ° ÜÜÜÜÜÜÜÜ + ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ%LF diff --git a/SOURCE/MISC/ONELH.ASC b/SOURCE/MISC/ONELH.ASC new file mode 100644 index 0000000..59d3f03 --- /dev/null +++ b/SOURCE/MISC/ONELH.ASC @@ -0,0 +1,12 @@ + + ÛÛÛÛÛÛ + ÛÛÛßßß ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ + ßßß ÜÛÛÛßßÛÛÛÜ ßÞÛÛÛßÛÛÛÜ ÜÛÛÛßÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ßÞÛÛÛßÛÛÛÜ ÜÛÛÛßÛÛÛÛ + ° ÞÛÛÛÝ ÞÛÛÛÝ ÛÛÛÛ ÞÛÛÛÝ ÞÛÛÛÝ ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ÛÛÛÛ ÞÛÛÛÝ ÞÛÛÛÝ ÛÛÛÛ ° + ßÛ °°ÛÛ ÛÛ°° ÛÛÛ° ÛÛ°° °°ÛÛÜÜÛÛÛÛ ÛÛÛ° ÛÛÛ° ÛÛÛ° ÛÛ°° °°ÛÛÜÜÛÛÛÛ ßßÛ + Û ±±°Û Û°±± Û°°± Û°±± ±±°Û ÜÜÜÜ Û°°± Û°°± Û°°± Û°±± ±±°Û ÜÜÜÜ Û + ÛÜÜÞ²±±Ý Þ±±²Ý °±²² Þ±±²Ý Þ²±±Ý ÛÛ°Û °±²² °±²² °±²² Þ±±²Ý Þ²±±Ý ÛÛ°Û rlÛ + ° ßÛÛÛÜÜÛÛÛß ²²ÛÛ ÛÛÛß ßÛÛÛܲ±±° ²²ÛÛÜÜ ²²ÛÛ ²²ÛÛ ÛÛÛß ßÛÛÛܲ±±° v!° + ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÜÜÜÜÛÛ + ÛÛÛÛÛÛ + diff --git a/SOURCE/MISC/ONELM.ASC b/SOURCE/MISC/ONELM.ASC new file mode 100644 index 0000000..529bf3b --- /dev/null +++ b/SOURCE/MISC/ONELM.ASC @@ -0,0 +1 @@ + |03~OL |11 ... |15~UN{16%LF diff --git a/SOURCE/ONELINER.PAS b/SOURCE/ONELINER.PAS new file mode 100644 index 0000000..a14ed93 --- /dev/null +++ b/SOURCE/ONELINER.PAS @@ -0,0 +1,320 @@ +{$A+,B-,D+,E-,F+,I-,L+,N-,O+,R-,S+,V-} +Unit OneLiner; + +INTERFACE + +Uses + Common, + Timefunc, + Mail1; + +Type + OneLinerRecordType = {$IFDEF WIN32} Packed {$ENDIF} Record + RecordNum : LongInt; + OneLiner : String[55]; + UserID : LongInt; + UserName : String[36]; + DateAdded, + DateEdited : UnixTime; + Anonymous : Boolean; + End; + +PROCEDURE DoOneLiners; +PROCEDURE OneLiner_Add; +PROCEDURE OneLiner_View; +FUNCTION OneLiner_Random : STRING; +FUNCTION ToLower( S : STRING ) : STRING; + +IMPLEMENTATION + +VAR + OneLinerListFile : FILE OF OneLinerRecordType; + OneLineRec : OneLinerRecordType; + +FUNCTION ToLower( S : STRING ) : STRING; +VAR + i : BYTE; +BEGIN + FOR i := 1 TO Length(S) DO + BEGIN + IF S[i] IN ['A'..'Z'] THEN + S[i] := Chr(Ord(S[i]) + 32); + END; + ToLower := S; +END; + +FUNCTION OneLinerListMCI(CONST S: ASTR; Data1,Data2: Pointer): STRING; +VAR + OneLinerListPtr: ^OneLinerRecordType; + User: UserRecordType; + TmpStr : String; +BEGIN + OneLinerListPtr := Data1; + OneLinerListMCI := S; + CASE S[1] OF + 'A' : CASE S[2] OF + 'N' : OneLinerListMCI := ShowYesNo(OneLinerListPtr^.Anonymous); { Anon - Yes/No } + 'T' : OneLinerListMCI := AonOff(OneLinerListPtr^.Anonymous, 'True', 'False'); { Anon - True/False } + END; + 'D' : CASE S[2] OF + 'A' : OneLinerListMCI := Pd2Date(OneLinerListPtr^.DateAdded); { Date Added } + 'E' : OneLinerListMCI := Pd2Date(OneLinerListPtr^.DateEdited); { Date Edited - Not Used } + END; + 'O' : CASE S[2] OF + 'L' : OneLinerListMCI := OneLinerListPtr^.OneLiner; { The Oneliner } + END; + 'R' : CASE S[2] OF + 'N' : OneLinerListMCI := IntToStr(OneLinerListPtr^.RecordNum); { Oneliner Record Number } + END; + 'U' : CASE S[2] OF + '#' : BEGIN { User ID } + IF (OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := ''; + IF (OneLinerListPtr^.Anonymous) AND (SysOp) THEN + OneLinerListMCI := '#' + IntToStr(OneLinerListPtr^.UserID); + IF (NOT OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := '#' + IntToStr(OneLinerListPtr^.UserID); + END; + '1' : BEGIN { User ID Without # } + IF (OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := ''; + IF (OneLinerListPtr^.Anonymous) AND (SysOp) THEN + OneLinerListMCI := IntToStr(OneLinerListPtr^.UserID); + IF (NOT OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := IntToStr(OneLinerListPtr^.UserID); + END; + 'N' : BEGIN { User Name } + LoadURec(User,OneLinerListPtr^.UserID); + IF (OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := 'Anon'; + IF (OneLinerListPtr^.Anonymous) AND (SysOp) THEN + OneLinerListMCI := Caps(User.Name) + ' ^4(^5A^4)'; + IF (NOT OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := Caps(User.Name); + END; + 'L' : BEGIN { User Name Lower } + LoadURec(User,OneLinerListPtr^.UserID); + IF (OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := 'anon'; + IF (OneLinerListPtr^.Anonymous) AND (SysOp) THEN + OneLinerListMCI := ToLower(User.Name) + ' ^4(^5a^4)'; + IF (NOT OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := ToLower(User.Name); + END; + 'S' : BEGIN { User Name Short } + LoadURec(User,OneLinerListPtr^.UserID); + IF (OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := 'Anon'; + IF (OneLinerListPtr^.Anonymous) AND (SysOp) THEN + OneLinerListMCI := Copy(User.Name,1,2) + ' ^4(^5A^4)'; + IF (NOT OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := Copy(User.Name,1,2); + END; + 'U' : BEGIN { User Name Short Lower } + LoadURec(User,OneLinerListPtr^.UserID); + IF (OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := 'anon'; + IF (OneLinerListPtr^.Anonymous) AND (SysOp) THEN + OneLinerListMCI := ToLower(Copy(User.Name,1,2)) + ' ^4(^5a^4)'; + IF (NOT OneLinerListPtr^.Anonymous) THEN + OneLinerListMCI := ToLower(Copy(User.Name,1,2)); + END; + END; + END; +END; + +FUNCTION OneLinerList_Exists: Boolean; +VAR + OneLinerListFile: FILE OF OneLinerRecordType; + FSize: Longint; + FExist: Boolean; +BEGIN + FSize := 0; + FExist := Exist(General.DataPath+'ONELINER.DAT'); + IF (FExist) THEN + BEGIN + Assign(OneLinerListFile,General.DataPath+'ONELINER.DAT'); + Reset(OneLinerListFile); + FSize := FileSize(OneLinerListFile); + Close(OneLinerListFile); + END; + IF (NOT FExist) OR (FSize = 0) THEN + BEGIN + NL; + PrintF('ONELH'); + IF (NoFile) THEN + BEGIN + CLS; NL; + Print(Centre('^4' + General.BBSName + ' One Liners')); + Print(Centre('^5ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ')); + END; + Print(' ^4There are currently no One Liners.'); + NL; + PrintF('ONELE'); + IF (NoFile) THEN + Print(Centre('^5ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ')); + + SysOpLog('^5* The ONELINER.DAT file is missing.'); + END; + OneLinerList_Exists := (FExist) AND (FSize <> 0); +END; + +PROCEDURE DisplayError(FName: ASTR; VAR FExists: Boolean); +BEGIN + NL; + PrintACR('|12ú |09The '+FName+'.* File is missing.'); + PrintACR('|12ú |09Please, inform the Sysop!'); + SysOpLog('The '+FName+'.* file is missing.'); + FExists := FALSE; +END; + +FUNCTION OneLinerAddScreens_Exists: Boolean; +VAR + FExistsH, + FExistsM, + FExistsE: Boolean; +BEGIN + FExistsH := TRUE; + FExistsM := TRUE; + FExistsE := TRUE; + (*IF (NOT ReadBuffer('ONELH')) THEN + DisplayError('ONELH',FExistsH); *) + IF (NOT ReadBuffer('ONELM')) THEN + DisplayError('ONELM',FExistsM); + (*IF (NOT ReadBuffer('ONELE')) THEN + DisplayError('ONELE',FExistsE); *) + OneLinerAddScreens_Exists := (*(FExistsH) AND *)(FExistsM) (*AND (FExistsE)*); +END; + +Procedure AskOneLinerQuestions(VAR OneLinerList: OneLinerRecordType); +{Var MHeader : MHeaderRec; } +Begin + + WHILE (NOT Abort) AND (NOT Hangup) DO + Begin + NL; + Print('^4 Enter your one liner'); + Prt(' ^5:'); + MPL(76); + InputMain(OneLinerList.OneLiner,(SizeOf(OneLinerList.OneLiner) - 1),[InterActiveEdit,ColorsAllowed]); + NL; + Abort := (OneLinerList.OneLiner = ''); + IF (Abort) THEN + Exit + ELSE + OneLinerList.Anonymous := PYNQ('^4 Post Anonymous? ^5',0,FALSE); + Exit; + End; +End; + +PROCEDURE OneLiner_Add; +VAR + Data2: Pointer; + OneLinerList: OneLinerRecordType; +BEGIN + IF (OneLinerAddScreens_Exists) THEN + BEGIN + NL; + OneLiner_View; + IF PYNQ('^4 Add a one liner? ^5',0, FALSE) THEN + BEGIN + FillChar(OneLinerList,SizeOf(OneLinerList),0); + AskOneLinerQuestions(OneLinerList); + IF (NOT Abort) THEN + BEGIN + PrintF('ONELH'); + IF (NoFile) THEN + BEGIN + CLS; NL; + Print(Centre('^4' + General.BBSName + ' One Liners')); + Print(Centre('^5ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ')); + END; + Print(' ^4'+OneLinerList.OneLiner); + PrintF('ONELE'); + IF (NoFile) THEN + Print(Centre('^5ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ')); + NL; + IF (PYNQ('^4 Add this oneliner? ^5',0,TRUE)) THEN + BEGIN + Assign(OneLinerListFile,General.DataPath+'ONELINER.DAT'); + IF (Exist(General.DataPath+'ONELINER.DAT')) THEN + Reset(OneLinerListFile) + ELSE + Rewrite(OneLinerListFile); + Seek(OneLinerListFile,FileSize(OneLinerListFile)); + OneLinerList.UserID := UserNum; + OneLinerList.DateAdded := GetPackDateTime; + OneLinerList.DateEdited := OneLinerList.DateAdded; + OneLinerList.RecordNum := (FileSize(OneLinerListFile) + 1); + Write(OneLinerListFile,OneLinerList); + Close(OneLinerListFile); + LastError := IOResult; + + SysOpLog('Added Oneliner : '+OneLinerList.OneLiner+'.'); + END; + END; + END; + END; +END; + +PROCEDURE OneLiner_View; +VAR + Data2: Pointer; + OneLinerList: OneLinerRecordType; + OnRec: Longint; + Cnt : Byte; +BEGIN + + IF (OneLinerList_Exists) AND (OneLinerAddScreens_Exists) THEN + BEGIN + Assign(OneLinerListFile,General.DataPath+'ONELINER.DAT'); + Reset(OneLinerListFile); + ReadBuffer('ONELM'); + AllowContinue := TRUE; + Abort := FALSE; + PrintF('ONELH'); + IF (NoFile) THEN + BEGIN + CLS; NL; + Print(Centre('^4' + General.BBSName + ' One Liners')); + Print(Centre('^5ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ')); + NL; + END; + OnRec := 1; + Cnt := (FileSize(OneLinerListFile)); + {WHILE (OnRec <= FileSize(OneLinerListFile)) AND (NOT Abort) AND (NOT HangUp) DO} + + FOR Cnt := (FileSize(OneLinerListFile)) DOWNTO 1 DO + BEGIN + Seek(OneLinerListFile,(Cnt-1)); + Read(OneLinerListFile,OneLinerList); + DisplayBuffer(OneLinerListMCI,@OneLinerList,Data2); + Inc(OnRec); + IF ((OnRec-1) = 10) THEN + Break + ELSE + OnRec := OnRec; + END; + Close(OneLinerListFile); + LastError := IOResult; + IF (NOT Abort) THEN + PrintF('ONELE'); + IF (NoFile) THEN + Print(Centre('^5ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ')); + + AllowContinue := FALSE; + SysOpLog('^5* ^4'+ ThisUser.Name + '^5 Viewed the OneLiners.'); + END; +END; + +Function OneLiner_Random : String; +Begin + +End; + +Procedure DoOneLiners; { To-Do : Variable Number of One Liners To Display } +Begin +OneLiner_Add; +End; + +End. diff --git a/SOURCE/RENEGADE.PAS b/SOURCE/RENEGADE.PAS index 3a2391f..376cc69 100644 --- a/SOURCE/RENEGADE.PAS +++ b/SOURCE/RENEGADE.PAS @@ -67,7 +67,7 @@ USES {$O ShortMsg } {$O CUser } {$O Doors } {$O ExecBat } {$O Automsg } {$O MyIO } {$O Menus2 } {$O Menus3 } {$O LineChat } {$O Stats } {$O Events } {$O BBSList } {$O Common4 } {$O File7 } {$O SplitCha } -{$O Sysop2o } {$O Sysop5 } {$O SysOp12 } +{$O Sysop2o } {$O Sysop5 } {$O SysOp12 } {$O OneLiner } CONST NeedToHangUp: Boolean = FALSE;