/* This is an Arexx script which you can use from a cron to optimize spot area */
/*																																						 */
/* PollBoss.spot Version 1.1 © 1993 by Benoit Mortier                          */
/*																																						 */
/* For comments, remarks, bugs, etc. contact:                               	 */
/* Fidonet: 2:291/715.4                                                     	 */
/* UUCP: mortier@mortier.adsp.sub.org																					 */
/*																																						 */
/* the only thing you have to change is the path of your logfile							 */

options results
address spot

if ~show(Libraries,'rexxsupport.library') then
    if ~addlib("rexxsupport.library",0,-30,0) then exit

if ~show(Libraries,'rexxarplib.library') then
    if ~addlib("rexxarplib.library",0,-30,0) then exit

'poll NODE 2:291/715.0 NOREQ QUIET WAIT'

log = "logs:spot.log"

address command 'date >t:date'

call getdate

call movefile

'import QUIET'

'uniconify'

'spot2front'

exit

getdate:
open(date,'t:date','R')
	today = readln(date)
	date = subword(today,2,1)
	time = subword(today,3,1)
close(date)

delete(date)
return

movefile:
open(logfile,log,'A')

call filelist('mail:inbound/~*.((mo*|tu*|we*|th*|fr*|sa*|su*|pkt))',final,f,)
if final.0 ~= 0 then do
  do i = 1 to final.0
    address command 'copy 'final.i' mail:Files/ CLONE'
		call writech(logfile,'! 'date' 'time)
    call writeln(logfile,'  Copying 'final.i' to mail:Files/')
    call delete(final.i)
  end
end

close(logfile)
return
