home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
339.lha
/
SerMod
/
rexx
/
cis.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1990-02-08
|
3KB
|
134 lines
/* cis.rexx - call Compuserve and log on. */
options results
CTRLC = '03'x
BELL = '07'x
CLS = '0c'x
cmdtimes = 0
exiting = 0
id = '7nnnn-nnnn'
password = 'pass-word'
serial = 'ROBBS_ser'
display = 'ROBBS_disp'
keepgoing = TRUE
dialstring = 'ATDT 737-2452'
ports = showlist('p')
if pos(serial, ports) = 0 then address command 'run SerMod'
if pos(display, ports) = 0 then address command 'run DispMod'
if(checkport(serial)) = 0 then call dumpout
if(checkport(display)) = 0 then call dumpout
address 'ROBBS_ser'
match 0 'CONNECT 2400'
match 1 'ID'
match 2 'Password'
match 3 'NO CARRIER'
match 4 'BUSY'
match 5 'NO DIALTONE'
scan on
connect 'ROBBS_disp TEXT'
call openport('ROBBS_ctrl')
address 'ROBBS_disp'
title 'Compuserve'
connect 'ROBBS_ser SEND'
address 'ROBBS_ser'
lsend dialstring
do while keepgoing = TRUE
packet = getpkt('ROBBS_ctrl')
do while packet = '00000000'x
call waitpkt('ROBBS_ctrl')
packet = getpkt('ROBBS_ctrl')
end
arg0 = getarg(packet)
arg1 = getarg(packet,1)
call reply(packet,0)
select
when arg0 = 'MATCH' then call matchit(arg1)
when arg0 = 'FKEY' then call fkey(arg1+1)
when arg0 = 'HELP' then call dumpout
otherwise nop
end
end
exit 0
dumpout:
call delay(50)
if checkport(display) = 1 then address 'ROBBS_disp' die
if checkport(serial) = 1 then address 'ROBBS_ser' die
say
do while pos(display, ports) || pos(serial, ports) > 0
call delay(5)
ports = showlist('p')
end
say 'All Done.'
exit(0)
checkport: procedure expose serial display
parse arg port
do i = 1 to 10
ports = showlist('p')
if pos(port, ports) > 0 then return 1
else call delay(20)
end
return(0)
fkey: procedure expose exiting keepgoing
parse arg num
address 'ROBBS_ser'
select
when num = 1 then lsend '-larry'
when num = 2 then lsend '/ex' || '0a'x || 's'
when num = 3 then lsend 'ust'
when num = 4 then nop
when num = 5 then nop
when num = 6 then lsend '/ust co'
when num = 7 then lsend '/ust'
when num = 8 then lsend '/ust all'
when num = 9 then lsend '/sta'
when num = 10 then do
exiting = exiting + 1
if exiting > 3 then keepgoing = FALSE
end
end
return(0)
matchit: procedure expose CTRLC CLS BELL id password dialstring
address 'ROBBS_ser'
parse arg matchnum
now = time()
select
when matchnum = 0 then do
address 'ROBBS_disp' text BELL
address 'ROBBS_ser'
delay(50)
send CTRLC
match 0
match 3
match 4
end
when matchnum = 1 then do
lsend id
match 1
end
when matchnum = 2 then do
lsend password
match 2
end
when matchnum = 3 | matchnum = 4 | matchnum = 5 then do
delay(50 * 10)
address 'ROBBS_disp' text CLS
address 'ROBBS_ser' lsend dialstring
end
otherwise
nop
end
return(0)