home *** CD-ROM | disk | FTP | other *** search
- /*
- * PULL-DOWN menu setup demo for the Octopus Bulletin Board System
- * written by Koos Kuil on 18 May 1996
- * -------------------------------------------------------------------
- * Modified to make it more clear for novice sysops on 06 Oct 1996
- * -------------------------------------------------------------------
- * Run this script using: OCTOPUS -sPD_MAIN.SCR local
- *
- * This example is written in ONE .SCR file so please split it into
- * several parts if you want to make use of it.
- *
- * IMPORTANT: In Octopus v0.72alpha-6 it's required that the menu
- * library (beginning with #menulib) is put at the begin
- * of the script file. This will be more flexible later.
- *
- * -------------------------------------------------------------------
- * HINTS: - The menu title bar is like a chain, you must tell
- * this script what he must do if you press the left
- * or right cursor key. In this example the QWK menu
- * is the first menu right from the MAIN menu. You'll
- * see that the IfChoice CursRight command does jump
- * from the MAIN menu to the QWK menu, the same for the
- * left cursor keys. If you add or remove menus you
- * have to modify this chain.
- *
- * - When you use SubMenus (see the FILEBASE example for
- * 1 and 2 submenus and how to handle it). Then it can
- * be needed when your SubMenu if LARGER (in lines) then
- * the 'Head' menu that you have to comment out the
- * following code (or add) at the end of a subroutine:
- *
- * IfChoice CursRight
- * RemoveMenu ... (your submenu)
- * Endif
- *
- * If you press the right cursor key then Octopus will
- * restore the screen used by that menu, if your 'Head'
- * menu is larger then this isn't needed (it only takes
- * un-needed redraw time!).
- *
- * - In this example not all options are working, please
- * change this to your own setup because this script is
- * written to give you an idea how you can get working
- * these complex features from Octopus.
- *
- */
- #define NESTMAIL /* NeST region 90: English Atari network */
- #define FAN10MAIL /* FAN region 10: Dutch Atari network */
- #define ATARINETMAIL /* AtariNet region 51: English Atari net */
-
- #define MORE_OS /* Different OS-es for filegroups */
- #define FANFILES /* FAN Atari ST filenetwork */
-
- /* #define AREALIST */ /* Undefine when all the groups are correct */
-
- /* -------------------------------------------------------------------
- * Begin of the include section
- */
- #include "pd_mlib.scr" /* This is our menu library */
- #include "pd_local.scr" /* LOCAL message areas script */
-
- #ifdef MORE_OS
- #include "pd_os.scr" /* Different OS-es handling script */
- #endif
-
- #ifdef FANFILES
- #include "pd_fanfi.scr" /* FAN filenetwork script */
- #endif
-
- #ifdef NESTMAIL
- #include "pd_nest.scr" /* NEST message areas script */
- #endif
-
- #ifdef FAN10MAIL
- #include "pd_fan10.scr" /* FAN.10 message areas script */
- #endif
-
- #ifdef ATARINETMAIL
- #include "pd_atnet.scr" /* ATARINET message areas script */
- #endif
-
- /* -------------------------------------------------------------------
- * MAIN startup function, the normal script file begins here...
- * a little bit stripped but usable enough.
- */
- Main
- SenseTerminal /* Detect if remote supports ANSI */
-
- Send "\fWelcome to this example PULL-DOWN DEMO setup\r\n"
-
- Login /* Login, no luxe or other things */
- IfNoAccess /* Drop the user if no access */
- Logout
- Endif
- DoMailScan Full /* Do a little mailscan :-)) */
-
- /* This is needed because we want a full screen redraw */
- Gosub draw_bbsinfo
-
- /* -------------------------------------------------------------------
- * Begin of the "MAIN MENU"
- */
- :mainmenu
- Do
- DrawMenu Main Gosub draw_ascii_msg
- DoMenu Main
- Selectchoice
- Case A Convert InfoTxt
- Case I Convert Timedemo
- Case 'R /Sysop' Shell
- Case Y PageSysop
- Case L UserList GetKey
- Case U UploadToUser
- Case ! Gosub logoff
-
- /* The Common statement does clear the screen when we
- * are NOT in ascii mode and rebuild the information on
- * it. It's like default but only activated when a choice
- * is done in one if above Case statements.
- */
- Common Gosub draw_bbsinfo
- EndSelect
- Enddochoice MenuBarKeys
- RemoveMenu Main
- Enddo MenuBarKeys
-
- /* Check to what menu we should go */
- IfChoice CursLeft
- Goto msgbase
- Else IfChoice CursRight
- Goto qwkreader
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * Begin of the "STATISTICS MENU"
- */
- :statistics
- Do
- DrawMenu Statistics Gosub draw_ascii_msg
- DoMenu Statistics
- SelectChoice
- Case 1 ListLastCallers
- Case 2 Convert 15_dnlds
- Case 3 Convert 10_email
- Case 4 Convert Birthday
- Case 5 Convert Status
- Case 6 Convert 10_nmail
- Case 7 FileBaseStatistics
- Case 8 Convert 15_calls
- Case 9 Convert 15_uplds
- Case ! Gosub logoff
- Common Gosub draw_bbsinfo
- EndSelect
- EnddoChoice MenuBarKeys
- RemoveMenu Statistics
- Enddo MenuBarKeys
-
- IfChoice CursLeft
- Goto filebase
- Else IfChoice CursRight
- Goto settings
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * Begin of the "USER SETTINGS"
- */
- :settings
- Do
- DrawMenu Settings Gosub draw_ascii_msg
- DoMenu Settings
- Selectchoice
- Case E ChangeEmulation
- Case H Gosub toggle_hotkeys
- case I Gosub toggle_highascii
- Case O Gosub toggle_moreprompt
- Case P ChangePassword
- Case L ChangeScreenLength
- Case W ChangeScreenWidth
- Case F Gosub toggle_dateformat
- Case U GetDefaultUp N
- Case D GetDefaultDown N
- Case A GetDefaultArchiver N
- Case ! Gosub logoff
- Common Gosub draw_bbsinfo
- EndSelect
- EnddoChoice MenuBarKeys
- RemoveMenu Settings
- Enddo MenuBarKeys
-
- IfChoice CursLeft
- Goto statistics
- Else IfChoice CursRight
- Goto bulletin
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * Begin of the "BULLETIN MENU"
- */
- :bulletin
- Do
- DrawMenu Bulletins Gosub draw_ascii_msg
- DoMenu Bulletins
- Selectchoice
- Case 1 Bulletin 'aeo_????.txt'
- Case 2 Bulletin 'aeop????.???'
- Case 3 Bulletin 'slmp???.asc'
- Case 4 Bulletin 'stgd*.txt'
- Case 5 Bulletin 'str???.txt'
- Case 6 Bulletin 'znet*.*'
- Case ! Gosub logoff
- Common Gosub draw_bbsinfo
- EndSelect
- EnddoChoice MenuBarKeys
- RemoveMenu Bulletins
- Enddo MenuBarKeys
-
- IfChoice CursLeft
- Goto settings
- Else IfChoice CursRight
- Goto msgbase
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * Begin of the "MSGBASE MENU", this menu does also have a small
- * SUB-MENU, take a very closed look at it how you can handle this
- * with less full screen redraws and to get the highest speed.
- */
- :msgbase
- Do
- DrawMenu Msgbase Gosub draw_ascii_msg
- DoMenu Msgbase
- Selectchoice
- Case G Gosub MSG_groups Break
- Case N Cls DoMailScan Full
- Case R Bulletin echorule.txt
- Case ! Gosub logoff
- Common Gosub draw_bbsinfo
- Endselect
- EnddoChoice MenuBarKeys
- RemoveMenu MsgBase
- Enddo MenuBarKeys
-
- IfChoice CursLeft
- Goto bulletin
- Else IfChoice CursRight
- Goto mainmenu
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * Msgbase groups
- */
- :MSG_groups
- DrawMenu MsgGroups Gosub draw_ascii_msg
- DoMenu MsgGroups
- Selectchoice
- Case 1 Gosub MSG_local Break
- #ifdef NESTMAIL
- Case 2 Gosub MSG_nest Break
- #endif
- #ifdef ATARINETMAIL
- Case 3 Gosub MSG_atarinet Break
- #endif
- #ifdef FAN10MAIL
- Case 4 Gosub MSG_fan10net Break
- #endif
-
- #ifdef AREALIST
- Case 5 Do Getmsgarealist LOCAL ReadMessages EnddoNoArea
- #ifdef NESTMAIL
- Case 6 Do Getmsgarealist NEST ReadMessages EnddoNoArea
- #endif
- #ifdef ATARINETMAIL
- Case 7 Do Getmsgarealist ATARINET ReadMessages EnddoNoArea
- #endif
- #ifdef FAN10MAIL
- Case 8 Do Getmsgarealist FANET10 ReadMessages EnddoNoArea
- #endif
- #endif
-
- Case X Do GetMsgAreaList FULL
- ReadMessages EnddoNoarea
-
- Common Gosub draw_bbsinfo
- DrawMenu Msgbase
- EndSelect
- EnddoChoice MenuBarKeys
-
- /* Remove the submenu */
- IfChoice CursLeft
- RemoveMenu MsgGroups
- ClrChoice
- Endif
- Return
-
- /* -------------------------------------------------------------------
- * Begin of the "QWKREADER MENU"
- */
- :qwkreader
- Do
- DrawMenu QWK Gosub draw_ascii_msg
- DoMenu QWK
- SelectChoice
- Case 1 ChangeQwkNdx
- Case 2 ChangeQwkBulletins
- Case 3 ResetLastread
- Case 4 UnmarkQwkAreas
- Case 5 SetQwkMaxMsgs
-
- Case 6 GetMsgAreaList FULL WriteQwkOneAll
- Case 7 WriteQwkMarkedAll
- Case 8 GetMsgAreaList FULL WriteQwkOneNew
- Case 9 WriteQwkMarkedNew
- Case 0 WriteQwkMarkedDays
-
- Case A MarkQwkAreas FULL
- Case U UploadQwkReplys GetKey
- Case H Bulletin qwkhelp
- Case ! Gosub 'logoff'
- Common Gosub draw_bbsinfo
- Endselect
- EnddoChoice MenuBarKeys
- RemoveMenu QWK
- Enddo MenuBarKeys
-
- IfChoice CursLeft
- Goto mainmenu
- Else IfChoice CursRight
- Goto filebase
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * A simply menu for use with allfiles listings
- */
- :FB_allfiles
- IfAscii EchoKey Endif
- DrawMenu Allfiles Gosub draw_ascii_msg
- DoMenu Allfiles
- Selectchoice
- Case 1 DownloadFile ALLFILES.LZH
- Case 2 DownloadFile ATARI.LZH
- Case 3 DownloadFile MSDOS.LZH
- Case 4 DownloadFile OS2.LZH
- Case 5 DownloadFile NEWFILES.LZH
-
- Common Gosub draw_bbsinfo
- DrawMenu File
- EndSelect
- EnddoChoice MenuBarKeys
-
- /* Remove the submenu */
- IfChoice CursLeft
- RemoveMenu Allfiles
- ClrChoice
- Endif
- Return
-
- :FB_filegroups
- DrawMenu FileGroups Gosub draw_ascii_msg
- DoMenu FileGroups
- Selectchoice
- Case 1 /* File group ATARI */
- Case 2 /* File group GENERAL */
- #ifdef FANFILES
- Case 3 Gosub FB_os_atari_fanfiles Break
- #endif
- Case 4 /* File group NESTFILE */
-
- /* Detailed (normal) listing of fileareas */
- #ifdef AREALIST
- Case 5 /* Filegroup ATARI */
- Case 6 /* Filegroup GENERAL */
- #ifdef FANFILES
- Case 7 SetFileGroup FANFILES /* File group FANFILES */
- SetMainArea FANFILES
- Getfilearealist FANFILES
- #endif
- #endif
- Case X SetFileGroup FULL /* Set Full group */
- FileListing
-
- Common Gosub draw_bbsinfo
- DrawMenu File
- EndSelect
- EnddoChoice MenuBarKeys
-
- /* Remove the submenu */
- IfChoice CursLeft
- RemoveMenu Filegroups
- ClrChoice
- Endif
- Return
-
- /* -------------------------------------------------------------------
- * Begin of the "FILEBASE MENU", this menu does also have a small
- * SUB-MENU, take a very closed look at it how you can handle this
- * with less full screen redraws and to get the highest speed.
- */
- :filebase
- SetFileGroup FULL /* Set file group ATARI as default */
- SetMainArea FULL
- Do
- DrawMenu File Gosub draw_ascii_msg
- DoMenu File
-
- Selectchoice
- #ifdef MORE_OS
- Case O Gosub FB_os Break
- #endif
- Case G Gosub FB_filegroups Break
- Case A Gosub FB_allfiles Break
-
- Case F FileListing
- Case L FileListing
- Case N Newfiles
- Case K KeywordSearch
- Case D Download
- Case V ShowFileInfo
- Case U Convert rules.upl UploadtoArea
- Case I FileBaseStatistics
- Case P Convert private.upl UploadPrivate
- Case ! Gosub logoff
- Case 1 convert `Fp.TOP
- Common Gosub draw_bbsinfo
- Endselect
- EnddoChoice MenuBarKeys
- RemoveMenu File
- Enddo MenuBarKeys
-
- IfChoice CursLeft
- Goto qwkreader
- Else IfChoice CursRight
- Goto statistics
- Else
- Goto choice_action
- Endif
- Endif
- End /* End Octopus */
-
- /* -------------------------------------------------------------------
- * Some USER-functions (normal in USERBASE.SCR)
- */
- :change_password
- ChangePassword
- Return
-
- :change_emulation
- ChangeEmulation
- Return
-
- :change_screenlength
- ChangeScreenLength
- Return
-
- :change_screenwidth
- ChangeScreenWidth
- Return
-
- :toggle_fullscred
- Send "\f*** Full Screen Message Editor ? ***\r\n\n"
- "@Y Yes, use the full screen edit (not in ascii mode).\r\n"
- "@N No, use the internal message line-orientated editor.\r\n\n"
- "Select: "
-
- AskYesNo
- IfAskTrue
- SetFullScrEd On
- Else
- SetFullScrEd Off
- Endif
- Return
-
- :toggle_moreprompt
- Alert "[YN]`T Do you want a more prompt (y,n) ? "
- IFChoice N
- SetMorePrompt Off
- Else
- SetMorePrompt On
- Endif
- Return
-
- :toggle_hotkeys
- Alert "[YN]Do you want fast menu hotkeys (y,n) ? "
- IfChoice N
- SetHotkeys Off
- Else
- SetHotkeys On
- Endif
- Return
-
- :toggle_dateformat
- Do
- Send "\r\n\nSelect your favourite date format.\r\n\n"
- "1. DD-MM-YYYY (26 September 1995)\r\n"
- "2. MM-DD-YYYY (September 26th 1995)\r\n\n"
- Send "Make your choice: "
- DoChoice
- Selectchoice
- Case 1 SetAltDateFormat Off
- Case 2 SetAltDateFormat On
- EndSelect
- EnddoChoice 12
- EchoKey
- Enddo 12
- Return
-
- :toggle_highascii
- Alert "[YN]Do you want to use high ascii (IBM graphics) (y,n) ? "
- IfChoice N
- SetHighAscii Off
- Else
- SetHighAscii On
- Endif
- Return
-
- /* -------------------------------------------------------------------
- * Begin of the "LOGOFF normal menu"
- */
- :logoff
- Logout
- End
-
- /* When you see this piece of script, you'll think
- * why not using Select...EndSelect? No, this
- * will result in a nested loop and Octopus will
- * exit after this.
- *
- * Because we are directly jumping from one function
- * in another one, a Return command is not usable (this
- * will result in a "Return without gosub"). We use
- * the Goto command for this.
- */
- :choice_action /* Check choices */
- IfAscii
- IfChoice MenuBarKeys
- EchoKey
- Endif
- Endif
-
- IfChoice B Goto bulletin Endif
- IfChoice * Goto mainmenu Endif
- IfChoice F Goto filebase Endif
- IfChoice M Goto msgbase Endif
- IfChoice Q Goto qwkreader Endif
- IfChoice S Goto statistics Endif
- IfChoice T Goto settings Endif
-
- End
-
- /* This subroutine shows us how we can put a little
- * note at the end of our screen, be sure that you
- * don't have pulldown menus that does override this
- * text (on 14 May 1996 the screen rebuild is not
- * complete working).
- *
- * If you don't want it, put the "Cls" command after
- * the "Common" statements, this will give (as in this
- * function) only a clear-screen when required (when a
- * menu option was selected).
- *
- * For ascii mode this function is useless because it's
- * not possible in ascii to put text on the screen before
- * menu redraw is done.
- */
- :draw_bbsinfo
- IfNoAscii
- Cls
- Gotoxy 0,21
- Send " ----- You can put your own message text here for example on the -----\r\n"
- " ----- bottom of the screen, this text is not drawed in ascii mode -----"
-
- Gotoxy 0,19
- Send "/// You can use your cursor keys or menu title/entry keys to make a choice. ///"
- Endif
- Return
-
- /* Draw a little message when a menu is drawed on screen in
- * ascii mode, this subroutine should called AFTER a "DrawMenu"
- * command.
- */
- :draw_ascii_msg
- IfAscii
- Send "\r\n\nMake your choice `UF : "
- Endif
- Return
-
- /* End PULLDEMO.SCR */