Nicron #119
17 ноября 2000
  Железо  

Iron - Automat, a system of external control and monitoring based on the Spectrum compatible computers, BAT FILE PROCESSOR v1.00, Robot v5.50 for Batproc v1.00.

<b>Iron</b> - Automat, a system of external control and monitoring based on the Spectrum
compatible computers, BAT FILE PROCESSOR v1.00, Robot v5.50 for Batproc v1.00.
(C) Spencer Winset of Diamond group

    Merlin of Diamond group


  In our time, is a lot of words about the insolvency of the 
Spectrum As a full-fledged home computer, because of scarce

hardware capabilities. However, many processes do not require 
excess speed and large amounts of memory, such as: sharing

mail from the BBC, the performance of the functions AONa, the 
controller of security and fire safety management of the entire 
spectrum of electrical instruments, etc.



  Our team will develop and implement a system
external control and monitoring (Automat), based on 
Spektrumsovmestimyh computers. Below is an example of the 
organization such a system to automate e-mail

in the standard FTN (Fido-like network).



                 AUTOMAT



  Complex software and hardware will include:

1) * CMOS-clock
2) Scheme to enable or disable the computer's power. Controlled

   alarm clock, program port power management

   and, for stations in computer networks, the inclusion of the 
telephone 

   call.
3) * The scheme of strengthening TR-DOS when the power to ensure
   of auto-start programs boot.B


  All of the above hardware but hours will be
completely blocked by the switch ON / OFF.

4) * EMS + overlay BATPROC
5) EWS or REAL COMMANDER + overlay similar to those programs
   Moms
6) * PKUNZIRm
7) LARA CROFT for Automat

*- Already implemented



Work will take place eg as follows:

- At 23:00 triggered alarm (1).

- Scheme (2) includes power to your computer.

- Scheme (3) - activates the TR-DOS for startup.

 - Loading Program (5), which has the name "boot.B", which
 This system serves as the nucleus. All other programs
 considered external. Runs overlay broadcast batfaylov.

 - Checks the current time on the list of events that may
 turn on the computer (ie, for proxy authentication events
 verified list of the times, which can be installed in
 Alarm in coincidence with the real). If you find such a
 transition time for processing this event, otherwise we assume 
that  computer running the user and stop translation

 batfayla or, for BBS - believe that a phone call and
 run EMS. For the described example, began at 23:00
 e-mail an hour, that time is on the list of events and overlay
 goes to processing tasks WORK_WITH_BBS.

problem: WORK_WITH_BBS

 - Set the alarm time in N minutes
 forward, N depends on the time required to perform
 current task, such as for dial-in BBS might consider it
 time for 1-2 hours. If the problem has not been correctly
 completed (eg crash happened outside the program)
 re-triggering the alarm will generate an alarm off
 supply.

 - Set a variable that is responsible for execution
 previous actions. All variables are recorded in
 unused sector of the system tracks, now at the start already
 will not be checked a list of events on the value of this
 variable directly you can go to the next step of this
 events.

 - Runs an external program that processes the current event
 (In our example - EMS, which has, in turn, also have
 overlay broadcasting batfaylov).

   In the normal completion of any external program should
 apply to the following address # 0000 in Rom TR-DOS, that will 
re-  Start the core (Commanderie and translator batfaylov).


 - Runs came package extractor *. zip - software
 PKUNZIPm.B - unpacker is an option that automatically
 Unpack zip files and runs the program, whose name is
 spelled out in the setup - in our example it is the same
 "Boot.B".

 - The compiler starts the next external program - LARA
 CROFT, adapted for automatic operation: when you call her
 kernel should not be prompted to install the current time, and
 should directly enter tosser, after tossinga should
 start the kernel.

 - The kernel removes intermediate files: *. zip, *. CKT, all 
other  files downloaded from the BBS additional moves to the 
hard drive  (With them) to one of the TRD-archival images, 
compresses  disc.


 - Task WORK_WITH_BBS completed. Kernel determines what should 
be  her list of events that would determine the subsequent

 inclusion. Assume given a task at 07:00 ALARM. Set
 the alarm for 7:00, parking heads of all used
 drives on the last track to protect the drive against surge
 power while turning - turn off your computer and turn off
 powered by checking the corresponding bit in port management
 nutrition.

- At 07:00 triggered an alarm clock and turn on the computer.
Load the kernel, is determined the current task.

problem: ALARM
- Launch a program "ALARM.B". She works as an alarm clock,
and then quits, and starts the kernel.

- Terminate processing tasks ALARM, provides as follows: in
23:00 problem WORK_WITH_BBS and over again.


Possible option:

  - At 17:00 the computer. A problem with such a time in

  event list is not found, apparently a user sat

  read mail. Execution batfaylov stops

  computer works normally.


  Of course, during operation keeps a log file.



            - -


  We represent the overlay BatProc - part of the above
system of external control and monitoring, which we hope
will be available for full automation of certain tasks on
computer ZX-Spectrum.


    BAT FILE PROCESSOR v1.00


Copyright KVA of E-Mage group (BATPROC v0.99) 27.08.1999
Copyright Merlin of Diamond group (BATPROC v1.00) 17.09.2000

BAT FILE PROCESSOR (BATPROC) is distributed free-Freeware.


  Placement program at the sites and CDs are permitted only if
subject to copyright. Should be preserved or reproduced
all copyright notices on all copies of the program.

 All rights to the product belong to E-Mage 'Diamond group
and protected by laws and international copyright
Rights.

The authors describe: Eugene Golyakov / Spencer Winset of 
Diamond group          Dmitry Nesmachniy / Merlin of Diamond 
group          Viktor Kuzmin / KVA of E-Mage group



               INTRODUCTION


  This overlay is intended to control the program EMS
(E-MODEM STATION) version 2.55 by translation of BAT
files. When you load the overlay loads BAT file and main.b
executes it with the tags event @ autorun, if it is found. When
called overlay by clicking on the 'BatProc' panel EMS,
the program will begin with a zero row in series,
until they are met by construction of the branch.


  Program's execution can be interrupted long (more than 2 
seconds) pressing the BREAK (SS + SPACE), or the right mouse 
button, or press will install the current error 4 (BREAK 
PRESSED), and execution program will continue, stopping the 
current process. This true for the work processes of EMS, 
coupled with external devices such as disk drives and modems.


  In other cases, an executable program is interrupted 
