merulz Posted March 16, 2009 Share Posted March 16, 2009 Is it possible to send commands to a window instead of waiting for that window to be active? Link to comment Share on other sites More sharing options...
TerarinK Posted March 16, 2009 Share Posted March 16, 2009 you first need to confirm it is there, then you can send any command to that window 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
merulz Posted March 16, 2009 Author Share Posted March 16, 2009 Okay, so if I understand you correctly, I need to target the window so that AutoIt can confirm it's there? How would I go about doing this? Sorry for the questions, I'm brand new to AutoIt Link to comment Share on other sites More sharing options...
TerarinK Posted March 16, 2009 Share Posted March 16, 2009 WinExist, read the help file it is one of the most resourceful things 0x576520616C6C206469652C206C697665206C69666520617320696620796F75207765726520696E20746865206C617374207365636F6E642E Link to comment Share on other sites More sharing options...
merulz Posted March 16, 2009 Author Share Posted March 16, 2009 Okay, I think I got it now. What I'm trying to do is make the script loop endlessly. I checked here but am confused about which one would be used for my need.Here's my script so far:If WinExists("Element Client") Then Send{+[1]} ;targets party member #1 Sleep("1000") ;waits a second Send{[F2]} ;change this to your hotkey for heal Sleep("1000") Send{+[2]} ;targets party member #2 Sleep("1000") Send{[F2]} ;change this to your hotkey for heal Sleep("1000") Send{+[3]} Sleep("1000") Send{[F2]} Sleep("1000") Send{+[4]} Sleep("1000") Send{[F2]} Sleep("1000") Send{+[5]} Sleep("1000") Send{[F2]} Sleep("1000") Link to comment Share on other sites More sharing options...
muzle6074 Posted March 17, 2009 Share Posted March 17, 2009 While 1 If WinExists("Element Client") Then Send{+[1]};targets party member #1 Sleep("1000");waits a second Send{[F2]};change this to your hotkey for heal Sleep("1000") Send{+[2]};targets party member #2 Sleep("1000") Send{[F2]};change this to your hotkey for heal Sleep("1000") Send{+[3]} Sleep("1000") Send{[F2]} Sleep("1000") Send{+[4]} Sleep("1000") Send{[F2]} Sleep("1000") Send{+[5]} Sleep("1000") Send{[F2]} Sleep("1000") EndIf Wend By using while 1 (always true) it will continuously loop through the script. Also remember to close all open statements like your If (EndIf) and While (Wend). Hope this helps, Regards Link to comment Share on other sites More sharing options...
Diception Posted March 17, 2009 Share Posted March 17, 2009 CODEWhile 1 If WinExists("elementclient") Then Winactivate("elementclient") Send{+[1]};targets party member #1 Sleep("1000");waits a second Send{[F2]};change this to your hotkey for heal Sleep("1000") Send{+[2]};targets party member #2 Sleep("1000") Send{[F2]};change this to your hotkey for heal Sleep("1000") Send{+[3]} Sleep("1000") Send{[F2]} Sleep("1000") Send{+[4]} Sleep("1000") Send{[F2]} Sleep("1000") Send{+[5]} Sleep("1000") Send{[F2]} Sleep("1000") EndIf Wend Link to comment Share on other sites More sharing options...
AlmarM Posted March 17, 2009 Share Posted March 17, 2009 (edited) Take a look at this, I cleaned up your code a bit. While 1 If WinExists("elementclient") Then WinActivate("elementclient") For $i = 1 To 5 Send("+{" & $i & "}") Sleep(1000) Send("{F2}") Sleep(1000) Next EndIf WEnd And about your first question, take a look at ControlSend(). AlmarM Edited March 17, 2009 by AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
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