home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
339.lha
/
SerMod
/
rexx
/
terminal.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1990-02-08
|
2KB
|
91 lines
/* cis.rexx - call Compuserve and log on. */
options results
serial = 'ROBBS_ser'
display = 'ROBBS_disp'
keepgoing = TRUE
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 1200'
match 1 'CONNECT 2400'
scan on
connect 'ROBBS_disp TEXT'
call openport('ROBBS_ctrl')
address 'ROBBS_disp'
title 'ROBBS Terminal'
connect 'ROBBS_ser SEND'
ltext
lhtext ' ROBBS Terminal ready.'
ltext ' Press F10 key to exit terminal.'
ltext ' Press F1 or F2 to reset modem.'
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
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 keepgoing
parse arg num
address 'ROBBS_ser'
select
when num = 1 then lsend 'ATZ'
when num = 2 then lsend AtZ
when num = 10 then keepgoing = FALSE
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
address 'ROBBS_ser' 'COMM 1200 NOECHO XENABLED TRANSLATE'
when matchnum = 1 then
address 'ROBBS_ser' 'COMM 2400 NOECHO XENABLED TRANSLATE'
end
return(0)