home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / comm / spot-1.3.lha / Spot / Rexx / SkyHatch.spot < prev    next >
Text File  |  1993-09-07  |  4KB  |  110 lines

  1. /***************************************************************************/
  2. /* SkyHatch.spot   ©1993 Stu Churchill   2:250/107.97@fidonet              */
  3. /*                                                                         */
  4. /* $VER: SkyHatch.spot 1.80 (7.9.93)                                       */
  5. /*                                                                         */
  6. /* This script will open SkyTick on Spot's public screen, then, after you  */
  7. /* have hatched your files as required, it will post a File Arrival        */
  8. /* Announcement message in the appropriate area. Please consult            */
  9. /* SkyHatch.doc for more detailed information.                             */
  10. /***************************************************************************/
  11.  
  12. options results
  13.  
  14. /***************************************************************************/
  15. /* First we make sure that we can access the libraries we need             */
  16. /***************************************************************************/
  17.  
  18. if ~show(l, 'rexxsupport.library') then do
  19.   if ~addlib('rexxsupport.library', 0, -30) then do
  20.     say 'Please install the rexxsupport.library in your libs: directory'
  21.   end
  22. end
  23.  
  24. /***************************************************************************/
  25. /* Set up the system defaults                                              */
  26. /***************************************************************************/
  27.  
  28. NL        = '0a'x
  29. temp_file = 'T:2_250_107.TXT'
  30. from_name = 'Stu Churchill'
  31. to_name   = 'All'
  32. subj_line = 'File Arrival Announcement'
  33. echo_name = 'FILE_ANNOUNCE'
  34. spot_path = 'Workbench:WBStartup/Spot'
  35. psx_path  = 'Workbench:WBStartup/PSX'
  36. tick_path = 'D:SkyTick'
  37.  
  38. /***************************************************************************/
  39. /* First we open up SkyTick in HATCH mode on Spot's screen                 */
  40. /***************************************************************************/
  41.  
  42. address command psx_path||' MAKEDEFAULT SPOT SHANGHAI'
  43.  
  44. call close('STDOUT')               /* Divert output to our own window */
  45. call close('STDIN')
  46. call open('window','CON:0/192//200//SCREEN SPOT')
  47. call pragma('*','window')
  48. call open('STDIN','*')
  49. call open('STDOUT','*')
  50.  
  51. address command
  52. tick_path' -CMAIL:Configs/Tick_Out/ HATCH'  /* Insert here Tick.cfg path */
  53. psx_path' MAKEDEFAULT Workbench NOSHANGHAI' /* Reset default public screen */
  54.  
  55. call delay(3 * 50)                 /* A small delay for neatness */
  56. call close('window')               /* before we close our window... */
  57. call close('STDOUT')
  58. call close('STDIN')
  59. call pragma('*')
  60. call open('STDIN','*')             /* ...and reset the default STDIN & */
  61. call open('STDOUT','*')            /* STDOUT paths */
  62.  
  63. if exists(temp_file) then do       /* If we have hatched a file in an area */
  64.   call writemsg(temp_file)         /* specified in Tick.cfg then this file */
  65. end                                /* will exist */
  66.  
  67. exit
  68.  
  69.  
  70. /***************************************************************************/
  71. /* Write a file announcement message in the specified area                 */
  72. /***************************************************************************/
  73.  
  74. writemsg:
  75.   parse arg filename
  76.   if ~show('ports','SPOT') then do
  77.     address command spot_path
  78.     'WaitForPort SPOT'
  79.     if rc = 5 then do
  80.       exit                      /* Exit if we couldn't start SPOT at all */
  81.     end
  82.     quit = yes                  /* Marker to close SPOT after finishing */
  83.   end
  84.   address 'SPOT'
  85.   'isiconified'
  86.   if rc = 0 then do
  87.     icon = yes                  /* Marker to re-iconify after finishing */
  88.     'uniconify'
  89.   end
  90.   'spot2front'
  91.   'lockgui'
  92.   'arealist'
  93.   'gotoarea NAME 'echo_name
  94.   if rc ~= 0 then do
  95.     'requestnotify PROMPT "Could not find area'||NL||echo_name'"'
  96.     exit
  97.   end
  98.   'messagelist'
  99.   'write TO "'to_name'" FROM "'from_name'" SUBJECT "'subj_line'" FILE 'filename' NOEDIT NOGUI NOSIG'
  100.   'arealist'
  101.   'unlockgui'
  102.   if icon = yes then do
  103.     'iconify NOREQ'
  104.   end
  105.   if quit = yes then do
  106.     'quitspot NOREQ'
  107.   end
  108.   call delete(temp_file)
  109.   return
  110.