immediately. 



                     New in BATPROC v1.00


> Posted 25 teams:

   load ifnotspacetr unmarked ramtop

   loadasm ifnotspacerc clearmarktr move

   callasm ifspacetr clearmarkrc safemove

   static ifspacerc ifnotmarkedtr poke

   dinamic markarcon ifnotmarkedrc peek

   clearmem markarcoff setldmode free
                        cattolog

> Posted 4 Tracking error:

   - Catalogue damage code-15

   - Ramtop no good -16

   - No memory or wrong allocate -17

   - Move in online -18

> Changed jobs masks:

   - Floating argument

   - Mnogobukvennoe extension

   - Length of file

   - More / less in length file

   - Any single character "?"

> Modular Bat file ($ label - file-mark)
> The output values ​​of variables and expressions in the 
terminal / Log file > Error messages are broadcast

> Broadcast hexadecimal calculation system
> Permissible to use tabs
> Permissible use of comments

> Fixed bugs in previous versions:

   - Ifmarkedrc

   - Ifmarkedtr

   - Incerr

   - @ Disconnect update event uninstall



           PROGRAMMING THE BAT-file


  In programming for BATPROC commands can be used, and labels
uppercase and lowercase characters are not distinguished by the 
translator. An exception is the listening of commands, using as

argument, mask, and file-mark. Description of all commands and 
types of marks will be given below. You can not use a few 
commands in a row, with the exception of the branching 
structure. 


             BRANCHING STRUCTURES

-CONTINGENCIES: command1 command2, where command1 is a team
branching, and command2 transition team goto, call, call
or any other team. Under certain conditions
occurs the following command current row, otherwise
airs next line.

Example: ifonline goto label; if the pipe on the modem is 
removed, then     ... , Then go to the tag label

    ifmarkedrc call label2; if marked at least 1 file
    ... , Then the call podprogramy label2
    ifnotmarkedrc call label3; if labeled 0 files
    ... , Then the call podprogramy label3
    onerror goto label4; if an error occurs, then the transition
    ...
    onerror 6 tolog ~ disk error
    ... ; Precise error
    ifbbsoff bbson; if the regime of BBS is not included - to 
include     ...

    errors # 10 stop; if you have accumulated 16 errors,
    ... ; Exit program


  Conditional branching structures can be used
konyuktsiyu logical AND of all the terms in a row, with their
number is limited only by memory resources. Of all
operators of the last row will be executed only if all
previous conditions are true.

Example: ifbbson ifonline onerror 0 tolog ~ bbs online 
correctly.     ...

    if .8> 0 if .8 <20 if .8 ~ 15 tolog .8 = [1-19] except 15.
    ...
    ifmarkedrc ifspacerc ifonline rcfiles; if the reception
    ; Labeled files for them to have a place on my current
    ; Disk does not lose connection to the remote subscriber
    ; To marked files.


-UNCONDITIONAL: command, where command is the command transfer
          goto, call, call back or return.


                TEAMS


adopted the following notation:

