home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
orion336.zip
/
telnet.srx
< prev
next >
Wrap
Text File
|
1997-10-10
|
3KB
|
94 lines
/* Sample script for implementing basic Telnet functions in AdeptXBBS */
arg line
Call AdeptInitRexx
if (line = 0) Then /* Telnet Script won't work in local mode */
Do
Call AdeptCLS line
Call AdeptCurPos line,12,1
Call AdeptPrint line, "Sorry Telnet only avaliable on nodes > 0\r\n"
Call AdeptPrint line, "{PB"
Exit
End
Call AdeptCLS line
Call AdeptLocation line, "Telnet"
/*Call AdeptSayGen line, "Telnet"*/
Call AdeptPrint line, "Some Popular AdeptXBBS Systems\r\n\r\n"
Call AdeptPrint line, "1> lakebbs.cn-newc.com.au - LakeBBs Australia \r\n"
address.1 = "lakebbs.cn-newc.com.au"
port.1 = 23
Call AdeptPrint line, "2> summitcnty.com - Summit Central BBS Colorado USA \r\n"
address.2 = "summitcnty.com"
port.2 = 23
Call AdeptPrint line, "3> snoval.com - SnoValley Shareware Exchange Washington USA\r\n"
address.3 = "snoval.com"
port.3 = 23
Call AdeptPrint line, "4> Multi User Dungeon System \r\n"
address.4 = "207.0.255.254"
port.4 = 3333
/*
Call AdeptPrint line, "5> viper.tensar.com - ViperNet \r\n"
address.5 = "viper.tensar.com"
port.5 = 23
*/
Call AdeptPrint line, "6> suntrix.com - Suntrix Oasis Florida USA \r\n"
address.5 = "suntrix.com"
port.5 = 23
Call AdeptPrint line, "7> USER DEFINED\r\n\r\n"
Choice = AdeptInput(line,,80,,,"Telnet to: ",,,)
if (choice = 7) Then
Do
Address.7 = AdeptInput(line,,80,,,"\r\nTelnet to address: ",,,)
if(Address.7 = '') then exit
Port.7 = AdeptInput(line,,12,,,"\r\nPort[Enter for Default]: ",,,)
if(Port.7 = '') then Port.7 = 23
End
if (choice = '') then exit
if (choice > 7 | choice < 1) then exit
Call AdeptPrint line, "\r\nTrying"
Do 3
Call AdeptPrint line,"{PA."
Call AdeptSleep line,128
End
Call AdeptPrint line, "{PA" || Address.Choice || " on port "||Port.Choice
Call AdeptLocation line, Address.Choice
Call AdeptSayGen line, "Telnet: " || Address.Choice
Call AdeptLog line,1,"Telnet: " || Address.Choice
Call AdeptLog line,1,"Port: " || Port.Choice
Call AdeptPrintL line,"\r\n\r\n\r\nUser is currently in a telnet session to: "||Address.Choice||":"||Port.Choice
rc = AdeptRawOpenSocket(ISTELNETCLIENT, Address.Choice, Port.Choice, 'Port')
if rc = 65558 then do
exit
end
if((port<>0) & (rc=0))then
rc = AdeptRawComLink(line, Port)
/*if rc = 65558 then do*/
rc = AdeptRawClose(Port)
exit
end
else
do
Call AdeptPrint line,"\r\nError: Could not connect to host.\r\n\r\n"
Call AdeptPrint line,"{PB"
exit
end