home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
adcal080.zip
/
callers.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-08-11
|
7KB
|
198 lines
/* Rexx Script to read in recent callers lists Generated by AdeptXBBSCaller
by Robert Stephens, it converts Meta codes to Ansi Escape sequences on
the fly.
This Script is designed for the Sysop to view the recent callers lists
from the OS/2 command prompt, place this file in a directory that is in
your search path so it can be accessed from any directory.
*/
'@Cls'
Call RxFuncAdd 'SysGetKey', 'RexxUtil', 'SysGetKey'
Adept_Drive_Letter = VALUE('APATH',,'OS2ENVIRONMENT')
If Adept_Drive_Letter = "" Then Do
Say "
Sysop Warning!:"
Say "The 'APATH' environment variable isn't set, AdeptXBBSCaller will"
Say "not operate correctly without it."
Say "Hit any Key to Exit"
Dummy = SysGetKey('NOECHO')
Say ""
Exit
End
Parse VAR Adept_Drive_Letter Drive_Letter ':'
Adept_Drive_Letter = Drive_Letter":"
A1 = Stream(Adept_Drive_Letter"\ADEPT\MENUS\ADCALLER.CFG",'c','Close')
A1 = Stream(Adept_Drive_Letter"\ADEPT\MENUS\ADCALLER.CFG",'c','Open Read')
Text_Path = LineIn(Adept_Drive_Letter'\Adept\Menus\AdCaller.Cfg')
A1 = Stream(Adept_Drive_Letter"\ADEPT\MENUS\ADCALLER.CFG",'c','Close')
Show = '0_Days_Old.Asc' /* Default File to Show First when Callers.Cmd
is Executed */
Screen_Length = 24 /* Leave it at 24 */
Minute_Tally = 0
Line_Counter = 0
Position = 1
B = Stream(Text_Path''Show,'c','Close')
Prompt1 = Centre("[0] Today's Callers, [1-9] Previous Days, [*] Best Day",79)
Prompt2 = "
"Prompt1
Prompt3 = Centre("Enter Selection [0-9], [*] or Hit [=] to Exit:",78)
Prompt4 = "
"Prompt3
Read_List:
Answer = "-1"
Show = Text_Path''Show
B = Stream(Show,'c','Open Read')
Counter = 0
Do While Lines(Show) = 1
Say "A"
Do While Counter < Screen_Length
InLine = LineIn(Show)
Analyse = InLine
Analyse_Pos = Pos(":",Analyse)
If Analyse_Pos >= 1 Then Do
Analyse_Pos = Analyse_Pos - 2
LogOn_Time = SubStr(Analyse,Analyse_Pos,5)
Analyse_Pos = LastPos(":",Analyse)
Analyse_Pos = Analyse_Pos - 2
LogOff_Time = SubStr(Analyse,Analyse_Pos,5)
Analyse_Pos = 0
Parse Var LogOff_Time LogOff_Hour ':' LogOff_Minute
Parse Var LogOn_Time LogOn_Hour ':' LogOn_Minute
If LogOn_Hour = LogOff_Hour Then Mins = LogOff_Minute - LogOn_Minute
If LogOn_Hour \= LogOff_Hour Then Do
Mins = LogOff_Minute
Hour_Difference = LogOff_Hour - LogOn_Hour
If Hour_Difference >= 2 Then Mins = Mins + Hour_Difference * 60 - LogOn_Minute
If Hour_Difference <= 1 Then Do
Temp_Mins = 60 - LogOn_Minute
Mins = Mins + Temp_Mins
End
End
Minute_Tally = Minute_Tally + Mins
Line_Counter = Line_Counter + 1
End
Do Until Position = 0
Position = Pos("{",InLine)
If Position = 0 Then Leave
Meta = SubStr(InLine,Position,3)
IF Meta = "{FG" Then New_Ansi = "
"
IF Meta = "{FC" Then New_Ansi = "
"
IF Meta = "{FB" Then New_Ansi = "
"
IF Meta = "{FF" Then New_Ansi = "
"
IF Meta = "{FD" Then New_Ansi = "
"
IF Meta = "{F1" Then New_Ansi = "
"
IF Meta = "{F5" Then New_Ansi = "
"
IF Meta = "{CS" Then New_Ansi = ""
Ansi_Length = Length(New_Ansi)
Remove_Meta = DelStr(InLine,Position,3)
New_Pos = Position - 1
Processed_Line = Insert(New_Ansi,Remove_Meta,New_Pos,Ansi_Length)
InLine = Processed_Line
End
If InLine = "" Then Leave
Counter = Counter + 1
Say Processed_Line
End
If Counter < Screen_Length Then Leave
Counter = 0
Temp = CharOut(,"
More (Y/n) ?")
Answer = SysGetKey('NOECHO')
Temp = CharOut(,"")
If (Answer = "N") | (Answer = "n") Then Signal View_Prompt
End
B = Stream(Show,'c','Close')
Say ""
If (R1 \= "") Then Do
Average_Call = Minute_Tally / Line_Counter
Average_Call = Trunc(Average_Call,1)
Duration = "Average Call Duration : "Average_Call" Minutes"
Duration = Centre(Duration,79)
Duration = "
"Duration
Say Duration
End
Say Prompt2
View_Prompt:
Minute_Tally = 0
Line_Counter = 0
B = Stream(Show,'c','Close')
Temp = CharOut(,"D")
Temp = CharOut(,Prompt4)
Second_Prompt:
Key = SysGetKey('NOECHO')
If Key = 0 Then Do
Show = '0_Days_Old.Asc'
Signal Read_List
End
If Key = "=" Then Do
B = Stream(Show,'c','Close')
Say ""
Exit
End
If Key = "" Then Signal View_Prompt
If Key = "*" Then Do
Show = 'Most_Callers.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 1 Then Do
Show = '1_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 2 Then Do
Show = '2_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 3 Then Do
Show = '3_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 4 Then Do
Show = '4_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 5 Then Do
Show = '5_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 6 Then Do
Show = '6_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 7 Then Do
Show = '7_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 8 Then Do
Show = '8_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
If Key = 9 Then Do
Show = '9_Days_Old.Asc'
R1 = Stream(Text_Path''show,'c','query exists')
IF R1 = "" Then Say "
Data File Missing!"
Signal Read_List
End
IF (Key \= 1) | (Key \= 2) | (Key \= 3) | (Key \= 4) | (Key \= 5) | (Key \= 6) | (Key \= 7) | (Key \= 8) | (Key \= 9) | (Key \= "*") | (Key \= "=") | (Key \= "") Then Signal Second_Prompt
Signal View_Prompt