home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / uedit-stuff_429.lzh / Uedit-Stuff / Cap2Uedit.baud < prev    next >
Text File  |  1991-01-10  |  3KB  |  91 lines

  1. /* Cause Uedit to display the last page of BaudBandit 1.00's scrollback
  2.    buffer, and keep the bbs from hanging up in the meantime.
  3.  
  4.    This program refers several times to the command "Play8SVX", which is used
  5.    to play IFF sound samples.  The idea is that it makes a noise when the
  6.    user needs to be alerted.  If you don't have Play8SVX or don't want to use
  7.    it, simply comment out all the lines that mention it.  If you do want to
  8.    use it, replace "scream" with the pathname of an appropriate sound sample.
  9.  
  10.    This program can optionally change Uedit's font to an IBM font called
  11.    shortibm 8.  Just un-comment the line that includes the command "setfont
  12.    shortibm 8".  That font should be included with this.  It is a variant of
  13.    cleanibm 8 which is missing the first four characters.  They are missing
  14.    because Uedit 2.6a ralphs on trying to actually display ascii values 1-3
  15.    as printable characters.
  16.  
  17.    This script requires RunBack in order to start Uedit if it's not already
  18.    running.  And you should change "UE" in the line that gives the command
  19.    "runback UE" to whatever Uedit's pathname is on your system.
  20.  */
  21.  
  22. options results
  23. pname = 'Cap2Uedit-signal'
  24.  
  25. stat c                          /* ask the name of the capture file */
  26. file = result
  27.  
  28. if ~show('l','rexxsupport.library') then
  29.     if ~addlib('rexxsupport.library',0,-30) then do
  30.         address command 'play8svx scream'
  31.         msgraw "Can't open rexxsupport!" || '1B'x || '[23D'
  32.         exit 25
  33.     end
  34.  
  35. if show('Ports', pname) then do
  36.     msgraw " Old Cap2Uedit is still running!" || '1B'x || '[32D'
  37.     address AREXX "'address """pname""" foo'"   /* asynchronous */
  38.     do i = 1 to 20
  39.         call delay(25)                          /* half a second */
  40.         if ~show('Ports', pname) then leave
  41.     end
  42.     if ~show('Ports', pname) then
  43.         msgraw " It's Gone.                     " || '1B'x || '[32D'
  44.     else do
  45.         address command 'play8svx scream'
  46.         msgraw " Other Cap2Uedit won't go away! " || '1B'x || '[32D'
  47.         exit 25
  48.     end
  49. end
  50.  
  51. if show('Ports', 'URexx') then
  52.     frontit = 1
  53. else do
  54.     msgraw "Starting Uedit..." || '1B'x || '[17D'
  55.     address command 'RunBack UE'              /* <=- FIX PATH AS APPROPRIATE */
  56.     do while ~show('Ports', 'URexx')
  57.         call delay(20)
  58.     end
  59.     frontit = 0
  60. end
  61.  
  62. address 'URexx' 'loadcapture' file
  63. if frontit == 1 then address 'URexx' 'frontscreen'
  64. /*** address 'URexx' 'setfont shortibm 8'  */
  65.  
  66. /* if you use the 'setfont' line, comment out the 'frontscreen' line. */
  67.  
  68. if ~OpenPort(pname) then do
  69.     address command 'play8svx scream'
  70.     msgraw "Can't open signal port!" || '1B'x || '[23D'
  71.     exit 15
  72. end
  73.  
  74. do i = 1 to 600                         /* ten minutes max */
  75.     call delay(50)                      /* one second per pass */
  76.     pak = GetPkt(pname)
  77.     if pak ~= '00000000'x then leave
  78.     if (i // 10 == 0) then              /* keep the bbs awake */
  79.         send ' ' || '08'x               /* nul isn't wakeful enuf */
  80.     if (i > 300 & i // 60 == 0) then
  81.         address command 'play8svx scream'               /* time's a wastin */
  82. end
  83.  
  84. if pak ~= '00000000'x then
  85.     call Reply(pak, 0)          /* Uedit is waiting for a reply */
  86. else do
  87.     address command 'play8svx scream'
  88.     msgraw "Okay, I'm letting it hang up..." || '1B'x || '[31D'
  89.     exit 15
  90. end
  91.