home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / orionup.zip / telnet.srx < prev    next >
Text File  |  1997-10-10  |  3KB  |  94 lines

  1. /* Sample script for implementing basic Telnet functions in AdeptXBBS */
  2.  
  3. arg line
  4.  
  5. Call AdeptInitRexx
  6.  
  7. if (line = 0) Then  /* Telnet Script won't work in local mode */
  8. Do
  9.   Call AdeptCLS line
  10.   Call AdeptCurPos line,12,1
  11.   Call AdeptPrint line, "Sorry Telnet only avaliable on nodes > 0\r\n"
  12.   Call AdeptPrint line, "{PB"
  13.   Exit
  14. End
  15.  
  16.  
  17. Call AdeptCLS line
  18. Call AdeptLocation line, "Telnet"
  19. /*Call AdeptSayGen line, "Telnet"*/
  20.  
  21. Call AdeptPrint line, "Some Popular AdeptXBBS Systems\r\n\r\n"
  22. Call AdeptPrint line, "1> lakebbs.cn-newc.com.au - LakeBBs Australia         \r\n"
  23. address.1 = "lakebbs.cn-newc.com.au"
  24. port.1 = 23
  25.  
  26. Call AdeptPrint line, "2> summitcnty.com         - Summit Central BBS Colorado USA         \r\n"
  27. address.2 = "summitcnty.com"
  28. port.2 = 23
  29.  
  30. Call AdeptPrint line, "3> snoval.com             - SnoValley Shareware Exchange Washington USA\r\n"
  31. address.3 = "snoval.com"
  32. port.3 = 23
  33. Call AdeptPrint line, "4> Multi User Dungeon System                         \r\n"
  34. address.4 = "207.0.255.254"
  35. port.4 = 3333
  36. /*
  37. Call AdeptPrint line, "5> viper.tensar.com  - ViperNet                    \r\n"
  38. address.5 = "viper.tensar.com"
  39. port.5 = 23
  40. */
  41. Call AdeptPrint line, "6> suntrix.com            - Suntrix Oasis Florida USA               \r\n"
  42. address.5 = "suntrix.com"
  43. port.5 = 23
  44. Call AdeptPrint line, "7> USER DEFINED\r\n\r\n"
  45.  
  46. Choice = AdeptInput(line,,80,,,"Telnet to: ",,,)
  47.  
  48. if (choice = 7) Then
  49.   Do
  50.     Address.7 = AdeptInput(line,,80,,,"\r\nTelnet to address: ",,,)
  51.     if(Address.7 = '') then exit
  52.     Port.7 = AdeptInput(line,,12,,,"\r\nPort[Enter for Default]: ",,,)
  53.     if(Port.7 = '') then Port.7 = 23
  54.   End
  55.  
  56. if (choice = '') then exit
  57. if (choice > 7 | choice < 1) then exit
  58.  
  59.  
  60. Call AdeptPrint line, "\r\nTrying"
  61. Do 3
  62.   Call AdeptPrint line,"{PA."
  63.   Call AdeptSleep line,128
  64. End
  65.  
  66. Call AdeptPrint line, "{PA" || Address.Choice || " on port "||Port.Choice
  67.  
  68. Call AdeptLocation line, Address.Choice
  69. Call AdeptSayGen line, "Telnet: " || Address.Choice
  70.  
  71. Call AdeptLog line,1,"Telnet: " || Address.Choice
  72. Call AdeptLog line,1,"Port: " || Port.Choice
  73.  
  74. Call AdeptPrintL line,"\r\n\r\n\r\nUser is currently in a telnet session to: "||Address.Choice||":"||Port.Choice
  75.  
  76. rc = AdeptRawOpenSocket(ISTELNETCLIENT, Address.Choice, Port.Choice, 'Port')
  77. if rc = 65558 then do
  78. exit
  79. end
  80.  
  81. if((port<>0) & (rc=0))then
  82.   rc = AdeptRawComLink(line, Port)
  83. /*if rc = 65558 then do*/
  84.   rc = AdeptRawClose(Port)
  85.   exit
  86.   end
  87. else
  88. do
  89.   Call AdeptPrint line,"\r\nError: Could not connect to host.\r\n\r\n"
  90.   Call AdeptPrint line,"{PB"
  91.   exit
  92. end
  93.  
  94.