Suzuran Posted January 25, 2007 Posted January 25, 2007 Hi. I'm new to AutoIt and I have one question. How do I get a text from a chat window to analyze it and then send back another text?
Buffo Posted January 25, 2007 Posted January 25, 2007 Try with Auto It Info Window from your start menu. With this tool you can identify the control which contains the text. Then with ControlGetText() you can read it and process. Regards, Buffo
someone Posted January 25, 2007 Posted January 25, 2007 (edited) You want to look at the help under at the Control functions (and/or possibly WinGetText) and the Autoit window info. 'Analyzing' the text depends on what you mean.... but you'll want to check out StringInStr. For sending the text use ControlSend. Hope this helps EDIT: beat to it by Buffo Edited January 25, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
Suzuran Posted January 25, 2007 Author Posted January 25, 2007 (edited) I want to make a script which sends an away message when someone starts a conversation with me on messenger. Edited January 25, 2007 by Suzuran
Suzuran Posted January 25, 2007 Author Posted January 25, 2007 (edited) I did this:ControlGetText("", "", "109824256") Sleep(1000) Send("I'm currently away from the computer{ENTER}") Sleep(1000) But it runs only one time and it types the text in the active window, even if nobody started a conversation Edited January 25, 2007 by Suzuran
someone Posted January 25, 2007 Posted January 25, 2007 (edited) You have to think about what the script you wrote is doing... It runs once because you didn't put it in a loop, it sends to the active window because of how Send works(it sends the text to the active window). Try opening two test windows, and using your text in a while/wend loop and using controlsend as opposed to Send. Something like this While 1 ; Keeps the script going ControlGetText("", "", "109824256") Sleep(1000) ControlSend("title of 2nd window", "", controlID, "I'm away text");note it doesn't Send ENTER Sleep(1000) Sleep(15000) ; Will loop the script every 15 seconds Wend ; End of Loop statement I didn't test that code(as I'm eating) but hopefully that gives you a better idea. There are several kinds of loops in autoit but in this case While 1 keeps the script running until you stop it, hence why I added the larger sleep at the end; so the script doesn't overload you with sending text but will do it every 15 seconds. If you get stuck post your code we'll try to help. EDIT: fixed some spelling, made myself clearer(hopefully) Edited January 25, 2007 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd
Suzuran Posted January 25, 2007 Author Posted January 25, 2007 Thanks for the help. I'll search some good tutorials on Google and learn things.
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