Jump to content

duelboxing still having problems...


sumkid
 Share

Recommended Posts

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...

Sleep(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

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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...