/* Sample script for implementing basic Telnet functions in AdeptXBBS */

LEAVEPORTOPEN       = X2D(00000001)
OPENPORTSHARED      = X2D(00000002)
OPENWRITETHROUGH    = X2D(00000004)
ISPIPESERVER        = X2D(00000010)
ISPIPECLIENT        = X2D(00000020)
IGNORECARRIER       = X2D(00000040)

ISTELNETSERVER      = X2D(00000080)
ISTELNETCLIENT      = X2D(00000100)
ISSERIAL            = X2D(00000200)
ISSOCKETSERVER      = X2D(00000400)
ISSOCKETCLIENT      = X2D(00000800)
DELETECONNECTION    = X2D(00001000)

ARG Line

 Address = AdeptInput(line,,80,,,"[0m[K\r\n[KTelnet to address: ",,,)

if(Address = '') then do
    exit
end

RetCode = AdeptRawOpenSocket(ISTELNETCLIENT, Address, 23, 'Port')

AdeptRawComLink(line, Port)

