home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Information
/
WebSites
/
Wirenet
/
files
/
0800timer.lha
/
0800Timer
next >
Wrap
Text File
|
2000-03-20
|
2KB
|
88 lines
/*
0800timer - keeps track of 0800 usage at weekends
*/
/* ;;; Exit and clear environment variable if a weekday */
if left(date('W'),1) ~= 'S' then do
call addlib('rexxsupport.library',0,-30,0)
call delete('ENVARC:0800mins')
call delete('ENV:0800mins')
exit
end
;;;
/* ;;; Initialise */
VerStr = '$VER: 0800Timer 1.0 (6.2.00)'
VerStr = subword(VerStr,2)||'0a'x||'(c) Neil Bothwick, Wirenet'
Usage = 'INTERFACE,PROGRESS=BAR/S'
options results
address command
if ~show('L','rexxsupport.library') then call addlib('rexxsupport.library',0,-30,0)
if ~show('L','rexxdossupport.library') then call addlib('rexxdossupport.library',0,-30,0)
if ~exists('ENVARC:0800mins') then do
'echo >ENVARC:0800mins "0" noline'
'echo >ENV:0800mins "0" noline'
end
TotalTime = GetVar('0800mins')
;;;
/* ;;; Read arguments */
parse arg args
if right(args,1) = '?' | ~ReadArgs(args,Usage) then do
say 'Usage: 0800Timer' Usage
exit
end
if symbol('Interface') ~= 'VAR' then Interface = ''
if show('P','GENESIS') & Interface = '' then Interface = 'ppp0'
if ~IsOnline() then exit
;;;
/* ;;;Open progress bar if required */
if show('P','0800TIMER-PRG') then do
Progress = 1
address '0800TIMER-PRG' 'ONLINE'
end
else if Progress = 1 then do
parse source ScriptPath
call pragma('D',PathPart(word(ScriptPath,4)))
'Run >NIL: MUIRexx 0800Timer.mrx port 0800TIMER'
do i = 1 to 5 until RC = 0
'waitforport 0800TIMER-PRG'
end
end
;;;
/* ;;; Main loop */
do while IsOnline()
TotalTime = TotalTime + 1
'setenv 0800mins' TotalTime
'setenv ENVARC:0800mins' TotalTime
if Progress = 1 then do
if show('P','0800TIMER-PRG') then address '0800TIMER-PRG' TotalTime
else Progress = 0
end
call delay(3000)
end
;;;
/* ;;; Clean up and exit */
CleanUp:
if show('P','0800TIMER-PRG') then address '0800TIMER-PRG' 'OFFLINE'
exit
;;;
/* ;;; Check if still online */
IsOnline:
select
when show('P','MIAMI.1') then do
address 'MIAMI.1' 'ISONLINE' Interface
return RC
end
when show('P','GENESIS') then do
address 'GENESIS' 'ISONLINE' Interface
return RC
end
otherwise return 0
end
return 0
;;;