Koil Posted October 3, 2008 Share Posted October 3, 2008 I want to send SPACE bar to my diablo window every 1.2 seconds but it errors! AutoItSetOption("WinTitleMatchMode", 4) $handle = WinGetHandle("Classname=DIAWIN", "Diablo II") While 1 If @error Then MsgBox(4096, "Error", "Could not find the correct window") Else ; Send some text directly to this window's edit control ControlSend("$Handle", "", "", "{Space}" ) Sleep(1200) EndIf Wend Fix it for a cookie.. Link to comment Share on other sites More sharing options...
AlmarM Posted October 3, 2008 Share Posted October 3, 2008 (edited) Whats the exact ERROR? AlmarM EDIT: ControlSend("$Handle", "", "", "{Space}" ) ControlSend($Handle, "", "", "{SPACE}") Does this help? Edited October 3, 2008 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...
Koil Posted October 3, 2008 Author Share Posted October 3, 2008 MsgBox(4096, "Error", "Could not find the correct window") that error, not finding the right window.. Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 3, 2008 Share Posted October 3, 2008 Well, you've got a couple of problems. First, you aren't closing the program if you get an error. Second, you put $handle in quotes, which is wrong. Link to comment Share on other sites More sharing options...
AlmarM Posted October 3, 2008 Share Posted October 3, 2008 Ehm... http://www.autoitscript.com/forum/index.ph...st&p=587114AlmarM 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...
Gee Posted October 3, 2008 Share Posted October 3, 2008 (edited) try : WinActive($Handle,"") Edited October 3, 2008 by Gee Link to comment Share on other sites More sharing options...
Koil Posted October 3, 2008 Author Share Posted October 3, 2008 (edited) the window needs to be active for it to go thru or something?.. i want this to send to a window in the background while im surfing the net or something, possible? Edited October 3, 2008 by Koil Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 3, 2008 Share Posted October 3, 2008 Ehm... http://www.autoitscript.com/forum/index.ph...st&p=587114AlmarMI had the window open for a while before I replied. 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