sumkid Posted October 10, 2007 Share Posted October 10, 2007 well im looking for a way to make it so if a key is pressed it will send that key to multiple windows this is what i have so far... expandcollapse popupSleep(2000) HotKeySet("{ESC}","qt") $hexKey = '0x' & $hexKey $list = ProcessList("process.exe") for $i = 1 to $list[0][0] msgbox(0, $list[$i][0], $list[$i][1]) next $var = WinList() For $i = 1 to $list[0][0] If $list[$i][0] <> "" AND IsVisible($list[$i][1]) Then MsgBox(0, "Details", "Title=" & $list[$i][0] & @LF & "Handle=" & $list[$i][1]) EndIf Next Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc Func _IsPressed($hexKey) If _IsPressed('31') Then ControlSend($list, "", "Edit1", "1") EndIf If _IsPressed('32') Then ControlSend($list, "", "Edit1", "2") EndIf If _IsPressed('33') Then ControlSend($list, "", "Edit1", "3") EndIf If _IsPressed('34') Then ControlSend($list, "", "Edit1", "4") EndIf If _IsPressed('35') Then ControlSend($list, "", "Edit1", "5") EndIf If _IsPressed('36') Then ControlSend($list, "", "Edit1", "6") EndIf If _IsPressed('37') Then ControlSend($list, "", "Edit1", "7") EndIf If _IsPressed('38') Then ControlSend($list, "", "Edit1", "8") EndIf If _IsPressed('39') Then ControlSend($list, "", "Edit1", "9") EndIf If _IsPressed(41) Then ControlSend($list, "", "Edit1", "a") EndIf If _IsPressed(44) Then ControlSend($list, "", "Edit1", "d") EndIf If _IsPressed(53) Then ControlSend($list, "", "Edit1", "s") EndIf If _IsPressed(57) Then ControlSend($list, "", "Edit1", "w") EndIf EndFunc Func qt() Exit EndFunc any ideas on what i may be doing wrong? Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 10, 2007 Share Posted October 10, 2007 (edited) well im looking for a way to make it so if a key is pressed it will send that key to multiple windows this is what i have so far...any ideas on what i may be doing wrong?Pretty much everything... _IsPressed() is already declared in Misc.au3, and you redeclared the function with broken code. Just include Misc.au3.You list windows to $var, but then try to display them from $list.Your version of _IsPressed() function is recursively calling itself.Your ControlSend() calls are attempting to use an entire array as the window handle, vice a valid array reference.The attempted window handle reference is coming from the list of processes, not the list of windows.Etc., etc., etc....You can't possibly have bothered to check this code with SciTE Tidy and Syntax Checker. Are you even using SciTE? P.S. ...and don't dual post the same topic. You were already getting help on this. Edited October 10, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 10, 2007 Share Posted October 10, 2007 he's phishing... Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 10, 2007 Share Posted October 10, 2007 What the heck is duelboxing? Is that supposed to be dual, as in, two at a time? Duel is a fight. Link to comment Share on other sites More sharing options...
DW1 Posted October 10, 2007 Share Posted October 10, 2007 If you check out the code posted, I would agree that he is "fighting" logic at this point.... maybe thats what duelboxing means... AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 10, 2007 Share Posted October 10, 2007 And with two threads about it, I agree, it's a nice play on words... Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache 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