<. Var> - any variable var where her single-byte number.
     Variable holds only a single byte number [# 00 - # FF],
     if you try to assign a variable to a value greater
     # FF then the variable will get only low byte
     result
 - any double-byte number [# 0000 - # FFFF], we assume 
decimal,     also allows replacement  on <. var>, but in 
this     If the value  limited [# 00 - # FF].

<expr> - any expression analog , allowing successive (left 
- right) to perform mathematical      operations of addition 
and subtraction, for the constants and       variables <. 
var> <mask> - Mask any filename [. ext] [. len]

<label> - any label
 - the index of the drive: A, B, C, D (or a, b, c, d)
<number> - number of digits [0-9], only for the command dial
 - specifier response EMS, only for the regime BBS ON:
       Accessing OK, Access denied, Post area opened, etc.
<logstring> - string to write to a log or a caller in
          tolog commands and transmit, as well as any team
          to work with EMS mode BBS ON:
          . Log,. Con,. Send,. User,. Refresh, etc.
<mode> - drive used command,
     podgruzku files from disk. Symbols: A, B, C, D, T, S
     (Or a, b, c, d, t, s)



online - pick up the receiver on the modem
offline - to hang up the modem

ifonline - if the EMS in the state removed the tube, perform 
the following            schuyu this command line, otherwise go 
on the underlying        team

ifoffline - if the EMS in the state of the handset, to perform
        the following command line, otherwise go to
        underlying command

dial <number> - dial <number>, let the separator '-'

rccat - Download the current directory subscriber
rccat  - free directory of the drive  subscriber 
and do             his current

readcat - read katolog its current drive
readcat  - read your disc and make the current 

markrc <mask> - mark on the right side (subscriber) files
marktr <mask> - mark on the left pane (your disk) files

ifmarkedtr - if something is marked on the left panel, perform
         the following command, this line
ifmarkedrc - if something is marked on the right pane, perform
         the following command, this line
ifnotmarkedtr - if nothing is marked on the left pane, then
        run the following command line that
ifnotmarkedrc - if nothing is marked on the right pane, then
        run the following command line that

unmarked - to remove markings from those files marked on the 
panel        subscriber with the same name that is on your 
panel.        To remove the label must match the name

       expansion, starting address and length of the file (ie
       removes the label from dupov that would not shake the 
fact that        already have on your hard drive)


clearmarktr - remove all files marked with your panel
clearmarkrc - remove all files marked with a panel of subscriber
          (This is much faster than perezaprashivat directory
          for removal of markings)

markarcon - enable auto-tagging ZXZIP archives.
        In this mode, when marking the first file from a large
        archive other files with names and ********. ZIP
        continuous structure, will be marked automatically
markarcoff - disable auto-tagging ZXZIP arch Islands (the 
default mode is off) 

trfiles - transfer selected files
rcfiles - take the selected files

ifspacetr - execute the next statement, if the drive subscriber
        enough space to write files that are marked on your
        CD
ifspacerc - execute the following statement if your disk
        enough space to write files that are marked on the disk
        Subscriber
ifnotspacetr - execute the following statement, if the disk
           subscriber is not enough space to write files,
           marked on your hard drive
ifnotspacerc - execute the following statement if your disk
           not enough space to write files that are marked on 
the            drive subscriber


goto <label> - go to the specified tag

call <label> - call a procedure (stored on psevdosteke
           return address)
return - return from a procedure

tolog <logstring> - to issue a log message <logstring>
transmit <logstring> - issued in the log and send a
            Post <logstring>
sendcommand <logstring> [|  [| ]] - send 
command.     Automatically adds the code 13 to the end 
<logstring>.     After that, waiting for the arrival of some 
two string'ov,     indicated below (if no second |, then the 
second row     equals Access denied, if not the first |, then 
the first     line will Accessing OK). If you come the first 
row,     mistakes will not (equal 0), if it comes second row,

    it will be error 12, if within a certain time or
    one of these lines will not be accepted, it would be a 
mistake     (No answer)


sendbreak - send a signal to break

clearlog - clear log
savelog - keep a log of the current disc
cattolog - throw in the log directory subscriber

bbson - enable bbs mode (if enabled, err = 0)
bbsoff - bbs off mode
ifbbson - if bbs enabled, execute the following command
ifbbsoff - if bbs are disabled to execute the following command

setdiskrw - set the flag file sharing
resdiskrw - reset the flag file sharing

ifdiskrw - execute the following command line, if adopted
       or passed at least one file (the flag
       file sharing)

setspd  - set the speed 
onspd  - command, if the speed is 

stop - stop the program (even if there is something on the 
stack) 

stopmain - removed from the processing of an intercepted event. 
Used        in the processing of labels of events


runbasic <mask> - run the first matching mask <mask>
          basic-file (in the mask extension '. B' indicate
          not required)

windowsoff - erased from the screen of any additional windows,
         leaving their content in memory
windowson - show windows that were saved by a team windowsoff

onerror - if an error occurs, execute the following command
      this line
onerror  - the same as the onerror, only the performance 
will be             if an error occurred with the number 

onerror =  - make the current error is 

errors  - if it was  or more errors, perform
           the following command line
errors =  - make the current number of errors equal 

decerr - reduce by 1 the number of errors
incerr - increase by 1 the number of errors (errors
     itself increases with the add event)
pusherr - remember to psevdosteke current number of errors
poperr - psevdosteka recover from errors

wait  - wait  Mounting
waits  - wait  seconds

poke ,  - written in memory at 
              value 
peek <. var>,  - read variable <. var> value
              from memory at 

setldmode <mode> - set the drive which will be
           Team work: load, loadasm, runbasic,
           savevar, loadvar, as well as file-tag.
           Possible values ​​<mode>:
             a, b, c, d - will install for these teams
           appropriate drives
             t - these teams will work with the current
           drive
             s - these teams will work with the system
           drive (ie, the same drive from which
           occurred loading overlay BatProc)

clearmem - remove all modules podgruzhennye using the file label
       from memory and free the memory for example
       alteration of boundaries of distribution

static - set the mode in which the boot program
     (Double-click the cursor on the panel or the EMS team
     LOAD) will not change the boundaries of memory allocation,
     and save the values ​​of variables. Introduced for
     conservation of previously retrieved code blocks
dinamic - set the mode in which the boot program
      border bat-file will be installed in # FF00, and
      variables will be cleared. Installed by default

ramtop  - to establish the limits of memory allocation. 
Overlay            located in the fourth page of memory. It

           addresses # C000 - # DCAB (this version)
           is itself intrepritator from the address # FF00
           are variables. To accommodate the program /
           code blocks available in memory [# DCAC-# FF00],
           and to address # DCAC to  after working
           This command will be the window, and with  to
           # FF00 - box code blocks. When you try to
           download a program that do not fit into the window
           program or code that goes beyond the code window will
           generated an error 17. If the error 1917 will cause
           loadable program, the message this will be
           displayed in the log. In general, this command 
corresponds to            BASIC command CLEAR ADDR, when she

           used to reserve space for code
           block, only if this does not happen purification
           variables and the code window starts at address
           specified in the command, and not the next, as in
           BASIC. If the value goes beyond 
           [End loaded program - # FF00] will be issued
           error code 1916 (RAMTOP no good)

free <. var> - recorded in the variable <. var> amount of free
          memory window in the sectors (ie
          calculates the INT ((RAMTOP-END_PROGRAMM) / 256))

loadasm , <mask> - load the first matching the mask
            file at . If the file goes
            beyond the code window will be installed
            Error 17 and the load will not
            produced. All calculations are done
            sectors, loading also occurs
            sector-wise, so be careful:
            it is possible that podgruzhenny
            file erase previously loaded code
            unused balance of the sector

callasm  - Transfer control machine code at
        . The team is potentially dangerous, so
        before use, make sure that the code block
        was normally loaded (error 0)
load <mask> - get to the place of the current program and new
          execute it with a zero line. Tag Event
          @ Autorun ignored. If there is insufficient memory
          Post about it is issued in the log is generated and
          Error 17. In the dinamic before downloading
          removed box codes (RAMTOP = # FF00) and purified
          variables (for the program to "clean
          Sheet "), this is the default setting.

erase - remove on the left side (my) marked files

move - sealed drive. For work of this team that need to be

       tube was placed on the modem, otherwise the command

       shall be made and an error 1918 (move in

       online). Restriction is to avoid situations

       when, during a call to the BBS will all be waiting when 
the 

       have now occupied the line to finally, move
safemove - the same as the move, but the work will be done by
       one file, overwriting the directory after copying
       each file, which should provide a more reliable
       team work, but more slowly, to the same
       leading to more rapid deterioration of floppy disks and 
drives. 

settime : :  - set the time, hh: mm: ss
readtime - read the time, reads the variables .2 (hours)
       .3 (Minutes) and .4 (seconds).
settimer  - set the timer on  seconds
resettimer - reset the timer (disable processing)
iftimer - if the timer is triggered, the following command
      current line
addtimer  - add a timer  seconds
________________________________________________________________
clrvar - assign all variables to '# 00'

let <. var> = <expr> - set the variable <. var> value <expr>

loadvar - load variables from 15 sectors 0-th path of the disc,
      established team setldmode
savevar - write variables for 15 sectors 0-th path of the disc,
      established team setldmode

push <expr> - written on psevdostek expression <expr>
pop <. var> - remove from psevdosteka 1 byte in the variable <. 
var> 

________________________________________________________________ 
if <expr1> <?> <expr2> - execute the following command, this 
line              under the condition <?>:

              = - Equality of expressions
              ~ - Inequality of expressions
              > - Expr1 expr2 more than
              <- Expr1 is less than expr2
________________________________________________________________


            USING THE CLOCK


  With the clock BATPROC works through the modem driver:

# C027 - SET_TIME
        in: A - Hours, B - minutes, C - seconds
        All data are in BCD format
# C02A - READ_TIME
        out: A, B, C.
# C02D - CALC_TIM
        called about every 1.5 Inta (as when)
        for not fully autonomous hours - for the rendering
        time.
# C030 - SET_ALR
        in: BC - the number of seconds for which
        set timer
        out: NC-ok, C-error.
 # C033 - ADD_ALR
        in: BC - add seconds
        out: see above
 # C036 - READ_ALR
        out: NC - noting, C - Timer triggered


  A more detailed description can be found in the ZX-FORMAT # 
6, where described by the driver for MMD. Driver for EMS 
differs only way to specify the velocity - the speed, 0, speed 
0, etc., maximum of 8 bytes at speed.

________________________________________________________________


              Working with variables


  Allocated 256 variables with numbers from 0 to 255. When
accessing the variable have to put an end to its number.
.0 Variable - number of the current error (onerror), .1 - the 
number of errors (errors), .2, .3, .4 - cells that alter the 
procedure work with time. Attention! The dimension of the 
variable 1 byte if the result of calculating the value of the 
expression will be more 255, the variable will be listed only 
the low byte of the result. 

________________________________________________________________ 
 

            LABEL EVENTS AND FILE-LABELS


  When you declare a label before it is always written ':' if
using tags ':' in front of it is not assigned. Tags events
begin with '@' character, the file-mark with '$'.


              Tags events


  Some of the events at work EMS, can be intercepted before they
processing, while BATPROC passes control to the appropriate 
event tag. After the execution of your subroutine, you can EMS 
return control to the processing of intercepted events stop 
command or ignore the event team stopmain. In the latter case, 
the operator removes stopmain queue problem 'Handle the 
intercepted event X', then the following line to the team stop, 
which stops the execution of bat File and BATPROC goes into 
standby mode events. 



  Label list of events:

@ Online - when lifting pipe (first called Caller ID, and then
      control is passed to this procedure)
@ Offline - is caused by lowering the pipe

@ Autorun - called when you first load the overlay and the new
       bat file

@ Connect - is invoked when you try to connect

@ Disconnect - call disconnected when you try to (SS + ENTER),
          first called this programm, and then
          there is a transfer package that the interruption
          been successfully
@ Ontimer - called after the timer is running (as counted
       time)


  You can use other tags the events, referring to them
team call and goto. From ordinary labels, they differ
the fact that when you access a non-existent standard label will
emergency shutdown of the program, and when referring to
defunct label the event the program continues with
next line.



              File-mark


  File tags start with a '$'. When the program
found the transition to file-label and this label is not in
program will attempt to load from disk,
established team setldmode, file name, which has
label. For example call $ one in the absence of the program line
: $ One ... try to load a program from the disk with the name
"One.b". Keep in mind: large and small letters
701fayl-labels are different! If such a file on disk does not 
have to be generated by the error number 13 (no file), and 
program execution continue with the next line. If the file does 
not fit in the window programs, run clearmem (remove all 
previously podgruzhennye on file-label program), the message of 
this will be printed in the log and will be followed by a 
second attempt podgruzki. If after this memory to load the file 
will not be enough, then will generate the error number 17 (no 
place), message This will be displayed in the log and the 
program continues with next after the transition line. All 
calculations are made in sectors. If the file is normally fetch 
in memory at the end program will be established mark used as a 
team transition, which in our example can be written:


# 0D, ": $ one", # 0D

and after it is placed the downloaded file. Loadable file is not
terminator team return, return at end of file
executed automatically.


  Example:

    call $ one
    call $ two
    call $ one
: $ Two ....

In this example, the first line to load the file 'one.b', file
'Two.b' second line searches will not be, because this label
is already in the program, the third line program 'one.b' as
will not be loaded because it is already loaded into the first
line, if the program read:

    call $ one
    call $ two
    clearmem
    call $ one
: $ Two ....

then the second time Podgruzka file 'one.b' will still be
made, as the team clearmem erase what was
is loaded at the time of its execution (in this case file
'One.b').



  Attention! It is not recommended to use a file-mark in the 
files podgruzhennyh on file-mark (ie, sub-file-mark). This

due to the fact that when you try to download another file for
memory deficits, the file from which it was handling the disk 
may be removed, then when you return an error stack, because it

will continue to point to the location in memory, which served
already deleted the file, and that will fetch at a place in 
advance can be predicted, therefore, either do not use nesting 
in File-mark or very closely monitor the memory. In

Basically, there is one more option: if you want to do
construction type:

    call $ one
    return

you can replace it with:

    goto $ one

if the return statement returns execution to the main program, 
even the destruction of the line goto $ one accident with such 
a record does not happen.



More on label:


  If a program is not a label on which you attempted to
pass, it will emergency stop the program.

  If a program is missing file-mark on you
attempted to pass, it will attempt to load a file from the disk,
in its absence, generated an error 13 and execution
program continues with the next line.

  If the program does not mark the event on which you
tried to move, then the program continues with
next line.



                 MASKS


  The mask is defined as follows: filename [. Ext] [. Len]

where: filename - file name, you can use '? "- any
symbol '*' - any number of characters including zero. If
filename is empty, then it is the name of the file containing 8
gaps. Limitations: filename can not contain more than 2
stars, as well as you can not write 2 stars in a row. Warning: 
Masked large and small icons vary!


ext - extension. If it contains 1, 2 or 3 letters, then 
searching will be made only by specified characters, if more, 
then other characters will be discarded if not specified at 
all, it will match any expansion. You can use the

symbol "?" to specify any character. '*' Symbol can be
used to specify any extension but only as a first
symbol ext, in other cases, '*' will set the symbol '*'.

len - the file size in sectors. Allowed to use the symbol
less '<' or more '>', to specify the length of the interval 
[0-len] or [len-255], respectively, where conditions are not 
stringent. If len is omitted, it matches all files. KEEPING in 
len NOT Allowed to use '. " without an argument and'.*'!!! 401



  Completely empty mask corresponds to the mask *.*

 Example of specifying a mask:

LARA.B = LARA. B - BASIC file named 'LARA'
PK *. B = PK ??????. B - BASIC all files with 'PK' first 2 
characters *. ZIP = ????????. ZIP - mark all files ZXZIP 
Archives * Id * - all files which contain anywhere there is a 
sequence of 'id' *.. <10 = 10 = *.*.< *.???.< 10 - All files 
less than 10 sectors 

       = *.* - Blank mask matches all files
*.*.# 1B - celebrating all the pictures (the star in the ext is 
not necessary 

          introduced for the similarity of format masks for IBM 
PC.) 


NOTE: For broadcast masks, leading spaces are ignored,
therefore recommended that the first space the file name 
replaced with '?' then followed by a space will be handled 
properly. 



              Output to a log


  In the commands and transmit tolog can be displayed in a log 
or send subscriber line of text. Also can use additional 
characters and control codes: 

    _ - Code 12, for cleaning windows terminala
     - Code 14, for a beep
     - Code 25, for proper disconnection of subscribers
    ~ - Code 126, for a newline

Arithmetic expression whose value must take into
the log, should be enclosed in the characters '`' (reverse 
apostrophe, SS + X in Latin case).


Example: tolog ~ current error = `.0` just `.1` error


NOTE: In the command argument tolog, leading spaces are 
ignored, so it is recommended to start an argument with the 
character translation line '~', then followed by a space will 
be processed correctly.




             REGISTRATION OF BAT-file


  For the convenience of the location of the text of bat-file 
you can use tabs anywhere you can use spaces.

When loading tab is simply replaced by a space, so do not
makes no sense to use tabs to <logstring>.

  To insert a comment, you can use at the beginning
character string ";" You can write comments, and almost all
teams, with the exception of the team, ending with
logstring>, <mask>, <number>



             ERROR MESSAGES


  For the convenience of debugging is now under erroneous 
situations occurs error messages in the log. Monitored the 
situation: 

    "Label'...' not found "no label
    "Wrong mask" invalid mask
    "Stack error" Error stack
    "Unknown command" unknown command
    "Wrong expression" invalid expression (or
                invalid in this command)

Also displays the line number where the error occurred and the 
name file if an error occurs in podgruzhennom on file-file mark.


List of error protection EMS + BATPROC:

00 - no errors (no errors)
01 - any error subscriber (no disk, disk full, read error,

     line error, dialing failed, etc.)
03 - fault line (line error)
04 - pressed BREAK (break pressed)
05 - The drive is not available (no user disk)
06 - disk is corrupt (disk error)
09 - running out of disk (disk full)
12 - do not have access to the section (access denied)
15 - catalog damaged (catalogue damage)
16 - invalid memory allocation (ramtop no good)
17 - not enough memory or an incorrect location

     (No memory or wrong allocate)
18 - seal in 'off-hook' (move in online)
________________________________________________________________


            - -


  For example, the use of batprotsessora we present here
an example of really working on the Moscow site, "RABBIT BBS"
robot (this name batfayla) to understand why it was written
as such and not otherwise, give a description of the site 
itself, made it an agreement on registration files, modes of 
operation site, etc.




F1 DESCRIPTION OF SERVERAF0

RABBIT BBS operates in different modes: 23:00-00:00 POSTAL 
HOURS;                 00:00-07:00 in night mode



            HOUR MAILING


  In the e-mail server provides an hour exchange of mail files 
for Registered site users.



  Appointment of discs:

A: to place the system files EMS: UserList.S etc.

B: for receiving PKT-file the form L *. PKT, created by editor

   Lara Croft.

C: the main zip drive, it is mail for points in a

   PKZIP-files with names like "MSKddmmN.zip", where the MSK -

   abbreviation of the name or alias Point (eg MRL -

   Merlin, SPE - Spencer), dd - day, mm - month of the 
establishment 

   packet, N - number of the packet (a, b, c. ..) for this 
number. Inside 

   zip-archive contains files for the FCT Point. Additionally, 
you may 

   Files to be so-called "hot-soap" that is, files

   written by Point RABBIT BBS or from another Point, or from

   man, regularly visiting a RABBIT BBS. For what
   the letter "hot soap reached the addressee, you must call

   it> 1234567, where 1234567 - recipient's phone number, or

   > NAME, where NAME - the name of the caller, such as> 
MERLIN.W or 

   > SPENCER.ZIP. Using the "hot-soap" is very convenient for

   local correspondence, since, firstly, does not require 
tossinga, 

   and hence faster reach the addressee, not be lost and will 
not be 

   overload tosser on the site, and secondly, so you can

   send not only text but also any other files. Except

   addition, the station may be placed in files named> ALL *.*

   (Circulars). To automate the exchange of files for these 
files 

   The following conventions: the files with the name> ALL .* 
can 

   write or sysop station or "newcomers"; Points in three

   the last symbols of the file name indicates his mask, that is

   they use the names of the files> ALL? MSK .*, it is 
necessary robot 

   Point, which will now be able to distinguish "their" 
circulars from 

   "Strangers", and can independently decide whether to send

   the file on the BBS and wash it at home and whether it is 
necessary to download 

   this file with BBS (that is, their circulars back does not 
swing). 

D: is used when the disk is full C:. Usually such a situation

   occurs if a Point or a few days did not pick up

   e-mail. Then the old post office that can be rewritten Point

   to drive D:, and on the C: drive is put a file named 
MSKpostD. , 

   informing that the Point MSK makes sense to look at

   drive D:, there for him something cooked.


              NIGHT


  After 00:00 pm the night begins operation station. In
night mode entrance to the station is not restricted, and the 
station operates as a BBS, that is used for downloading from 
its different software. In night mode discs are distributed as 
follows: 

A: newspapers and ekhi in text form for users

   do not have addresses in ZXNet.

B: a catalog of programs the station archive, catalog, Moscow

   collection of essays and serves to take files from users.

C: post for points, as in the mail an hour

D: misc: new games, systems, demos, lyrics, etc.



  The robot features a night mode of mail an hour in the catalog
drive B:. In the night mode on the drive B: is present frame
processing plant with its name. Therefore, if a directory B:
there is a file? RABBIT?. , The robot believes that the station
working in night mode.


  In night mode, or mail an hour RABBIT BBS can be found
in the password mode of EMS.


  Mode, enter the password for the security of correspondence:
in open mode, it is possible to take someone else's post, which 
is not so scary (though unpleasant), as dangerous, because in 
the morning automatically delete all the files whose names

will be found in the log (when transferring files the names of 
all accepted / uploaded files are written to the log).


  In password mode EMS server goes into BBS ON, and all
mail for points hidden in their mailboxes (only on disk
C:), so in night mode, a normal user password will not see on 
the C: drive is nothing, mail is only available after entering 
the password and for each Point, naturally, his own. All other

files are seen as normal, then there is no need to enter each 
time password if you do not call for personal mail. The robot 
distinguishes password and an open mode by the presence of a 
file in a directory mode off drive C:. He is always there, but 
when you turn on password mode, it automatically disappears and 
is unavailable. 


  In password mode, hot-soap "is injected directly onto
drive C:, it immediately gets into the box and the recipient 
gets it available, "hot-soap", uploaded to disk B:, perekochuet 
to disk C: Only the next day, when the sysop will overwrite it 
manually. 


  To support the password mode in DIAMOND group by Alexander
Eliseev / CDS is designed overlay MAILTOSS.O, which conducts
automatic tossing after each connection and automatically 
deletes files on the BBS, retrieved from the mailbox. ; Robot 
v5.50 for Batproc v1.00 ; 07.11.2000 (c) Diamond group


; RESTRICTIONS:
, The maximum length of the bat file is 8788 bytes (34 sectors)
, For this example, remove excess komenatarii

; Current example bat file:
; User: Goljakov Evgeny aka Spencer Winset
; Personal password: Goljakov; 123
; Postal Mask: SPE *.*
; Masks hot soap:> SPENCER .*
          > 1595023 .*
; Personal Circular:> ALL? SPE .*


; *** UNIT INSTALLATION ***

: Begin
: @ Autorun clearlog; event Autoplay
    let .17 = 5; dialers bbs (=. 17 * EMS 'redial attempts')
    let .11 = 5; chimes on the bbs (for disrupting 
communications)     let .15 = 2; konnekta initial velocity (2 = 
2400 1 = 1800)     let .18 = 5; errors to decrease the rate

    let .16 = 10; password attempts
    let .14 = 30; pause between typing the password and check 
the answer     let .20 = 12; pause between the two teams 
transmit consecutive     let .6 = 0; flag 1 = proizoshel chime 
due to errors     let .10 = 0; flag 1 = night mode / 0 = h 
e-mail     let .12 = 0; flag 1 = post D (in the mail. hour on D 
is a mail)     let .13 = 0; flag 1 = overfull C (C drive is 
full)     let .19 = 0; flag 1 = directory is already placed in 
the log     let .5 =. 15

    let .7 =. 18
    setspd .5; set speed konnekta


; *** UNIT CONNECTION BBS ***

    ifonline goto bl_in; if tube up then skip dialing
: Dial_b call dl_num; dialing (dialing) if err ifoffline goto 
exit_b; end the conversation with bbs     goto blb_l2; else 
continuing to work with bbs : Bl_in call dl_nm2; starts with 
the greeting without dialing                 ; Rates



; *** UNIT WITH BBS WHEEL B: ***

: Blb_l2 readcat a; update your drive A
    onerror call err_sd; if err call handler and
    onerror goto blb_l2; repeat the operation again
: Blb_l1 rccat b; take bbs disk B
    let .6 = 0; reset flag 'was ringing'
    onerror call err_sb
    onerror goto blb_l1
    markrc? RABBIT?.
    ifnotmarkedrc goto blb_p2; check bbs on mail per hour
                  ; If not? RABBIT?, Then mail. h
                  ; Else bbs in night mode
    markrc? RABBIT?.
                ; ^ Removed marking and established
    tolog ~ ___BBS found
    let .10 = 1; flag 'night mode' (not pocht.chas)
: Blb_p2 if .10 = 0 goto blb_p3
    if .19 = 0 cattolog; reset catalog bbs in the log and
    let .19 = 1; installation acc. flag
    call $ rabbitb
                ;> Call from the disk routines
                , Marking the files from yesterday
                , Log (prepared in advance)
    unmarked; withdrawal markings dupov
    ifnotmarkedrc goto blb_p3; if not, get a pass
: Blb_l6 rcfiles; else getting files bbs
    onerror call err_sb
    if .6 ~ 0 goto blb_l1; condition 'has been ringing'
    onerror goto blb_l6
: Blb_p3 marktr L *. PKT
                  ; ~ Mark for sending pkt files
    ifnotmarkedtr goto blb_p1; if not, skip sending
: Blb_l3 trfiles; else sending pkt replies
    onerror call err_sb
    if .6 ~ 0 goto blb_l1
    onerror goto blb_l3
    marktr L *. PKT
    ifmarkedtr tolog ~ ___erase sent files
    marktr L *. PKT
: Blb_p1 marktr EMSlog *. C
    marktr SPE *
    marktr *. Ckt
    marktr *. 0kt
    marktr *. 1kt
    ifmarkedtr tolog ~ ___erase old files
    marktr L *. PKT
    erase; remove old / sent files
: Blb_p4 call maskrc; block marking for
    ifnotmarkedrc goto bl_c; if not, go to C drive
: Blb_l4 rccat b; take bbs disk B (+ /-change)
    let .6 = 0
     onerror call err_sb
    onerror goto blb_l4
    call maskrc; block marking for
: Blb_l7 rcfiles; receive
    onerror call err_sb
    if .6 ~ 0 goto blb_l4; condition 'has been ringing'
    onerror goto blb_l7



; *** UNIT WITH BBS DISK C: ***

: Bl_c let .19 = 0; reset flag 'catalog has been reset in the 
log' : Blc_l1 rccat c; take bbs drive C

    let .6 = 0; reset flag 'was ringing'
    onerror call err_sb
    onerror goto blc_l1
    if .10 = 0 goto blo_c; if postal hour, then the transition
    if .19 = 0 cattolog; reset catalog bbs in the log and
    let .19 = 1; installation acc. flag
    call $ rabbitc
                ;> Call from the disk routines
                ; Marker files
    unmarked; withdrawal markings dupov
    ifnotmarkedrc goto blo_c; if not, skip getting
: Blc_l2 rcfiles; else getting files bbs
    onerror call err_sb
    if .6 ~ 0 goto blc_l1; condition 'has been ringing'
    onerror goto blc_l2

: Blo_c markrc SPEpostD
    ifmarkedrc let .12 = 1; if Mark. in pocht.chas to D-mail
    call maskrc; block marking for
    ifnotmarkedrc goto blc_p1; if not, skip pluchenie
: Blc_l3 rcfiles; receive
    onerror call err_sb
    if .6 ~ 0 goto blc_l1; condition 'has been ringing'
    onerror goto blc_l3
: Blc_p1 markrc mode off.
                ;> Checking for password
                ; Regime on the bbs
    ifmarkedrc goto blc_p5; if the file is, the password mode
                ; Not found, skipping work
                ; Of password mode
: Blc_p2 call blk_ps; else enter the personal password
    onerror goto blc_p5; pass on errors
    call blk_pt; login to your personal mailbox
    onerror goto blc_p5; pass on errors
: Blc_l4 rccat c; take the directory mailbox
    let .6 = 0; reset flag 'was ringing'
    onerror call err_sb
    if .6 ~ 0 goto blc_p2; condition 'has been ringing'
    onerror goto blc_l4
    markrc SPEpostD
    ifmarkedrc let .12 = 1; if Mark, in the mail. hour on D-mail
    markrc
                  ; ~ Mark all in your mailbox
    ifnotmarkedrc goto blc_en; if not, get a pass
    markrc *. zip
    markrc *. zip
                , ~ The two brands. Streak put zip
                ; The latest in a queue jump
: Blc_l5 rcfiles; receive
    onerror call err_sb
    if .6 ~ 0 goto blc_p2; condition 'has been ringing'
    onerror goto blc_l4
: Blc_en call blk_po; return to open mode
: Blc_l9 rccat c; take the bbs directory C
    onerror call err_sb
    let .6 = 0; reset flag 'was ringing'
    onerror goto blc_l9
: Blc_p5 markrc mode off. ;> Checking for password
                ; Regime on the bbs
    call masktr; block marking the transfer of
    ifnotmarkedtr goto bl_d; if not, skipping transfer
    tolog ~ ___send hot mail
    ifnotspacetr let .13 = 1; control of the disk is full C
: Blc_l6 trfiles; transfer
    onerror call err_sb
    if .6 ~ 0 goto blc_l9; condition 'has been ringing'
    onerror goto blc_l6
    if .13 ~ 2 goto blc_p6; if no overflow, no resume
                ; Else bylo running out of disk C
                 , Resp. Disk error bbs
    let .13 = 0; Reset overflow mode
: Blc_l7 rccat b; take bbs disk B
    let .6 = 0; reset flag 'was ringing'
    onerror call err_sb
    onerror goto blc_l7
: Blc_l8 trfiles; resume files, not vlezshih on C
                , (They left markings)
    onerror call err_sb
    if .6 ~ 0 goto blc_l7; condition 'has been ringing'
    onerror goto blc_l8

- Removal of the sent file-: blc_p6 call masktr; call block 
marlirovok     ifmarkedtr tolog ~ ___erase sent hot mail

    erase; removal
: Bl_d let .19 = 0; reset flag 'catalog has been reset in the 
log'     if .12 ~ 0 goto bld_l1; if pocht.chas and D is the 
post office,                 And the transition to work with 
the disk D     if .10 = 0 goto exit_b; if emails. hour, then 
exit, tk                 And the remaining disks are empty for 
me 



; *** UNIT WITH BBS DISK D: ***

: Bld_l1 rccat d; take bbs disk D
    let .6 = 0; reset flag 'was ringing'
    onerror call err_sb
    onerror goto bld_l1
    call maskrc; block marking for
    ifnotmarkedrc goto bld_p1; if not, then get a pass
: Bld_l2 rcfiles; polucheie
    onerror call err_sb
    if .6 ~ 0 goto bld_l1; condition 'has been ringing'
    onerror goto bld_l2
: Bld_p1 if .10 = 0 goto exit_b; if emails. hour, then exit, tk
                And the remaining disks are empty for me
    if .19 = 0 cattolog; reset catalog bbs in the log and
    let .19 = 1; installation acc. flag
    call $ rabbitd
                ;> Call from the disk routines
                ; Marker files
    unmarked; withdrawal markings dupov
    ifnotmarkedrc goto bl_a; if not, skip getting
: Bld_l4 rcfiles; receive
    onerror call err_sb
    if .6 ~ 0 goto bld_l1; condition 'has been ringing'
    onerror goto bld_l4



; *** UNIT WITH BBS DRIVE A: ***

: Bl_a let .19 = 0; reset flag 'catalog has been reset in the 
log' : Bla_l1 rccat a; take bbs drive A

    let .6 = 0; reset flag 'was ringing'
    onerror call err_sb
    onerror goto bla_l1
    if .19 = 0 cattolog; reset catalog bbs in the log and
    let .19 = 1; installation acc. flag
    call $ rabbita
                ;> Call from the disk routines
                ; Marker files
    unmarked; withdrawal markings dupov
    ifnotmarkedrc goto exit_b; if not, skip getting
: Bla_l2 rcfiles; receive
    onerror call err_sb
    if .6 ~ 0 goto bla_l1; condition 'has been ringing'
    onerror goto bla_l2
    goto exit_b; end the conversation with bbs



; *** *** Subroutine block

- ERROR HANDLING-: err_sd tolog ~~___ ERROR!!! (ERR = `.0`) 
onerror 4 tolog break pressed     onerror 5 tolog no your disk

    onerror 6 tolog your disk error
    let .7 =. 7-1; decrease in the error counter
    if .7 = 0 goto exit_b; if exhausted, zavrshenie session
    return

: Err_sb onerror 4 let .7 = 1; error 'break pressed' priority
    let .7 =. 7-1; for others mistakes acts counter

    tolog ~ error `.0` try left `.7`
    if .7 ~ 0 return; if .7 <> 0, the next attempt
                ; Else error limit has been exhausted
    5 onerror goto err_de; 5,6 disk errors, does not admit 
onerror 6 goto err_de; yuschie further processing tasks     if 
.13 ~ 0 1 onerror goto err_p1; if disk full C                   
  ; And disk error bbs                     Setting of the flag 
resume     if .5 = 0 goto redial; if the speed is reduced to 
min.,                 , Then disconnects and chime

    let .5 =. 5-1; else lowers the rate of
    transmit ~ fatal error `.0` ~ set speed
                ; ^ Reported a new speed
    wait .20; pause for transmission reliability
    if .5 = 1 transmit 1800
    if .5 = 0 transmit 600
    wait .20
    transmit bps ~
    let .7 =. 18; setting new limit errors
    setspd .5; installing a reduced speed
    return
: Err_p1 let .13 = 2; fakticheskoe perepolnenie C drive work
    return; with him will be terminated
: Err_de transmit ~ ___yor disk error, stop programm ~


- OUT OF EMS-: exit_b transmit ~ ___Bue! ~
    offline; ^ signal and disconnect  Run boot
    stop; if boot could not start
                ; Stops BAT file
                ; Return to the EMS


; --DOZVON/PEREZVON FOR BBS-: redial let .11 =. 11-1; reduction 
meter chimes     let .6 = 1; was ringing

    transmit ~ ___Bad connect.
    if .11 = 0 goto exit_b; if the counter is exhausted, then 
the output     transmit Redial. ~

    tolog ~ redial left `.11`
    offline; ^ ^ signal and disconnect  1595023
    markrc> SPENCER
    markrc> ALL *
    markrc> All *
    markrc> all *
    markrc> ALL? SPE
    markrc> All? SPE
    markrc> all? SPE
    unmarked; withdrawal markings dupov
    return

- BLOCK MARKINGS TO TRANSFER-, first marked all the hot soap, 
and then removed from the hot soap ; I received, and then 
removed from the circulars and returns ; On I Wrote circulars


: Masktr marktr> *
    marktr> 1595023
    marktr> SPENCER
    marktr> ALL *
    marktr> All *
    marktr> all *
    marktr> ALL? SPE
    marktr> All? SPE
    marktr> all? SPE
    return


- ENTER PASSWORD-: blk_ps let .9 =. 16; installation password 
attempts     let .8 =. 16

: Blkpsl transmit ~. Log Goljakov; 123 ~
    wait .14; ^ the password
    sendcommand
            ; 'Empty' sendcommand for separation in
            ; Time password and get an answer
            ; (Pause picked eksperimenatalno at
            ; This count of failures dropped three times).

    1912 onerror goto nobbs1; answer came 'Access denied'
    onerror goto nobbs2; answer did not come
    return
: Nobbs1 let .9 =. 9-1; decrements on 'Access denied'
    if .9 ~ 0 goto blkpsl; icherednaya attempt to enter a 
password     goto no_bbs; password is not accepted

: Nobbs2 let .8 =. 8-1; decrements on 'The answer is not'
    if .8 ~ 0 goto blkpsl
: No_bbs if .8 = 0 transmit ~ ERROR! ~ BBS mode not found! ~
    if .9 = 0 transmit ~ ERROR! ~ my password not found! ~
    return


- Opening the mailbox-: blk_pt let .8 =. 16; installation 
attempts to enter the command     let .9 =. 16

: Blkpt sendcommand ~. Con post | Post area opened
    1912 onerror goto nopst1
    onerror goto nopst2
    return
: Nopst1 let .9 =. 9-1
    if .9 ~ 0 goto blk_pt
    goto no_pst
: Nopst2 let .8 =. 8-1
    if .8 ~ 0 goto blk_pt
: No_pst if .8 = 0 transmit ~ ___ERROR !~___ BBS mode not 
found! ~     if .9 = 0 transmit ~ ___ERROR !~___ my postbox not 
found! ~     return



- RETURN IN AN OPEN MODE-: blk_po let .8 =. 16; installation 
attempts to enter the command     let .9 =. 16

: Blkpo sendcommand ~. Con | Area opened
    1912 onerror goto nopo1
    onerror goto nopo2
    return
: Nopo1 let .9 =. 9-1
    if .9 ~ 0 goto blk_po
    goto no_poe
: Nopo2 let .8 =. 8-1
    if .8 ~ 0 goto blk_po
: No_poe transmit ~ ~ can't exit out of postbox
    return

              CONCLUSION


  In conclusion, the author and the whole team Diamond group, is
special thanks to our friends and colleagues for their help
in building and testing this program's:

Viktor Kuzmin / KVA Vladimir Bulchukey / Wlodek Black
Mikhail Terentyev / Messir Alexander Kushnikov / Sander
Paul ????????? / KPN Alexander Mayorov / Mas
Arseny Astapenko / Ars Ilya Ivanov / ZX-Shadow
Ilya Abrosimov / EA ... and those who believed in us.


    Eugene Golyakov - Spencer / Winset. Final touches before

    delivery of material in print. For the "Pentagon"-th 
Wlodek-a 

    Wlodek-in and at home.



  In the future we plan to release the next version BATPROC, 
without loss of compatibility with version higher than 1.00. 
Will be introduced double-byte variables, lists, strings and 
the ability to stand any of them as an argument in the command 
output strings. Except that will be writing similar to the 
overlay program EWS and / or REAL COMMANDER 2.00 for automation 
of work with the files (Copying, packing, moving at TRD-images 
on the hard drive and etc.)



  We hope that the product will find its use in komunikatsionnyh
Systems Network ZX-Net, using technology EMS.



  Snapshot in memory: on the left - Spencer / Winset, in the 
center - Dmitry 

  Nesmachniy / Merlin, right Wlodek Black.



  Your suggestions, criticisms, comments can be sent to:

ZXNet:
500:95 / 462.9 Dmitriy Nesmachny aka Merlin / DMD
500:95 / 462.8 Evgeny Goljakov aka Spencer Winset / DMD

Fidonet
2:5020 / 2065.609 Dmitriy Nesmachny aka Merlin / DMD
2:5020 / 2065.608 Evgeny Goljakov aka Spencer Winset / DMD
2:5020 / 3434.16 Artem Belozerov aka Real Heysten / DMD

e-mail
wlblack@newmail.ru subj: BATPROC v1.00
wlblack@chat.ru
belozerow@mail.ru
kva@cosmigo.com


           (C) Diamond group. Russia, Moscow, 23.10.2000





Other articles:

Entry - introductory remarks.

People - Out spektrumist - Andrew Cmirnov (Ded Smirnoff) from "Power Of Sound" Group.

Iron - Automat, a system of external control and monitoring based on the Spectrum compatible computers, BAT FILE PROCESSOR v1.00, Robot v5.50 for Batproc v1.00.

Press - an overview of the newspaper "Paragraph number 1" - Wlodek Black.

Advertising - advertising and announcements.

Feedback - contact the publisher.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Advertising - text ads and announcements.
Introductory article to the collection of responses to letters from users received by the ZX Spectrum firm C Nemo.

В этот день...   21 November