home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / programme / trionbbs110 / Trion / docs / 10_Menu_system.doc < prev    next >
Encoding:
Text File  |  1998-10-06  |  7.0 KB  |  266 lines

  1.  
  2.  
  3.   Introduction
  4.   ------------
  5.  
  6.    This chapter describes how the Trion BBS menu system works
  7.    and how to edit and make menus.
  8.  
  9.  
  10.  
  11.  
  12.  
  13.       ===( Trion BBS Menu Commands )=================
  14.  
  15.  
  16.       The trion BBS system works with menus , these consist of
  17.       readable text files with commands and a pascal like structure.
  18.  
  19.       To make a menu is easy, menus have a simple structure and
  20.       there are a lot of commands you can Use in a menu to
  21.       create a complete BBS system.
  22.       The first menu which is started when someone 'logs in' is
  23.       the 'start.menu'.
  24.       In a menu you can call other menus, so you
  25.       can expand it almost infinitly.
  26.  
  27.       Before you can use a menu you have to 'compile' it, this
  28.       is done by calling the 'menu' utility which checks your
  29.       menus on errors and makes a binary file from it.
  30.  
  31.       The text files are called 'source' and the result of the
  32.       menu compiler are the menus.
  33.       You find the sources of the menus in the 'trion:menus/' 
  34.       directory, this also consist a subdirectory for the
  35.       compiled menus.
  36.  
  37.  
  38.       Compiling a menu:                'menu door.src'
  39.       (compiles the 'door' menu)
  40.  
  41.       Wildcards are allowed:           'menu #?'
  42.       (this compiles all menus)
  43.  
  44.  
  45.  
  46.       Example of a bit of menu:
  47.       =========================
  48.  
  49.  
  50.  
  51. Menu "start.menu"                        ; Name of the menu after compiling
  52.  
  53. flags  hotkeyable                        ; Make menu hotkeyable
  54. level  0 - 255 , "Start.Ansi"            ; List with ANSI files and levels
  55. prompt 0 , 0 - 255 , "Start Menu : "     ; List with prompts
  56. prompt 1 , 0 - 255 , "Start Menu : "
  57.  
  58. BEGIN     ; Start the command definitions
  59.  
  60.  
  61. Cmd "G"                               ; Reachable for all users.
  62.    Print "Bye.|"
  63.    Logout
  64. EndCmd
  65.  
  66. Cmd "D"  , 255                        ; Reachable only to sysops.
  67.    DosShell
  68. EndCmd
  69.  
  70. Cmd "T" , 128 - 255                   ; Users with level 128 or higher.
  71.    GotoMenu "Test.Menu"               ; Jump to an other menu
  72. EndCmd
  73.  
  74. END                                   ; End of commands section
  75.  
  76.  
  77.  
  78.       More about the menu structure:
  79.       ==============================
  80.  
  81.       The first part of a menu is the definitions part.
  82.       This tells the BBS how to execute the menu and what for
  83.       screens and prompts te Use.
  84.  
  85.       Menu line:
  86.  
  87.       The first line should be 'Menu  "name.menu"'
  88.       This line tells the compiler how the binary file it
  89.       makes is called. This is the file the BBS uses to
  90.       execute a menu. When you call an other menu you
  91.       also should use this name.
  92.  
  93.       flags, level and prompt lines:
  94.  
  95.       The next lines in the definitions part are lines where
  96.       you can define flags, screens and prompts.
  97.  
  98.       At this moment there is only the flags 'hotkeyable' and 'noscreen' 
  99.       if you want to use hotkeys in this menu you put a line:
  100.       'flags  hotkeyable' or 'FLAGS HOTKEYABLE' here.
  101.       This means that the BBS doesn't wait for a return after
  102.       the input of a user but directly interpretes every key a
  103.       user hit in real time.
  104.       The 'noscreen' flag was thougth up for menus which use doors
  105.       for generating an ANSI or RIPscrip menu screen.
  106.       If you put this after flags then the normal menu screen will
  107.       not be printed.
  108.  
  109.  
  110.       With the level lines you can define what screens are
  111.       showed in combination with what level.
  112.       The format of this line is:
  113.       'level  level-range , screenfile'
  114.  
  115.       The system searched for the 'screenfile' in the directory
  116.       'trion:menutext/' if the menu set if the user is set 0.
  117.       If the set is higher the system searches in directory
  118.       'trion:menutext1/' or 'trion:menutext2/' or higher.
  119.       If there is no such directory or file the system uses the
  120.       default 'trion:menutext/' directory.
  121.  
  122.       With the prompt lines you can define what prompt line is
  123.       displayed under a menu screen.
  124.       The format of this line is:
  125.       'prompt  menu-set, level-range , prompt-line'
  126.       Because of the menuset parameter you can make a line
  127.       for each language set you use.
  128.  
  129.       There can be as many level or prompt lines as needed in your menu.
  130.  
  131.  
  132.  
  133.  
  134.       The second part of a menu file is the commands section.
  135.  
  136.       This section start with a 'BEGIN' line and ends with a 'END'
  137.       line.
  138.       Between these lines are the commands.
  139.  
  140.       Command lines start with a 'Cmd "string"' part optionally
  141.       folowed with levels or flags to indicate who can run this command.
  142.       You can use a single level like '255' or a range like '10 - 255'.
  143.       There are to possible flags you can use:
  144.       S = sysop, only local (at the keyboard) can use the command.
  145.       U = user, only remote users (at a serial port) can use the command.
  146.       Flags and levels are separated by a comma.
  147.  
  148.       Examples:
  149.  
  150. Cmd  "A"                ; Can be used by everyone.
  151. Cmd  "A" , 5 - 255      ; Can be used by users with a level from 5 to 255.
  152. Cmd  "A" , S            ; Only to use localy.
  153. Cmd  "A" , 255 , U      ; Only to use remotely with a sysop level.
  154. Cmd  "A" , SU           ; Can be used everywhere
  155.  
  156.  
  157.  
  158.       Instead of 'Cmd' you also van use 'MenuBegin', 'MenuEnd',
  159.       'CommandBegin', 'CommandEnd' or 'BuildScreen'.
  160.       With these you can execute an number of menu commands each
  161.       time a command is started or finished, or when a menu is
  162.       entered, or after the ANSI screen is drawn and the system
  163.       is waiting for input.
  164.  
  165.       This is Usefull when you want to log whenever a user
  166.       enters a menu, for example:
  167.  
  168. MenuBegin
  169.    LogMessage "Entered main menu."
  170. EndCmd
  171.  
  172.  
  173.       Or when you want to use RIP-scrip commands in a menu:
  174.  
  175. MenuBegin
  176.    Print "!|"                          ;RIP-scrip mode on
  177. EndCmd
  178.  
  179. MenuEnd
  180.    Print "!|"                          ;RIP-scrip mode off
  181. EndCmd
  182.  
  183.  
  184.  
  185.       After a 'Cmd' line a number of lines with commands if followed
  186.       after the last of these lines a 'EndCmd' line is needed.
  187.  
  188.  
  189. ; Write a comment to sysop
  190.  
  191. Cmd "C" , 0-255
  192.    CommentToSysop
  193. EndCmd
  194.  
  195.  
  196. ; Write a comment to a CoSysop
  197.  
  198. Cmd "S" , 0-255
  199.    ChangeMessageArea "1"          ;Area 'comment to sysop'
  200.    FlushBuffer
  201.    PushIntoBuffer "Cosysop|"
  202.    WriteMessage
  203. EndCmd
  204.  
  205.  
  206. ; Write a message to all
  207.  
  208. Cmd "A" , 10-250
  209.    ChangeMessageArea "5"          ;Area 'Message To All'
  210.    FlushBuffer
  211.    PushIntoBuffer "All|"
  212.    WriteMessage
  213. EndCmd
  214.  
  215.  
  216. ; Ask for a file and Download it
  217.  
  218. Cmd "D"
  219.    MarkFile
  220.    Download
  221.    More
  222. EndCmd
  223.  
  224.  
  225.  
  226. ; Send an Allfiles file to the user
  227.  
  228. Cmd "A"
  229.    MarkName "ALLFILES.LHA"
  230.    Download
  231.    More
  232. EndCmd
  233.  
  234.  
  235.  
  236. ; Ask for a file and Download it and logoff
  237.  
  238. Cmd "G"
  239.    MarkFile
  240.    Download
  241.    Logout
  242. EndCmd
  243.  
  244.  
  245. ; Let's new users scan for waiting mail
  246.  
  247. Cmd "?" , 0- 255
  248.    Confirm  "Do you really want to scan for waiting mail (Y/n) ? " 
  249.    ScanWaitingMail
  250.    More
  251. EndCmd
  252.  
  253.  
  254.  
  255.  
  256.       Menu commands:
  257.       ==============
  258.  
  259.       Commands may be in Uppercase, Lowercase or both mixed.
  260.       Some commands need an 'argument', arguments may be placed between ""
  261.       which means that that data is taken exactly as it was typed in, if
  262.       you don't use "" the first word or number will be used en spaces
  263.       will be removed.
  264.  
  265.  
  266.