/* $VER: GetNews 1.2 a rexx script by Kai.Nikulainen@sci.fi ** ** Fetch some news and mails now or later. Most useful with Miami ** ** Usage: Getnews [time] [QUIT] ** ** If time is given, waits until then before connecting to your server. ** Does not disconnect if a connection was already open unless option ** QUIT is used. ** ** You might wan to use specific Miami settings for this program which ** have a limited number of retries. */ parse arg time action . settings='miami:miami.automatic' /* Enter here the programs you use for Usenet news */ /* If you don't want to get/send mail, just change the values to '' */ getnews='nntpxfer news.sci.fi uulib:active paranoid ll' sendnews='run rx sys:rexx/FlushSpool.rexx' call addlib('rexxsupport.library',0,-30,0) if upper(time)='QUIT' then do time=action action='quit' end if pos(':',time)=0 & datatype(time)='NUM' then do time=time':00' end if pos(':',time)=0 then do action=time time='' end action=upper(action) if time~='' then do sb='' say 'Going online at' time'. The time is now' time() if action='QUIT' then say 'The connection will be closed when the script ends.' address command 'wait until' time say "It's time to wake up some programs..." end if ~show('P','MIAMI.1') & ~show('P','MLINK') then do address command 'run >nil: packed:datacomm/miami/miami' call delay(100) address command 'waitforport MIAMI.1' if ~show('P','MIAMI.1') then do say "Couldn't run MIAMI! Aborting script!" exit end end if show('P','MLINK') then quitmiami=0 else do address 'MIAMI.1' /* Miami is up and running now...*/ 'HIDE' 'ISONLINE' if rc=1 then do quitmiami=0 end else do 'LOADSETTINGS' settings /* Only try once and do it quietly */ 'ONLINE' /* Go online */ 'ISONLINE' /* Did it succeed ? */ if rc=0 then do /* I guess not... */ 'QUIT' say "Couldn't get online!" exit end quitmiami=1 end end if getnews~='' then do address command sendnews call delay(200) end if action='QUIT' then quitmiami=1 if ~show('P','YAM') then do address command 'run >nil: yam:yam nocheck' call delay(100) address command 'waitforport YAM' quityam=1 end else quityam=0 if show('P','YAM') then do address 'YAM' 'MailCheck' 'MailFilter' 'MailSendAll' end else say "Couldn't run YAM!" if getnews~='' then do address command getnews sb if show('p','YAM') then do address 'YAM' 'MailCheck' 'MailFilter' end end if time~='' then address command 'cancel' if quitmiami then do address 'MIAMI.1' 'OFFLINE' 'QUIT' end exit