[comp.sys.amiga.tech] Yet another 1.4 wish, and an AREXX program to monitor downloads

xanthian@well.UUCP (Kent Paul Dolan) (08/21/89)

First the wish:  The speak handler as documented on page 3.7 and 3.8 of the
1.3 enhancement booklet shows the format:

  COPY s:startup-sequence to SPEAK:OPT/f/s160

If you do this, the options are ignored.  The reason?  The speak handler is
case sensitive to "OPT"; this does work:

  COPY s:startup-sequence to SPEAK:opt/f/s160

Please fix this.

In addition, please add option switches to provide all options covered in
the 1.2 AmigaBASIC manual, pages 8-130 and 8-131.  Considering the volume,
it would also be nice to have a form speak:opt=<filename> for a standard
option setup, or perhaps allow a configuration of the handler at mount
time.

Perhaps it is there somewhere, but I can't find the CLI version of SAY
documented in the 1.2 or 1.3 docs.  Please assure that the CLI execution
of all commands, not just the ones in C:, are covered in the next release.

It would of course be peachy if SAY from the CLI had options to match the
same AmigaBASIC pages.

I really wanted to use AmigaBASIC to tell me when my download was done,
but I needed three missing features (though not all at once).  How about
adding to AmigaBASIC 1) the ability to say "AmigaBASIC <filename>" from
the CLI and have AmigaBASIC come up and run whatever is in <filename>
without further interaction by the user; 2) the ability for the SYSTEM
command to return an integer completion code that can be tested in a
script file; 3) the ability to execute any CLI command from AmigaBASIC
(spawning a new cli as needed) from a running program.  And please don't
forget to fix the sign problem in long multiplies my previous posting
demonstrated.

Well, the universe being less than ideal, I was prompted to take the shrink
wrap off the AREXX1.06 that had been sitting around the house for a couple
of months.  The documentation is very sparse of examples of meaningful
size; I just wanted to use it as a script language for the CLI, and it
took me over an hour to find out that the trick was "address command";
after all the brags on REXX replacing TSO and CLISTS, I was expecting
that corresponding capability to be highly highlighted; no such luck.

So, since I finally got it working, and since this snippet of software
is fairly tutorial (with the manual) in showing what can be done using
AREXX for a script language, I thought I'd pop it up here.  If someone
will send me the current address for the comp.sources.amiga archives,
I'll send them a copy to keep it around for later years.

I must say, once I caught the trick, AREXX is delightful; I had this
built up in about three hours of playing.  You'd probably want to
change the phrase list, unless you prefer listening to your machine
chew out me, rather than you.

The intended use of this software is for we computer chair potatoes
that start a long download from a pay by the minute service, and
would like to be roused from our doze when the task is done.  To use,
do the normal install of AREXX per the manual, start a download in
one window to df0:, and say "rx dloadmon.rexx" in another CLI.  What
makes this work is that, while the (large) target file stays "empty"
until the download is done, "info" sees the disk blocks in use count
going up, and this program watches that count (announcing it occassionally)
until is stops changing, at which point it starts calling for your (my)
help.

Enjoy!  Public domain; use it and you don't even have to admit you ever
heard of me.

well!xanthian
Kent, the man from xanth, now just another echo from The Well.
----- cut here --------------------
/* dloadmon.rexx, Kent's First AREXX Program! */
oldc = "0"

phrase1 = 'hay kent, the disk block count stopped changing!'
phrase2 = 'hay dumbo, you are wasting money!'
phrase3 = 'wake up kent, your computer needs attention!'
phrase4 = 'hay stupid, your download is done!'
phrase5 = 'yo kent, time to log out!'
phrase6 = 'come on sleepyhead, time is money!'
phrase7 = 'kent, get in here and take care of me!'
phrase8 = 'if I were a pretty girl you would not be this slow, kent!'

voice1 = 'r'
voice2 = 'm'
voice3 = 'f'
voice4 = 'n'

trash =  random(65,320,time('S'))
address command
do forever
  "info" ">" "ram:df0.info" "df0:"
  junk = open( 'mystuff' , 'ram:df0.info' , 'Read' )
  junk =  eof( 'mystuff' )
  do for 4
    junk = readln( 'mystuff' )
    end
  trash = close( 'mystuff' )
  say junk
  parse value junk with a b c d
  "echo" ">" "speak:" '"' || 'The disk zero block count is now ' || c || '"'
  if oldc = c
  then do
    do for 30

      pitch = random(65,320)

      speed = random(30,400)

      vtemp = random(1,4)
      if vtemp = 1 then voice = voice1
      if vtemp = 2 then voice = voice2
      if vtemp = 3 then voice = voice3
      if vtemp = 4 then voice = voice4
      
      ptemp = random(1,8)
      if ptemp = 1 then phrase = phrase1
      if ptemp = 2 then phrase = phrase2
      if ptemp = 3 then phrase = phrase3
      if ptemp = 4 then phrase = phrase4
      if ptemp = 5 then phrase = phrase5
      if ptemp = 6 then phrase = phrase6 
      if ptemp = 7 then phrase = phrase7 
      if ptemp = 8 then phrase = phrase8 
      
      "echo" ">" "speak:opt/" || voice || "/p" || pitch || "/s" || speed ' "' phrase '"'

      end
    exit
    end
  oldc = c
  "wait" "30" "SECS"
  end
exit