I'm searching a way to make a script for a simple TELNET login in my router, it would send username and password then would send a command and finally close telnet session, ALL of that using only AutoIT and without user interaction (AUTOMATED & HIDED). If anyone wants to help me thanks in advance! ----- What I want to automate? This: (It's for reconnect to change IP, for the router of the ISP Arnet Discus DRG A112) Start Menu > Run..: telnet 10.0.0.2 Username: admin Password: alvlgeddl Command 1: ppp config 0.0.33 down Command 2: ppp config 0.0.33 up Command 3: logout ----- edit: I made it!! YEAH! works fine full-auto. But... have some problems because of my router, if session was not closed correctly or opens sessions too fast, it locks and not permit any more connections, even worse don't returns any error, just close your telnet session instantly after send "Start > Run..: telnet 10.0.0.2". TcpStartUp ()
$RouterIP = tcpconnect("10.0.0.2", "23")
Do
Sleep(100)
Until $RouterIP <> "-1"
While 1
Sleep(100)
$TCPRecv = TCPRecv($RouterIP,"5000")
;~ ConsoleWrite($TCPRecv) ;for debug test
;~ MsgBox("","",$TCPRecv) ;for debug test
If StringInStr($TCPRecv, "Login:") > 0 Then
TCPSend($RouterIP, "admin" & @crlf)
ElseIf StringInStr($TCPRecv, "Password:") > 0 Then
TCPSend($RouterIP, "alvlgeddl" & @crlf)
TCPSend($RouterIP, "ppp config 0.0.33 down" & @crlf)
TCPSend($RouterIP, "ppp config 0.0.33 up" & @crlf)
TCPSend($RouterIP, "logout" & @crlf)
ElseIf StringInStr($TCPRecv, "have a nice day") > 0 Then
ExitLoop
EndIf
WEnd
TCPShutdown()