*********************************************************************** 950423 - Tech dokumentation for ScriptServ and CfgType *********************************************************************** ScriptServ.doc ScriptServ is used by the comm program script to obtain data from the bbsread.library. The data obtained are the data about the events and the setup for the bbs. ScriptServ has the following parameters: BBSNAME - Name of bbs to serve. EVENT/N/K/M - The events the script can perform. Only events of the types given is written to the events datafile called "T:bbsname.EVENT". DONE/K - Number of event to mark as done. ERROR/K - Number of event to mark with an error. WRITECFG/S - Will write a file with configuration for the bbs. The file is called "T:bbsname.CONFIG" PACKAGEDONE/S - Mark all packed events as done. This should be used after a package of events has successfulle been transfered. Example a QWK package. RENAMEGRAB/S - Check for grabs to rename. Will give the grab a number so it will be parsed in the correct order if there are more than one. PRIVUPLOADFILE/K - Check if a comm program login capture from a ABBS/MBBS BBS contain messages about private files. UPDATEFILENOTES/K - Set the filenote of downloaded files to the short description of the file. The description most have been catured from a ABBS/MBBS BBS. *********** Format of configuration file: VERSION 3 BBSID <- ID of bbs. BBSTYPE <- Type of bbs. BBSDIR <- Directory where the files for this bbs is. POSTCONF <- (Assumed) name of conference for private mail. UPLOADDIR <- Uploaddirectory. USERNAME <- Username configured for this bbs. USERSTREET <- Userstreet configured for this bbs. USERADDRESS <- Useraddress configured for this bbs. USERCOUNTRY <- Usercountry configured for this bbs. USERPHONE <- User phone number configured for this bbs. NEWFILES (y/n) AUTOPRIVDNL (y/n) AUTOLOGOFF (y/n) USECOLORS (y/n) ANSIMENUES (y/n) BULLETINS (y/n) ********** Format of event data file: EVENTNR <- Use when marking done/error EVENT <- ID number for event <List of tags in same order and number as in type config. One on each line.> EVENTNR EVENT ........... ........... and so on. ********** Event ID numbers: EVE_ENTERMSG 0 - Enter message EVE_REPLYMSG 1 - Reply message EVE_JOINCONF 2 - Join conference EVE_RESIGNCONF 3 - Resign conference EVE_DOWNLOAD 4 - Download file EVE_UPLOAD 5 - Upload file EVE_CONFLIST 6 - Get conflist EVE_CONFIGUREBBS 7 - Set correct configuration on the bbs. EVE_SENDUSERINFO 8 - Send userinfo EVE_FORWARDMSG 9 - Forward a specific message to another user EVE_GETNEWFILES 10 - Get new files listing EVE_DOCOMMAND 11 - Command the script should do EVE_AUTOLOGOFF 12 - Autologoff on next session EVE_RETRACTMSG 13 - Retract message from bbs EVE_RETRACTFILE 14 - Retract file from bbs *********** Event tags id numbers: EV_ToName 0 EV_ToAddr 1 EV_Subject 2 EV_Conference 3 EV_RefNr 4 EV_RefOrginalNr 5 EV_RefId 6 EV_MsgFile 7 EV_Private 8 EV_LocalFile 9 EV_Directory 10 EV_FileName 11 EV_DownloadNotify 12 EV_FileDescr 13 EV_DetailedFileDescr 14 EV_FromMessageNr 15 EV_ToMessageNr 16 EV_CommandString 17 EV_Boolean 18 EV_Date 19 EV_PGPSignID 20 EV_PGPEncryptID 21 EV_RefConference 22 EV_Urgent 23 EV_Important 24 EV_Confidential 25 EV_ReturnReceipt 26 EV_Encode8bit 27 The different event tags are described in BBSReadRexx.doc/WRITEBREVENT. ------------------------------------------------------------------------- ******** Example NComm script: ; $VER: example.script 3.1 (23.04.95) REQUEST OFF set $done = "FALSE" ; Get configuration and events for the bbs. $BBSName is defined in the ; startup script. cli $THORPath"bin/ScriptServ \""$BBSName"\" WRITECFG EV 0 EV 1 EV 2 EV 3" ; Open configfile and read the configuration varfile "t:"$BBSName".CONFIG" readvar $CfgVer readvar $BBSID readvar $BBSType readvar $Path readvar $PostConf readvar $UpLoadDir readvar $UserName readvar $UserStreet readvar $UserAddress readvar $UserCountry readvar $UserPhone readvar $NewFiles readvar $AutoPDnl readvar $AutoLogoff readvar $UseColors readvar $AnsiMenues readvar $Bulletins varfile close ; Check for correct version if !$CfgVer == "3" then message "Incompatible version of ScriptServ" if !$CfgVer == "3" then goto AllDone cli "delete >nil: \"t:"$BBSName".CONFIG\"" [...] ; Logon handling here. ;***************** Event loop ; There will be no eventfile if there are no events. if !exists "t:"$BBSName".EVENTS" then goto afterEvents varfile "t:"$BBSName".EVENTS" eventLoop: set $done = "FALSE" readvar $eventnr readvar $event ; Loop until the end of the file is reached. if $eventnr == "EOF" then goto evLoopEnd if $event == "EOF" then goto evLoopEnd if $event == "0" then gosub EnterMsg if $event == "1" then gosub ReplyMsg if $event == "2" then gosub JoinConf if $event == "3" then gosub ResignConf if $done == "TRUE" then cli "run >nil: "$THORPath"bin/ScriptServ \""$BBSName"\" DONE "$eventnr if !$done == "TRUE" then cli "run >nil: "$THORPath"bin/ScriptServ \""$BBSName"\" ERROR "$eventnr goto eventLoop evLoopEnd: varfile close afterEvents: [.....] ; Rest of script and subroutines follow. end ;******* EnterMsg: ; Read event tags for enter message event. readvar $conf readvar $sendto readvar $msgfile readvar $subject readvar $private if $private == "" then set $private = "0" if !$private == "0" then set $private = "y" if $private == "0" then set $private = "n" [....] ; Perform enter message event. set $done = "TRUE" return ; For more examples check out AMBBS.NComm.script ------------------------------------------------------------------------- ************************************************************************* CfgType.doc CfgType is used to make the configuration for a BBStype. It has the following parameters: TYPENAME - Name of type to configure. NEWTYPENAME/K - New name of type is the type should be renamed. Only unused types can be renamed. MSGPARSER=MP/K - Command to parse and add the messages recieved to the database. LINELEN=LL/K/N - Max length of message lines the BBSType allows. SUBJECTLEN=SL/K/N - Max length of subject the BBSType allows. FILEDESCRLEN=FL/K/N - Max length of filedescrition. CHARSET/K - Which charset the bbs uses: Available charsets are ISO/IBN. AVAILSCRFLAGS=ASF/K - Which scriptflags are available for this BBSType. Hex-number with the flags or'ed. FILENAMELEN=NL/K/N - Max length of filenames on this BBSType. EVENTPACKER=EP/K - Command to pack events into a package to transfer. NOEVENTPACKER=NEP/S - This BBSType has no eventpacker. EVENTARCHIVER=EA/K - Name of archivertype to use for achiving the eventpackage. The archiver must have been configured in the global configuration. NOEVENTARCHIVER=NEA/S - This BBSType should use no archiver for the packed events. CONFIGEVENT=CFGE/M/K - Config tags for the events. See below for docs. DELETETYPE/S - Delete configuration for this type. DELETEEVENT/K/N - Delete tag configuration for a event. SETTYPEFLAGS=STF/K - Set type flags for this bbstype. CLEARTYPEFLAGS=CTF/K - Clear type flags. ACCEPTPATTERN=AP/K - Pattern to match grabs with. Default is #?. INITMSGFILE/K - Command to initialize message files. EXTCONFIG/K - Command for extrernal bbs configuration. QUOTETYPE - Default quote type for this bbs. A eventdescr consist of: eventnr:needtag,needtag,...:opttag,opttag,... Examples: cfgtype MBBS ConfigEvent 0:0,1,2,4:5 ConfigEvent 1:1,2,3,4:5 Configures 2 evenets for the bbstype called MBBS. These are: - EVE_ENTERMSG (0) which needs the following tags: ET_SendTo (0), ET_Conference (1), ET_MsgFile (2), ET_Subject (4) Optional tags are: ET_Private (5) - EVE_REPLYMSG (1) which needs the following tags: ET_SendTo (0), ET_Conference (1), ET_MsgFile (2), ET_ReplyTo (3) ET_Subject (4) Optional tags are: ET_Private (5) The definitions of each tag see ScriptServ.doc For examples of the use of CfgType see Thor:s/cfg#? files. If you have any questions concerning ScriptServ or bbs type configuration, feel free to send an email.
Go to the first, previous, next, last section, table of contents.