/* Cause Uedit to display the last page of VLT 4.824's scrollback buffer, and keep the bbs from hanging up in the meantime. This program refers several times to the command "Play8SVX", which is used to play IFF sound samples. The idea is that it makes a noise when the user needs to be alerted. If you don't have Play8SVX or don't want to use it, simply comment out all the lines that mention it. If you do want to use it, replace "SCREAM" with the pathname of an appropriate sound sample. This program can optionally change Uedit's font to an IBM font called cleanibm 8. Just un-comment the line that includes the command "setfont cleanibm 8". This script requires RunBack in order to start Uedit if it's not already running. And you should change "UE" in the line that gives the command "runback UE" to whatever Uedit's pathname is on your system. */ address VLT options results pname = 'Cap2Uedit-signal' file = "T:Review" 'review s' /* select all lines */ 'review a'file /* and save it - note no space after a' */ if ~show('l','rexxsupport.library') then if ~addlib('rexxsupport.library',0,-30) then do address command 'Play8SVX SCREAM' emit '"Can''t open rexxsupport!' || '1B'x || '[23D"' exit 25 end if show('Ports', pname) then do emit '" Old Cap2Uedit is still running!' || '1B'x || '[32D"' address AREXX "'address """pname""" foo'" /* asynchronous */ do i = 1 to 20 call delay(25) /* half a second */ if ~show('Ports', pname) then leave end if ~show('Ports', pname) then emit '" It's Gone. ' || '1B'x || '[32D"' else do address command 'Play8SVX SCREAM' emit '" Other Cap2Uedit won't go away! ' || '1B'x || '[32D"' exit 25 end end if show('Ports', 'URexx') then frontit = 1 else do emit '"Starting Uedit...' || '1B'x || '[17D"' address command 'runback util:uek' do while ~show('Ports', 'URexx') call delay(20) end frontit = 0 end address 'URexx' 'loadcapture' file /** address 'URexx' 'setfont cleanibm 8' **/ if frontit == 1 then address 'URexx' frontscreen /* remove the 'frontscreen' line if you include the 'setfont' above that */ if ~OpenPort(pname) then do address command 'Play8SVX SCREAM' emit '"Can't open signal port!' || '1B'x || '[23D"' exit 15 end do i = 1 to 600 /* ten minutes max */ call delay(50) /* one second per pass */ pak = GetPkt(pname) if pak ~= '00000000'x then leave if (i // 10 == 0) then /* keep the bbs awake */ send ' ' || '08'x /* nul isn't wakeful enuf */ if (i > 300 & i // 60 == 0) then address command 'Play8SVX SCREAM' /* time's a wastin */ end if pak ~= '00000000'x then call Reply(pak, 0) /* Uedit is waiting for a reply */ else do address command 'Play8SVX SCREAM' emit '"Okay, I'm letting it hang up...' || '1B'x || '[31D"' exit 15 end