Azunai Posted September 5, 2006 Posted September 5, 2006 Hi there, I'm a newb when it comes to using AutoIt, but you know, this is a really great tool to create quick running progs. Thanks to the developers of this tool. You guys rock! Quick question, but I was wondering...is there is any sort of functionality that allows for waiting for a string of text coming from a window before resuming a script? I ask this because in an app that I'm trying to make, I'm trying to create an autologin program and execute some shell commands. I want to basically be able to have the program throw a new window (in PuTTY) to SSH to a box, when it prompts for username, the username is entered automatically. Then, when the response comes back, if it asks for password, the password is entered automatically. Here's the code: Run("putty.exe") WinWaitActive("PuTTY Configuration") ControlSend("PuTTY Configuration", "", "Edit1", $strServer) ControlClick("PuTTY Configuration", "", "&Open") Sleep(1500) ControlSend($strServer & " - PuTTY", "", "", $strUsername & "^M") Sleep(1000) ControlSend($strServer & " - PuTTY", "", "", $strPassword & "^M") As it stands right now, I'm coding this app and just putting Sleep(1000) or something like that to time a response and wait for it to come back. If there is something that could just expect a response rather than setting an exact amount of time to wait before going further, that would be cool. What do you think? Azunai
Uten Posted September 5, 2006 Posted September 5, 2006 Not sure if you can get a hook to the putty terminal window but if you can then you should take a look at ConsoleRead and associated functions in the help file. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
lod3n Posted September 5, 2006 Posted September 5, 2006 I don't think Putty uses a real console window, so i don't think STD functions would apply. But you could use PLink, the command line version of Putty. That'd probably work fairly well. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Azunai Posted September 5, 2006 Author Posted September 5, 2006 I don't think Putty uses a real console window, so i don't think STD functions would apply. But you could use PLink, the command line version of Putty. That'd probably work fairly well.Hmm...I'll take a look into this and let you know what I find. Thanks for the replies!
TripleDES Posted October 15, 2008 Posted October 15, 2008 Hmm...I'll take a look into this and let you know what I find. Thanks for the replies!So what did you find (2 years later) I'm looking for the same functionality.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now