home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
MAXIMUS
/
CDCAR_13.ZIP
/
CDCAR.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-02-18
|
18KB
|
612 lines
/* CD Carousel Door */
/* v1.3 */
/* by Bill Esposito */
/* The Cereal Port BBS */
/* 1:132/152 */
/* (603)899-3335 */
/* */
/* Magic name 'CDCAR' */
/* for latest version */
/* */
/* *********************************************************************** */
/* DISCLAIMER: This software is provided "AS IS" without any warranty of */
/* any kind, either expressed or implied. USE IT AT YOUR OWN RISK. */
/* */
/* Copyright 1993 by Bill Esposito. This program is SHAREWARE. Please */
/* read the file SHAREWRE.TXT included in this archive. */
/* *********************************************************************** */
/* ***** CDCAR.CMD ***** */
/* The CD Carousel Door program. */
/***************************************************************************/
signal on HALT NAME menu
Arg configdir ansi me user
'@echo off'
config=configdir''cdcar.cfg
f=1
do until lines(config)=0
param.f=linein(config)
f=f+1
end
ok=stream(config,c,'close')
parse var param.1 disk junk
parse var param.2 menutype junk
parse var param.3 homedir junk
parse var param.4 maxdir junk
parse var param.5 download junk
parse var param.6 fnum junk
parse var param.7 type junk
parse var param.8 marea junk
parse var param.9 tnode junk
parse var param.10 fnode junk
parse var param.11 sysopfirst sysoplast junk
parse var param.12 stype junk
parse var param.13 smarea junk
parse var param.15 defaultcd junk
reqflag='0'
if ansi=2 then ansi = 0
parse var user first2 mid2 last2
nmi='NO'
if last2='' then do
nmi='YES'
first=first2
last=mid2
mid=''
end
if nmi='NO' then do
first=first2
mid=mid2
last=last2
end
grn=''
yel=''
red=''
blu=''
cyan=''
brt=''
gry=')'
lo=''
if ansi=1 then do
grn='
'
yel='
'
red='
'
blu='
'
cyan='
'
brt='
'
gry='
'
lo='
'
end
call RxFuncAdd 'SysloadFuncs','RexxUtil','Sysloadfuncs'
call sysloadfuncs
ver='v1.3'
menu:
signal on HALT NAME menu
if ansi=1 then if menutype=0 then do
say '
HOS/2
OS/2
OS/2
OS/2
OS/2'
say '1H
OS/2
OS/2
OS/2
OS/2
OS/2
OS/2
OS'
say '7H/2
OS/2
OS/2
OS/2
OS/2
OS/2
OS/2
OS'
say '5H/2
OS/2
HS 0HOH/
H'
say '
0HCD Carousel Door0HSH2
5H'ver'
0H/'
say '
HO0HBy Bill Esposito
0H2
HS
9H**'
say '2H
UNREGISTERED
5H**
0HOH/
1H'
say '1H 4H
9H
0HSH2'
say '
1HThe Selected CD is:
'disk'
0H/
HO'
say '
9H
0H2
1HS
3H'
say '11H
C
hange CD
40H 80HO'
say '1H/80HS
1H2
28H
F
ile Area Selec'
say '45Ht
80H/
1HO
80H2
1HS
'
say '28H
S
earch by Filename/Text
80HO1H/80HS'
say '1H2
28H
B
ulletins
65H
'
say '80H/
1HO
80H2
1HS
26H'
say '27H
?
Help
63H
80HO'
say '1H/80HS1H2
30HQ
uit back to BBS
'
say '80H/
1HO31H
80H2
1HS'
say '
28H
80HO1H/2
OS/2
O'
say '8HS/2
OS/2
OS/2
OS/2
OS/2
OS/2
OS/2'
say '35H
OS/2
OS/2
OS/2
OS/2
OS/2
OS/2'
say '59H
OS/2
OS/2
OS/2
OS/2
OS/2
OS'
say '1H'
end
if ansi='0' then if menutype=0 then do
'@cls'
say 'OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2'
say
say ' CD Carousel Door '
say ' 'ver
say ' By Bill Esposito'
say ' * Unregistered *'
say
say ' The Currently Selected CD is: 'disk
say
say ' C)hange Disk'
say
say ' F)ile Area '
say
say ' S)earch by Filename/Text'
say
say ' B)ulletins '
say
say ' ?)Help'
say
say ' Q)uit Back to BBS'
say
say 'OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2OS/2'
end
if menutype=1 then do
say
say brt||yel' CD Carousel Door: 'red||disk
say
say brt||yel||'C'gry'hange disk 'brt||yel'F'gry'ile area Select 'brt||yel'S'gry'earch by Filename/Text'
say brt||yel'B'gry'ulletins 'brt||yel'Q'gry'uit to main 'brt||yel'?'gry'Help'
end
pull sel
if sel = 'B' then call bull
if sel = '?' then call help
if sel='C' then call change_disk
if sel='C' then call menu
if sel ='F' then call filearealst
if reqflag=1 then do
if sel = 'Q' then call quit
end
if def=1 then if sel = 'Q' then call quit
if sel = 'Q' then call quit1
if sel ='S' then call find
signal menu
/* file area list */
filearealst:
close=stream(file,c,'close')
more = 1
file=homedir''disk'\names.lst'
'@cls'
/* Read */
read:
x=1
y='1'
open=stream(file,c,'open')
linein(file,1,0)
loop2:
if more <> 3 then '@cls'
name.=0
do i=1 to 20
xx=right(x,2)
if sel='F' then do
parse value linein(file) with name5 fuldir dirdesc
dirdesc=strip(dirdesc)
name.i=xx'. 'left(name5,10) dirdesc
fulldir.i=fuldir
end
if sel<>'F' then if sel <>'B' then if sel <>'?' then do
parse value linein(file) with disks diskdesc
name.i= xx'. 'disks' 'strip(diskdesc)
end
if sel = 'B' then name.i = linein(file)
se=0
if more=3 then do
parse var name.i number nam diskdesc
name.i = right(number,3) nam diskdesc
end
if sel='F' then do
parse var name.i num name5 dirdesc
dirdesc=strip(dirdesc)
say brt||yel||right(num,3)||grn||left(name5,10) cyan||dirdesc
end
if sel <>'F' then if sel <> 'B' then if sel <> '?' then if sel <> 'C' then do
name.i=left(name.i,79)
parse var name.i num fn sz dt dc
say brt||red||right(num,3)||yel||left(fn,13)||red||right(sz,8)||grn||right(dt,9)' 'cyan||left(dc,44)
end
if sel = 'C' then do
name.i=left(name.i,79)
parse var name.i num disk6 diskdesc
say brt||red||right(num,3)||yel||left(disk6,13)||cyan||strip(diskdesc)
end
if sel = 'B' then say brt||cyan||name.i
if more=0 then if lines(file)=''0'' then signal more
if more=1 then if lines(file)=''0'' then signal more
if more=2 then if lines(file)=''0'' then signal more
if more=3 then do
if lines(file)=''0'' then call more
if lines(file)=''0''then return
end
if lines(file)=''0'' then signal qdel
x=x+y
end
more:
x=1
say
if more=1 then do
if lines(file)<>0 then say 'More, Select file area? (Y,n,area#)'
if lines(file)=0 then say 'Select file area? (N,area#)'
end
if more=0 then do
say 'More? (Y,n)'
end
if more=2 then do
if lines(file)<>0 then say 'More, File# ? (Y,n,#)'
if lines(file)=0 then say 'File# ? (N,#)'
end
if more=3 then do
if lines(file)<>0 then say 'More, Select Disk? (Y,n,disk#)'
if lines(file)=0 then say 'Select Disk? (N,disk#)'
end
pull yn
if yn='N' then signal qdel
if more=2 then do
dt=datatype(yn)
if dt='NUM' then call tagger
end
if yn='Y' then if fs=1 then return
if yn='Y' then if fs <>1 then signal loop2
if yn='' then do
if lines(file)=0 then signal qdel
signal loop2
end
dt= datatype(yn)
if dt='NUM' then if yn > i then yn=1
if more=1 then if dt='NUM' then call areasel
if more=3 then do
if dt<>'NUM' then yn=1
if dt='NUM' then return
end
if lines(file)=''0'' then return
if fs=1 then return
signal loop2
qdel:
close=stream(file,c,'close')
signal menu
more1:
say 'more? (Y,n)'
pull yn
if yn="N" then signal menu
count = 0
return
tagger:
tag=yn
name3=name.tag
parse var name3 num filename date time desc
if filename <>'' then do
call sysfiletree homedir'*.req', 'file.', 'F'
if file.0=0 then firstime=1
parse upper var defaultcd dcd
parse upper var disk curcd
if dcd=curcd then do
call lineout homedir''disk'.def',nmi user fulldirectory filename desc
ok=stream(homedir''disk'.def',c,'close')
def=1
end
else do
call lineout homedir''disk'.req',nmi user fulldirectory filename desc
ok=stream(homedir''disk'.req',c,'close')
reqflag=1
end
end
call more
return
areasel:
name2=name.yn
fulldirectory=fulldir.yn
parse var name2 num areaname1 rest
areaname=strip(areaname1)
file=homedir''disk'\'areaname'.bbs'
more=2
sel=''
call read
return
change_disk:
file=homedir'disk.lst'
more=3
call dmenu
call read
name4=name.yn
parse var name4 num disk1 cdrom
disk=strip(disk1)
return
bull:
more=0
file=homedir'cdbull.txt'
call read
return
help:
more=0
file=homedir'cdhelp.txt'
sel = 'B'
call read
return
dmenu:
if ansi=0 then do
'@cls'
say
say
say
say
say ' CD Carousel Door'
say ' 'ver
say ' By Bill Esposito'
say
say
say ' The Currently Selected CD is: 'disk
say
say
end
if ansi=1 then do
'@cls'
say
say
say
say
say '
CD Carousel Door'
say '
'ver
say '
by Bill Esposito'
say
say '
'
say 'The Currently Selected CD is:
'disk
say '
'
say
end
return
find:
notfound=0
more=4
count=0
i=0
'@cls'
say
say
say
say
if ansi=1 then say 'Enter Filename or search string?
(
any text or numbers,
no wildcards
)'
if ansi=0 then say 'Enter Filename or search string? (any text or numbers, NO WILDCARDS)'
say
pull what
if what='' then signal menu
file=homedir''disk'\names.lst'
loop3:
more=4
fs=1
z=1
do until z=40
linein(file,1,0)
do until lines(file)=0
parse value linein(file) with drr fulldirectory dirdesc
drrr=homedir''disk'\'drr'.bbs'
file.=''
areaname=drr
say 'Directory: 'drr
ok=sysfilesearch(what, drrr, 'file.')
read1:
x=1
y='1'
name.0=0
do i=1 to file.0
if file.i<>'' then do
xx=right(x,2)
name.i= xx'. 'file.i
if left(file.i,5) <>'FILE.' then do
name.i=left(name.i,79)
parse var name.i num fn sz dt dc
say brt||red||right(num,3)||yel||left(fn,13)||red||right(sz,8)||grn||right(dt,9)||cyan' 'dc
end
if left(file.i,5) <>'FILE.' then notfound=1
if datatype(i/20,'W')=1 then call tag
end
x=x+y
end
if file.0 <>0 then call tag
z=z+y
end
if lines(file)<>0 then call loop3
ok=stream(file,c,'close')
if notfound=0 then do
say ' Sorry, unable to find 'WHAT
say ' Press <ENTER> to continue'
pull ent
end
signal menu
quit:
file=homedir'disk.lst'
if ansi=0 then do
'@cls'
say
say ' CD Carousel Door'
say
say
end
if ansi = 1 then do
'@cls'
say
say '
CD Carousel Door'
say
say '
'
end
if reqflag=1 then do
say First','
say ' You have requested the following files. You will receive a'
say 'message for each sucessfully filled file request. Please K)ill'
say 'these messages upon receipt. When posted, your files can be found'
say 'for download in File Area 'fnum'.'
say
ok=stream(file,c,'close')
do until lines(file)=0
parse value linein(file) with disk1 diskdesc
disk=homedir''disk1'.req'
ok=stream(disk,c,'close')
x=8
request=yes
dsk=no
do until lines(disk)=0
request=no
if nmi='NO' then do
parse value linein(disk) with nmi1 first1 mid1 last1 directory filename desc
end
if nmi='YES' then do
parse value linein(disk) with nmi1 first1 last1 directory filename desc
mid1=mid
end
if x=20 then say
if x=20 then say 'Press <ENTER> to continue'
if x=20 then pull ak
if x=20 then x=8
if first1=first then if mid1=mid then if last1=last then do
if dsk=no then say
if dsk=no then say '
CD: 'disk1'
'
dsk=yes
say left(filename,12) desc
request=yes
req=yes
end
x=x+1
end
end
ok=stream(file,c,'close')
say
if def = 1 then say 'The files you selected from 'brt||red||defaultcd||lo||cyan' are available 'brt||red'now'lo' from File Area 'fnum'.'
end
if reqflag <> 1 then if def = 1 then do
say first','
say' The files you selected from 'brt||red||defaultcd||lo||cyan' are available 'brt||red'now'lo' from File Area 'fnum'.'
end
say
say 'Press <ENTER> to continue'
pull ak
call msg
quit1:
'@cls'
file=homedir'disk.lst'
do until lines(file)=0
parse value linein(file) with disk1 diskdesc
ok=stream(homedir''strip(disk1)'\names.lst',c,'close')
end
ok=stream(file,c,'close')
if def=1 then do
siz=length(homedir)
homedi=left(homedir,siz-1)
drive=left(homedir,2)
drive
'@cd' homedi
call cdmaint.cmd 0 1
end
if me=1 then call cdmenu.cmd
exit
tag:
if lines(file)<>0 then say 'More, File# ? (Y,n,#)'
if lines(file)=0 then say 'File# ? (N,#)'
pull yn
if yn='N' then signal qdel
dt=datatype(yn)
if dt='NUM' then do
tag=yn
name3=name.tag
parse var name3 num filename date time desc
if filename <>'' then do
call sysfiletree homedir'*.req', 'file.', 'F'
if file.0=0 then firstime=1
parse upper var defaultcd dcd
parse upper var disk curcd
if dcd=curcd then do
call lineout homedir''disk'.def',nmi user fulldirectory filename desc
def=1
end
else do
call lineout homedir''disk'.req',nmi user fulldirectory filename desc
ok=stream(homedir''disk'.req',c,'close')
reqflag=1
end
end
end
if yn='' then do
if lines(file)=0 then signal qdel
return
end
if yn='Y' then do
if lines(file)=0 then signal qdel
return
end
call tag
k=stream(homedir''disk'.def',c,'close')
ok=stream(homedir''disk'.req',c,'close')
return
msg:
if req=yes then if firstime = 1 then do
/* MSGAPI */
address CMD 'rxsubcom drop msgapi'
address CMD 'rxsubcom register MSGAPI rxmsgapi RXMSGAPI'
address CMD 'rxsubcom load MSGAPI RXMSGAPI'
address MSGAPI
'OPEN_API 3 0'
'OPEN_AREA MSG 'smarea' MSGAREA_NORMAL 'STYPE
'LOCK MSG'
'OPEN_MSG MSGH MSG MOPEN_CREATE 0'
cr = '0d'x
text = 'Hello 'SYSOPFIRST',' cr cr 'A User has requested a file from an off-line CD. Please run CDMenu at your' cr 'earliest convenience.' cr cr ' Thank you,' cr ' CD Carousel' cr cr cr '--- This File was brought to you by CD Carousel'cr
controla = '01'x
control = controla || 'PID RXMSGAPI'
xmsg.attr = 1
xmsg.from = CD Carousel
xmsg.to = SYSOPFIRST SYSOPLAST
xmsg.subj = 'File Request'
xmsg.orig = tnode
xmsg.dest = fnode
hour=time('N')
date2=date('S')
year=left(date2,4)
month=substr(date2,5,2)
day=right(date2,2)
date1=year'/'month'/'day':'hour
xmsg.date_written = date1
xmsg.date_arrived = date1
xmsg.utc_ofs = 60
xmsg.replyto = 0
xmsg.replies.1 = 0
xmsg.replies.2 = 0
xmsg.replies.3 = 0
xmsg.replies.4 = 0
xmsg.replies.5 = 0
xmsg.replies.6 = 0
xmsg.replies.7 = 0
xmsg.replies.8 = 0
xmsg.replies.9 = 0
xmsg.replies.10 = 0
xmsg.ftsc_date = date('N') time('N')
'WRITE_MSG MSGH 0 XMSG. TEXT' length(text) length(text) length(control) 'CONTROL'
'CLOSE_MSG MSGH'
'UNLOCK MSG'
'CLOSE_AREA MSG'
'CLOSE_API'
address CMD 'rxsubcom drop msgapi'
call syssleep 3
end
return