Jump to content

Controlling a Telnet session


Guest Nick Burns
 Share

Recommended Posts

Guest Nick Burns

Hi! Long time user, first time member. Just upgraded to v3 and love the new features.

I'm trying to control a telnet session. How can I pause (without using sleep()) AutoIT to wait for certain prompts to appear before sending it's commands. I need it to wait for the prompts:

Login: [send login name]

Password: [send password]

and then the systems prompt: (root\#) [ send command]

currently I'm using Sleep() and I've got the script compiled to a RunTel.EXE file. If you run RunTel directly, the sleep delays are perfect.

I'm trying to shell() to RunTel from another app, and I found that RunTel runs slower, you can actually see the letters on the Console window. and the sleep delays are off.

The actual application is a web program and when I run the app from the server, the shell()ed RunTel runs even slower. :D

So, if there was away for AutoIT to wait for certain text to appear in the Console before sending it's commands, I'd appreciate any help in the matter.

Link to comment
Share on other sites

You could try launching the AutoIt spy window to see if any of the window text from your telnet application is detected. I don't know that much about how telnet works, but if you can log your session to a file, you chould also check that file for the existance of the text you are searching for.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

  • 3 weeks later...

... if there was away for AutoIT to wait for certain text to appear in the Console before sending it's commands, I'd appreciate any help in the matter.

Which telnet client are you using? With the console mode telnet.exe bundled with Windows XP. the WindowText is always blank. There is a little trick to use autoIt to get the text from the console using the clipboard, and then examine the text in it. You'll have to retry several times with a short sleep() between, rather than a long sleep.

Hope it helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...