home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / n / newsflash / !FileBase / !NewsFlash / Docs / Manual < prev    next >
Encoding:
Text File  |  1996-09-16  |  13.4 KB  |  439 lines

  1. User guide for NewsFlash BBS software
  2. =====================================
  3.  
  4. Contents:                                   Last update:
  5.  
  6. 1. Introduction                             7/5/95
  7. 2. Setting up                               7/5/95
  8. 3. General usage                            7/5/95
  9. 4. NewsFlash script language and compiler   2/8/95
  10. 5. Writing doors                            7/5/95
  11. 6. Using doors from other systems           7/5/95
  12.  
  13. Appendix:
  14.  
  15. A. Credits                                  16/9/96
  16. B: Contacts                                 24/7/95
  17. C: License                                  19/7/95
  18. D: Software used                            16/9/96
  19. E: Boring specs.                            16/9/96
  20.  
  21. Additional data sheets:
  22.  
  23. SWI's     : List of all NewsFlash SWI's
  24. Messages  : List of all NewsFlash WIMP messages
  25. FileArea  : Details of the File Areas file structure
  26. FileBase  : Details of the File Base file structure
  27. UserFile  : Details of the user file and user record structure
  28. Commands  : Brief list of script commands
  29.  
  30. Chapter 1 : Introduction
  31. ------------------------
  32.  
  33. NewsFlash is a multi line BBS package for use with Acorn 32 bit machines.
  34.  
  35. There was no real need for another BBS package on the Arc but I thought I'd
  36. write one for fun anyway.. :-)...
  37.  
  38. Also, I wanted a BBS package that would offer sysop's a bit of extra control
  39. over the way their BBS looked. For that reason NewsFlash script files may be
  40. a bit more compilcated than other types of scripts. However, scripts to
  41. peform most of the common functions have been written already so Sysop's can
  42. look at these and modify them or re-write their own versions if they wish.  
  43.  
  44. Chapter 2 : Setting Up
  45. ----------------------
  46.  
  47. NewsFlash is very simple to set up, with all configuration done via the WIMP.
  48. NewsFlash is initially set up as a 3 line BBS with line 1 using the Internal
  49. driver, line 2 using the pipe driver and line 3 for local logons only.
  50.  
  51. Chapter 3 : General usage
  52. -------------------------
  53.  
  54. Chapter 4 : NewsFlash script language and compiler
  55. --------------------------------------------------
  56.  
  57. This chapter is split up into several parts:
  58.  
  59. 4/1. Introduction                          2/6/95
  60. 4/2. Description of commands               2/6/95
  61. 4/3. Using the file base facilities        2/6/95
  62. 4/4. Using the message base facilities     2/6/95
  63.  
  64. 4/1. Introduction
  65. -=-=-=-=-=-=-=-=-
  66.  
  67. 4/2. Description of commands
  68. -=-=-=-=-=-=-=-=-=-=-=-=-=-=
  69.  
  70. IO Device commands:
  71.  
  72. NewsFlash allows you to setup several In/Out devices, meaning that data can
  73. be sent from one serial port to another, or to a telnet port, etc.
  74.  
  75. Every device has a unique handle so that it can be identified. You can output
  76. to, or read from, a device using the standard IO commands (print,input,etc.),
  77. or by using commands to control a specific device. You use the standard
  78. commands by setting changing the currently selected output device.
  79.  
  80. ============================================================================
  81.  
  82. OPENDEVICE <DeviceType$>,(Parameters vary) TO handle%
  83.  
  84. Current devices are: SERIAL, TELNET and WINDOW.
  85.  
  86. Examples:
  87.  
  88. OPENDEVICE "SERIAL","INTERNAL",0,19200 TO handle%
  89. OPENDEVICE "TELNET","armadilo.demon.co.uk",80 TO handle%
  90. OPENDEVICE "WINDOW",open% TO handle%
  91.  
  92. The handle returned is an integer.
  93.  
  94. The SERIAL device takes the parameters:
  95.  
  96. Serial Driver Name (String)
  97. Serial Driver Port (Integer)
  98. Serial Driver Baud Rate (Integer)
  99.  
  100. OPENDEVICE "SERIAL",<Driver>,<Port>,<Baud Rate> TO handle%
  101.  
  102. The TELNET device takes the parameters:
  103.  
  104. Telnet Address (String)
  105. Telnet Port (Integer)
  106.  
  107. OPENDEVICE "TELNET",<Address>,<Port> TO handle%
  108.  
  109. The OS device takes the parameter:
  110.  
  111. Clear flag <Boolean Integer>
  112.  
  113. OPENDEVICE "WINDOW",<Title>,<Open>
  114.  
  115. The open flag states whether the window should be opened immediately or
  116. when the first input/output is made.
  117.  
  118. ============================================================================
  119.  
  120. CLOSEDEVICE <Handle>
  121.  
  122. Closes a specific output device (must be done before the same (not same type)
  123. device can be opened again.
  124.  
  125. ============================================================================
  126.  
  127. SETDEVICE <Handle>
  128.  
  129. Sets the current input/output device (for use with PRINT, INPUT, etc.)
  130.  
  131. ============================================================================
  132.  
  133. RESETDEVICE
  134.  
  135. Sets the current input/output device to the original/default device.
  136.  
  137. ============================================================================
  138.  
  139. OUTPUTBYTE <Handle>,<Byte> TO <Failed>
  140.  
  141. Attempts to output a byte (passed as an integer) to a specific IO device. A
  142. boolean integer is returned indicating failure (non zero if not sent).
  143.  
  144. ============================================================================
  145.  
  146. INPUTBYTE <Handle> TO <Byte>
  147.  
  148. Attempts to read a byte from a specific IO device. -1 is returned if no byte
  149. was read.
  150.  
  151. ============================================================================
  152.  
  153. 4/3. Using the file base facilities
  154. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  155.  
  156. File base commands:
  157.  
  158. ============================================================================
  159.  
  160. FILESEARCH
  161.  
  162. This command will perform a search through the file base for a file using a
  163. search string.
  164.  
  165. It is used as follows:
  166.  
  167. FILESEARCH fa%,searchcode%,max%,searchstring,type% TO searched%,result%,searchcode%
  168.  
  169. it should be called repeatedly until the search has finished. It will set
  170. 'searchcode%' to 0 if the search has finished.
  171.  
  172. Where:
  173.  
  174. fa%          - file area to search (or 0 for all file areas)
  175. searchcode%  - code to allow multiple calls (set to 0 for first call)
  176. max%         - maximum number of files to search on this call
  177. searchstring - string to search for
  178. type%        - zero to indicate 'searchstring' is a filename, otherwise
  179.                'searchstring' is a keyword.
  180.  
  181. searched%    - number of files that were searched
  182. result%      - filenumber of a matching file or 0 if no match was found
  183. searchcode%  - code to pass on next call (or 0 if search has finished)
  184.  
  185. Example:
  186.  
  187. SUB filesearch
  188. OPENFILEBASE
  189.  
  190. | fa% contains area to search (0 for all)
  191.  
  192. STD
  193.  
  194. FG 2}
  195. Search by filename or keyword? (N/K){GET searchtype,NK" NL
  196. IF st="N" THEN
  197. FG 3}Enter filename : {INPUT searchstring
  198. ELSE
  199. FG 3}Enter keyword : {INPUT searchstring
  200. ENDIF
  201. NL
  202.  
  203. totalsearched%=0               | Total number of files searched
  204. searchcode%=0                  | First call
  205.  
  206. FG 4
  207.  
  208. REPEAT
  209.  
  210. FILESEARCH fa%,searchcode%,100,searchstring,searchtype="N" TO searched%,result%,searchcode%
  211.  
  212. totalsearched%=totalsearched%+searched%
  213. TAB 0 PRINT "Searched "+totalsearched%+" files" CLL
  214.  
  215. IF result% THEN
  216.  
  217. | At this point 'result%' contains the file number of a matching file.
  218.  
  219. NL PRINT "File #"+result% NL
  220. ENDIF
  221.  
  222. UNTIL searchcode%=0
  223.  
  224. FG 5}
  225. Search finished
  226. {
  227. GOSUB anykey
  228. CLOSEFILEBASE
  229. ENDSUB
  230.  
  231.  
  232. 4/4. Using the message base facilities
  233. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 
  234.  
  235. Chapter 5 : Writing doors
  236. -------------------------
  237.  
  238. There can be two types of doors for NewsFlash.
  239.  
  240. There can be doors which are simply run when they are needed and one of each
  241. is needed for each line that runs the door. These will be referred to type 1
  242. doors.
  243.  
  244. There can be doors which are running permanantly and are called up by the BBS
  245. via a WIMP message. These doors must be able to handle a request for
  246. connection from each line. These will be referred to type 2 doors.
  247.  
  248. Doors may also force a connection. To do this a door just claims a line
  249. without warning and then releases it when finished..
  250.  
  251. Type 1 doors are (usually) run by the script command RUNAPPa. This command
  252. will run the door and pass the line number for it to start on on the command
  253. line string.
  254.  
  255. For example..
  256.  
  257. RUNAPPA "<NewsFlash$BBS>BBS.Chats.!AIChat"
  258.  
  259. from line 1 will perform..
  260.  
  261. SYS "Wimp_StartTask","<NewsFlash$BBS>BBS.Chats.!AIChat 0"
  262.  
  263. (line numbers start from 0 for doors!)
  264.  
  265. The 'A' flag must be present if the door is to start in a 'controlled' way.
  266. It stands for Acknowledge. If it is not present the BBS may be half redrawing
  267. the menu before the door starts...which will look messy! :-)
  268.  
  269. Type 2 doors are started by the NewsFlash message NewsFlash_StartDoor which
  270. is triggered by the script command STARTDOOR.
  271.  
  272. For example..
  273.  
  274. STARTDOOR 0
  275.  
  276. will request the NewsFlash supervisor door to start.
  277.  
  278. Once the door has been started their is very little difference between type 1
  279. and type 2 doors.
  280.  
  281. Once a door has been called to start NewsFlash will wait for an
  282. Acknowledgement that the door has claimed the line. It will wait 5 seconds
  283. before timing out and continuing with the script as normal.
  284.  
  285. Once the door has started as a WIMP task it must claim the line it is to
  286. control to stop take control from the script file. The script will be paused
  287. until the line is released. To claim a line a door must perform..
  288.  
  289. SYS "NewsFlash_ClaimLine",line%,grabscreen%,bufferblock%,taskhandle%
  290.  
  291. where line% is the line number of the door is running on, grabscreen% is
  292. non-zero to request the screen to be grabbed (so it may be redraw when the
  293. door releases), bufferblock% is a pointer to a block containing details of
  294. the buffers to be used (or 0 for default) and taskhandle% is the WIMP task
  295. handle of the door (must be non-zero).
  296.  
  297. Once a door has claimed a line (and it has not forced a connection) it must
  298. acknowledge that it has claimed the line succesfully.
  299.  
  300. To acknowledge to NewsFlash a door must perform..
  301.  
  302. SYS "NewsFlash_Acknowledge",line%,1
  303.  
  304. where line% is the line number the door is running on. The '1' in R1 can be
  305. any non-zero word but use 1 for future compatability.  
  306.  
  307. A door may now use the following SWI's to send and receive data:
  308.  
  309. NewsFlash_SendByte
  310. NewsFlash_SendMany
  311. NewsFlash_GetByte
  312. NewsFlash_GetMany
  313. NewsFlash_VDU       (not implemented)
  314.  
  315. The data passed to and from the door is buffered between WIMP polls so a door
  316. should take this into account and not assume that all the data it tries to
  317. send will be sent! It must keep trying to send the data whilst WIMP polling
  318. until all the data has been sent.
  319.  
  320. Once the door has finished it should release the line using..
  321.  
  322. SYS "NewsFlash_ReleaseLine",line%,redrawscreen%
  323.  
  324. where line% is the line number the door is running on and redrawscreen% is
  325. non-zero to redraw the screen as it was before the door claimed the line (the
  326. screen must have been grabbed first).
  327.  
  328. A door may easily obtain information on the line it has claimed using the
  329. SWI's listed in the SWI's file.
  330.  
  331. If a door is to be 100% 'legal' it should listen to all the NewsFlash WIMP
  332. messages. It will be informed if a user has disconnected unexpectedly or if
  333. the BBS is being quit..and many other things too. Refer to the Messages file
  334. for more information. 
  335.  
  336. Chapter 6 : Using doors from other systems
  337. ------------------------------------------
  338.  
  339. NewsFlash will run most ArcBBS and RiscBBS doors. However, RiscBBS doors are
  340. not guaranteed to run reliably on multi-line setups.
  341.  
  342. The doors will run without any modification..
  343.  
  344. To run RiscBBS doors use the command STARTRISCBBSDOOR
  345.  
  346. For example.. (to start the Tetris door)
  347.  
  348. STARTRISCBBSDOOR "<NewsFlash$BBS>Games.!Tetris 0"
  349.  
  350. Use a task handle of 0 in place of the RiscBBS task handle. I have had no
  351. problems with it.
  352.  
  353. Note: To run RiscBBS doors you will need the RiscBBS door emulator loaded.
  354.  
  355. To run ArcBBS doors you will need to refer to the help file supplied with the
  356. door but here are a few conversions for commands..
  357.  
  358. ArcBBS                  NewsFlash
  359.  
  360. OSCLI "WimpTask ..."    RUNTASK "..."
  361. DOOR ...                STARTARCBBSDOOR ...
  362.  
  363. This should be all you need to know.
  364.  
  365. Note: To run ArcBBS doors you will need the ArcBBS emulator modules loaded.
  366.  
  367. Appendix:
  368. =========
  369.  
  370. A: Credits
  371. ----------
  372.  
  373. NewsFlash was written by Chris Davis.
  374. Demo BBS by Alex Howarth
  375.  
  376. A lot of thanks must go to Alex Howarth for testing, spreading the word,
  377. designing some decent app. sprites, giving me plenty of encouragement and
  378. coming up with a more original name than 'ArcHost' :-)..
  379.  
  380. Thanks also to Niall Douglas for providing some helpful pointers and mod's
  381. for getting NF to run under RO2.
  382.  
  383. B: Contacting me
  384. ----------------
  385.  
  386. If anyone wishes to contact me please send e-mail to:
  387.  
  388. Chris Davis..
  389.  
  390. Fidonet         2:253/417.6 or 2:257/501.7
  391. Internet        chris@armadilo.demon.co.uk
  392. Highlander BBS  01452 384557/384702
  393. Phone           01242 244227
  394.  
  395. C: License
  396. ----------
  397.  
  398. This software is shareware and copyright Chris Davis 1995
  399.  
  400. To register this software send 10 ukp to:
  401.  
  402. Chris Davis
  403. 234 Prestbury Road,
  404. Cheltenham,
  405. Glos.
  406. GL52 3EY
  407.  
  408. D: Software used
  409. ----------------
  410.  
  411. All sources written using !Zap 1.10 by Dominic Symes
  412. All sources assembled using BBC BASIC V (with BAX)
  413. Templates created using !TemplEd 1.27 by Dick Alstein
  414. Iconsprites create using !Paint (AFAIK)
  415. Some testing done using !FeedBack by Chris Davis (quick plug there! :-) )
  416.  
  417. All system operating done by Risc OS 3.10 ! :-)
  418. All reminders of TV progs starting provided by !Alarm 2.37
  419. All free memory shown by Free Memory Display 1.03 by Liquid Silicon
  420.  
  421. E: Boring specs
  422. ---------------
  423.  
  424. Source size and assembly time details:
  425.  
  426. Source              Size    Assembly time  Lines    Size     ~Lines/Instructions
  427.                     (Input) (ARM 2 A3000)  (Source) (Output) (Output)
  428.  
  429. NewsFlash !RunImage 150K    5.09           8607     25K       6000
  430. NewsFlash (MOD)     500K    17.76          28232    79K       17500
  431. Server (MOD)        103K    2.55           5725     15K       3750
  432. Compiler (MOD)      113K    3.14           6581     20K       5000
  433. Compiler !RunImage  36K     0.72           2139     5K        1000
  434. ArcBBSFl            5K      ?.??           228      652       150
  435. ArcBBSEm            14K     ?.??           784      1900      500
  436. RBBSEm              11K     ?.??           630      1436      350
  437. NFCache             8K      ?.??           487      1304      300
  438.  
  439. Well. That was fascinating wasn't it!! :-)