Das etwas andere Problem.

  • Da ist mal ein Problem gelöst..
    schon taucht das nächste auf, diesmal jedoch etwas... anderes.

    Theoretisch sollte dieses "Problem" so, garnicht vorhanden sein.
    Um es aber besser zu verstehen solltet ihr den Script tatsächlich selber mal ausführen.

    Beispiel:
    Wählt als Function: Combo WASD
    als Direction: Combo
    und als Distance: am besten 1

    nun klickt auf "Done"..

    Was nun passiert ist merkwürdig.. und zwar..
    Drückt man "W" bewegt sich die Maus wie gewollt nach oben.. JEDOCH ... nicht mit dem gleichen Tempo wie zb: "A", "S" oder "D" ...
    bei mir ist "A" am schnellsten.. Danach kommt "W" und "D" ... "S" ist am langsamsten..

    Das selbe stelle ich bei Combo ARROW fest.
    jedoch ist da "Up" am schnellsten, gefolgt von "Left" und "Right", die sich die selbe geschwindigkeit teilen... nur "Down" ist wieder am langsamsten.

    Nun die ultimative Frage:
    Warum?

    Am script kann es doch nicht liegen, oder?
    Übersehe ich was?


    Bin sehr auf eure antworten gespannt..
    Falls sich wer dazu äußern kann. ^^


    Script:

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.8.1
    Author: ThirtySix

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    MouseMove

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GuiOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $MouseMove = GUICreate("MouseMove", 227, 124, 461, 286)
    GUISetBkColor(0x9DB9EB)

    [/autoit] [autoit][/autoit] [autoit]

    $Done = GUICtrlCreateButton("Done", 16, 14, 75, 25)
    $Info = GUICtrlCreateButton("Info", 16, 78, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    $PressedKey = GUICtrlCreateCombo("", 104, 16, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
    GUICtrlSetData(-1, "M1|M2|M3|Shift|CTRL|W|A|S|D|Up|Down|Left|Right|Combo WASD|Combo ARROW")
    GUICtrlSendMsg($PressedKey, 0x1703, 0, "Function")

    [/autoit] [autoit][/autoit] [autoit]

    $PosDir = GUICtrlCreateCombo("", 104, 48, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
    GUICtrlSetData(-1, "Up|Down|Left|Right|Combo")
    GUICtrlSendMsg($PosDir, 0x1703, 0, "Direction")

    [/autoit] [autoit][/autoit] [autoit]

    $Far = GUICtrlCreateCombo("", 104, 80, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
    GUICtrlSetData(-1, "1|2|5|10|25|50|75|100|150|250|350|500|750|1000|2000|5000|")
    GUICtrlSendMsg($Far, 0x1703, 0, "Distance")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUICtrlSetOnEvent($Done, "_Done")
    GUICtrlSetOnEvent($Info, "_Info")

    [/autoit] [autoit][/autoit] [autoit]

    Global $WKey, $AKey, $SKey, $DKey, $UpKey, $DownKey, $LeftKey, $RightKey, $xKey, $Key, $Dir, $pos, $x, $y, $DLL = DllOpen("user32.dll")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    If _IsPressed($xKey, $DLL) Then
    $pos = MouseGetPos()
    If $Dir = "Up" OR $Dir = "Left" Then
    MouseMove($pos[0]-$x, $pos[1]-$y)
    EndIf
    If $Dir = "Down" OR $Dir = "Right" Then
    MouseMove($pos[0]+$x, $pos[1]+$y)
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed($WKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1]-$y)
    EndIf
    If _IsPressed($AKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0]-$x, $pos[1])
    EndIf
    If _IsPressed($SKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1]+$y)
    EndIf
    If _IsPressed($DKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0]+$x, $pos[1])
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed($UpKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1]-$y)
    EndIf
    If _IsPressed($LeftKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0]-$x, $pos[1])
    EndIf
    If _IsPressed($DownKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1]+$y)
    EndIf
    If _IsPressed($RightKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0]+$x, $pos[1])
    EndIf
    Wend

    [/autoit] [autoit][/autoit] [autoit]

    Func _Done()
    if GUICtrlRead($Done) = "Done" Then
    If GUICtrlRead($PressedKey) = "" OR GUICtrlRead($PosDir) = "" OR GUICtrlRead($Far) = "" Then
    MsgBox(0,"error","First: Setup"&@CRLF&"Then: Done")
    Else
    $Key = GUICtrlRead($PressedKey)
    $Dir = GUICtrlRead($PosDir)
    $Farcheck = GUICtrlRead($Far)
    GUICtrlSetData($Done,"Reset")

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "M1" Then $xKey = 01
    If $Key = "M2" Then $xKey = 02
    If $Key = "M3" Then $xKey = 04
    If $Key = "Shift" Then $xKey = 10
    If $Key = "CTRL" Then $xKey = 11

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "W" Then $xKey = 57
    If $Key = "A" Then $xKey = 41
    If $Key = "S" Then $xKey = 53
    If $Key = "D" Then $xKey = 44

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Up" Then $xKey = 26
    If $Key = "Down" Then $xKey = 28
    If $Key = "Left" Then $xKey = 25
    If $Key = "Right" Then $xKey = 27

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Combo WASD" Then
    $WKey = 57
    $AKey = 41
    $SKey = 53
    $DKey = 44
    GUICtrlSetData($PosDir,"Combo")
    $Dir = "ALL"
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Combo ARROW" Then
    $UpKey = 26
    $DownKey = 28
    $LeftKey = 25
    $RightKey = 27
    GUICtrlSetData($PosDir,"Combo")
    $Dir = "ALL"
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If $Dir = "Up" Or $Dir = "Down" Then $y = $Farcheck
    If $Dir = "Left" Or $Dir = "Right" Then $x = $Farcheck

    [/autoit] [autoit][/autoit] [autoit]

    If $Dir = "ALL" Then
    $x = $Farcheck
    $y = $Farcheck
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetState($PosDir, $GUI_DISABLE)
    GUICtrlSetState($PressedKey, $GUI_DISABLE)
    GUICtrlSetState($Far, $GUI_DISABLE)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ MsgBox(0,"",$WKey&"=W "&$AKey&"=A "&$SKey&"=S "&$DKey&"=D "&$UpKey&"=up "&$DownKey&"=down "&$LeftKey&"=left "&$RightKey&"=right "&$xKey&"=xkey "&$Key&"=key "&$Dir&"=dir "&$x&"=x "&$y&"=y "&$Farcheck&"=FC")
    EndIf
    Else
    $x = ""
    $y = ""
    $Key = ""
    $WKey = ""
    $AKey = ""
    $SKey = ""
    $DKey = ""
    $UpKey = ""
    $DownKey = ""
    $LeftKey = ""
    $RightKey = ""
    $Dir = ""
    $xKey = ""
    $Farcheck = ""
    GUICtrlSetData($Done,"Done")
    GUICtrlSetData($PressedKey,"")
    GUICtrlSetData($PressedKey, "M1|M2|M3|Shift|CTRL|W|A|S|D|Up|Down|Left|Right|Combo WASD|Combo ARROW")
    GUICtrlSetData($PosDir,"")
    GUICtrlSetData($PosDir, "Up|Down|Left|Right|Combo")
    GUICtrlSetData($Far,"")
    GUICtrlSetData($Far, "1|2|5|10|25|50|75|100|150|250|350|500|750|1000|2000|5000|")
    GUICtrlSetState($PosDir, $GUI_ENABLE)
    GUICtrlSetState($PressedKey, $GUI_ENABLE)
    GUICtrlSetState($Far, $GUI_ENABLE)
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Info()
    MsgBox(0, "MouseMove", "Coded by ThirtySix")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($DLL)
    Exit
    EndFunc

    [/autoit]

    Wer Rechtschreibfehler findet darf sie behalten. :D

    2 Mal editiert, zuletzt von ThirtySix (27. Juli 2013 um 12:16)

    • Offizieller Beitrag

    Hab gerade mal etwas probiert. So ist es bei mir gleich schnell

    Spoiler anzeigen
    [autoit]

    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.8.1
    Author: ThirtySix

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    MouseMove

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GuiOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    #region ### START Koda GUI section ### Form=
    $MouseMove = GUICreate("MouseMove", 227, 124, 461, 286)
    GUISetBkColor(0x9DB9EB)

    [/autoit] [autoit][/autoit] [autoit]

    $Done = GUICtrlCreateButton("Done", 16, 14, 75, 25)
    $Info = GUICtrlCreateButton("Info", 16, 78, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    $PressedKey = GUICtrlCreateCombo("", 104, 16, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
    GUICtrlSetData(-1, "M1|M2|M3|Shift|CTRL|W|A|S|D|Up|Down|Left|Right|Combo WASD|Combo ARROW")
    GUICtrlSendMsg($PressedKey, 0x1703, 0, "Function")

    [/autoit] [autoit][/autoit] [autoit]

    $PosDir = GUICtrlCreateCombo("", 104, 48, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
    GUICtrlSetData(-1, "Up|Down|Left|Right|Combo")
    GUICtrlSendMsg($PosDir, 0x1703, 0, "Direction")

    [/autoit] [autoit][/autoit] [autoit]

    $Far = GUICtrlCreateCombo("", 104, 80, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
    GUICtrlSetData(-1, "1|2|5|10|25|50|75|100|150|250|350|500|750|1000|2000|5000|")
    GUICtrlSendMsg($Far, 0x1703, 0, "Distance")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUICtrlSetOnEvent($Done, "_Done")
    GUICtrlSetOnEvent($Info, "_Info")

    [/autoit] [autoit][/autoit] [autoit]

    Global $WKey, $AKey, $SKey, $DKey, $UpKey, $DownKey, $LeftKey, $RightKey, $xKey, $Key, $Dir, $pos, $x, $y, $DLL = DllOpen("user32.dll")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    ;~ If _IsPressed($xKey, $DLL) Then
    ;~ $pos = MouseGetPos()
    ;~ If $Dir = "Up" Or $Dir = "Left" Then
    ;~ MouseMove($pos[0] - $x, $pos[1] - $y)
    ;~ EndIf
    ;~ If $Dir = "Down" Or $Dir = "Right" Then
    ;~ MouseMove($pos[0] + $x, $pos[1] + $y)
    ;~ EndIf
    ;~ EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed($WKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] - $y, 1)
    ConsoleWrite('! W' & $y & @CRLF)
    EndIf
    If _IsPressed($AKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] - $x, $pos[1], 1)
    ConsoleWrite('! S' & @CRLF)
    EndIf
    If _IsPressed($SKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] + $y, 1)
    ConsoleWrite('! A' & $y & @CRLF)
    EndIf
    If _IsPressed($DKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] + $x, $pos[1], 1)
    ConsoleWrite('! D' & $x & @CRLF)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed($UpKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] - $y)
    EndIf
    If _IsPressed($LeftKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] - $x, $pos[1])
    EndIf
    If _IsPressed($DownKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] + $y)
    EndIf
    If _IsPressed($RightKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] + $x, $pos[1])
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Done()
    If GUICtrlRead($Done) = "Done" Then
    If GUICtrlRead($PressedKey) = "" Or GUICtrlRead($PosDir) = "" Or GUICtrlRead($Far) = "" Then
    MsgBox(0, "error", "First: Setup" & @CRLF & "Then: Done")
    Else
    $Key = GUICtrlRead($PressedKey)
    $Dir = GUICtrlRead($PosDir)
    $Farcheck = GUICtrlRead($Far)
    GUICtrlSetData($Done, "Reset")

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "M1" Then $xKey = 01
    If $Key = "M2" Then $xKey = 02
    If $Key = "M3" Then $xKey = 04
    If $Key = "Shift" Then $xKey = 10
    If $Key = "CTRL" Then $xKey = 11

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "W" Then $xKey = 57
    If $Key = "A" Then $xKey = 41
    If $Key = "S" Then $xKey = 53
    If $Key = "D" Then $xKey = 44

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Up" Then $xKey = 26
    If $Key = "Down" Then $xKey = 28
    If $Key = "Left" Then $xKey = 25
    If $Key = "Right" Then $xKey = 27

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Combo WASD" Then
    $WKey = 57
    $AKey = 41
    $SKey = 53
    $DKey = 44
    GUICtrlSetData($PosDir, "Combo")
    $Dir = "ALL"
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Combo ARROW" Then
    $UpKey = 26
    $DownKey = 28
    $LeftKey = 25
    $RightKey = 27
    GUICtrlSetData($PosDir, "Combo")
    $Dir = "ALL"
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If $Dir = "Up" Or $Dir = "Down" Then $y = $Farcheck
    If $Dir = "Left" Or $Dir = "Right" Then $x = $Farcheck

    [/autoit] [autoit][/autoit] [autoit]

    If $Dir = "ALL" Then
    $x = $Farcheck
    $y = $Farcheck
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetState($PosDir, $GUI_DISABLE)
    GUICtrlSetState($PressedKey, $GUI_DISABLE)
    GUICtrlSetState($Far, $GUI_DISABLE)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ MsgBox(0,"",$WKey&"=W "&$AKey&"=A "&$SKey&"=S "&$DKey&"=D "&$UpKey&"=up "&$DownKey&"=down "&$LeftKey&"=left "&$RightKey&"=right "&$xKey&"=xkey "&$Key&"=key "&$Dir&"=dir "&$x&"=x "&$y&"=y "&$Farcheck&"=FC")
    EndIf
    Else
    $x = ""
    $y = ""
    $Key = ""
    $WKey = ""
    $AKey = ""
    $SKey = ""
    $DKey = ""
    $UpKey = ""
    $DownKey = ""
    $LeftKey = ""
    $RightKey = ""
    $Dir = ""
    $xKey = ""
    $Farcheck = ""
    GUICtrlSetData($Done, "Done")
    GUICtrlSetData($PressedKey, "")
    GUICtrlSetData($PressedKey, "M1|M2|M3|Shift|CTRL|W|A|S|D|Up|Down|Left|Right|Combo WASD|Combo ARROW")
    GUICtrlSetData($PosDir, "")
    GUICtrlSetData($PosDir, "Up|Down|Left|Right|Combo")
    GUICtrlSetData($Far, "")
    GUICtrlSetData($Far, "1|2|5|10|25|50|75|100|150|250|350|500|750|1000|2000|5000|")
    GUICtrlSetState($PosDir, $GUI_ENABLE)
    GUICtrlSetState($PressedKey, $GUI_ENABLE)
    GUICtrlSetState($Far, $GUI_ENABLE)
    EndIf
    EndFunc ;==>_Done

    [/autoit] [autoit][/autoit] [autoit]

    Func _Info()
    MsgBox(0, "MouseMove", "Coded by ThirtySix")
    EndFunc ;==>_Info

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($DLL)
    Exit
    EndFunc ;==>_Exit

    [/autoit]
    • Offizieller Beitrag

    Ich habe auch rumprobiert. Entscheidend ist auf jeden Fall der 3. Parameter bei MouseMove. Man kann auch Null einsetzen und einen zusätzlichen Timer benutzen für die Feinabstimmung:

    Spoiler anzeigen
    [autoit]


    #cs ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    AutoIt Version: 3.3.8.1
    Author: ThirtySix

    [/autoit] [autoit][/autoit] [autoit]

    Script Function:
    MouseMove

    [/autoit] [autoit][/autoit] [autoit]

    #ce ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GuiOnEventMode", 1)

    [/autoit] [autoit][/autoit] [autoit]

    #region ### START Koda GUI section ### Form=
    $MouseMove = GUICreate("MouseMove", 227, 124, 461, 286)
    GUISetBkColor(0x9DB9EB)

    [/autoit] [autoit][/autoit] [autoit]

    $Done = GUICtrlCreateButton("Done", 16, 14, 75, 25)
    $Info = GUICtrlCreateButton("Info", 16, 78, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    $PressedKey = GUICtrlCreateCombo("", 104, 16, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
    GUICtrlSetData(-1, "M1|M2|M3|Shift|CTRL|W|A|S|D|Up|Down|Left|Right|Combo WASD|Combo ARROW")
    GUICtrlSendMsg($PressedKey, 0x1703, 0, "Function")

    [/autoit] [autoit][/autoit] [autoit]

    $PosDir = GUICtrlCreateCombo("", 104, 48, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
    GUICtrlSetData(-1, "Up|Down|Left|Right|Combo")
    GUICtrlSendMsg($PosDir, 0x1703, 0, "Direction")

    [/autoit] [autoit][/autoit] [autoit]

    $Far = GUICtrlCreateCombo("", 104, 80, 105, 25, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_SIMPLE))
    GUICtrlSetData(-1, "1|2|5|10|25|50|75|100|150|250|350|500|750|1000|2000|5000|")
    GUICtrlSendMsg($Far, 0x1703, 0, "Distance")

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    GUICtrlSetOnEvent($Done, "_Done")
    GUICtrlSetOnEvent($Info, "_Info")

    [/autoit] [autoit][/autoit] [autoit]

    Global $WKey, $AKey, $SKey, $DKey, $UpKey, $DownKey, $LeftKey, $RightKey, $xKey, $Key, $Dir, $pos, $x, $y, $DLL = DllOpen("user32.dll")
    Global $iSpeed = 0 ; <- Mausgeschwindigkeit von 1 bis 100 (Standard ist 10), 0 = Maus sofort bewegen
    Global $iTimer ; <- wenn $iSpeed = 0, dann den zusätzlichen Timer benutzen, sonst wird die Mausbewegung zu schnell

    [/autoit] [autoit][/autoit] [autoit]

    While 1

    $iTimer = TimerInit()
    Do
    Until TimerDiff($iTimer) > 3 ; <- hier (3) die Geschwindigkeit anpassen, wenn $iSpeed = 0, ansonsten auskommentieren

    If _IsPressed($xKey, $DLL) Then
    $pos = MouseGetPos()
    If $Dir = "Up" Or $Dir = "Left" Then
    MouseMove($pos[0] - $x, $pos[1] - $y, $iSpeed)
    EndIf
    If $Dir = "Down" Or $Dir = "Right" Then
    MouseMove($pos[0] + $x, $pos[1] + $y, $iSpeed)
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed($WKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] - $y, $iSpeed)
    EndIf
    If _IsPressed($AKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] - $x, $pos[1], $iSpeed)
    EndIf
    If _IsPressed($SKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] + $y, $iSpeed)
    EndIf
    If _IsPressed($DKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] + $x, $pos[1], $iSpeed)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed($UpKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] - $y, $iSpeed)
    EndIf
    If _IsPressed($LeftKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] - $x, $pos[1], $iSpeed)
    EndIf
    If _IsPressed($DownKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0], $pos[1] + $y, $iSpeed)
    EndIf
    If _IsPressed($RightKey, $DLL) Then
    $pos = MouseGetPos()
    MouseMove($pos[0] + $x, $pos[1], $iSpeed)
    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Done()
    If GUICtrlRead($Done) = "Done" Then
    If GUICtrlRead($PressedKey) = "" Or GUICtrlRead($PosDir) = "" Or GUICtrlRead($Far) = "" Then
    MsgBox(0, "error", "First: Setup" & @CRLF & "Then: Done")
    Else
    $Key = GUICtrlRead($PressedKey)
    $Dir = GUICtrlRead($PosDir)
    $Farcheck = GUICtrlRead($Far)
    GUICtrlSetData($Done, "Reset")

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "M1" Then $xKey = 01
    If $Key = "M2" Then $xKey = 02
    If $Key = "M3" Then $xKey = 04
    If $Key = "Shift" Then $xKey = 10
    If $Key = "CTRL" Then $xKey = 11

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "W" Then $xKey = 57
    If $Key = "A" Then $xKey = 41
    If $Key = "S" Then $xKey = 53
    If $Key = "D" Then $xKey = 44

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Up" Then $xKey = 26
    If $Key = "Down" Then $xKey = 28
    If $Key = "Left" Then $xKey = 25
    If $Key = "Right" Then $xKey = 27

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Combo WASD" Then
    $WKey = 57
    $AKey = 41
    $SKey = 53
    $DKey = 44
    GUICtrlSetData($PosDir, "Combo")
    $Dir = "ALL"
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $Key = "Combo ARROW" Then
    $UpKey = 26
    $DownKey = 28
    $LeftKey = 25
    $RightKey = 27
    GUICtrlSetData($PosDir, "Combo")
    $Dir = "ALL"
    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If $Dir = "Up" Or $Dir = "Down" Then $y = $Farcheck
    If $Dir = "Left" Or $Dir = "Right" Then $x = $Farcheck

    [/autoit] [autoit][/autoit] [autoit]

    If $Dir = "ALL" Then
    $x = $Farcheck
    $y = $Farcheck
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetState($PosDir, $GUI_DISABLE)
    GUICtrlSetState($PressedKey, $GUI_DISABLE)
    GUICtrlSetState($Far, $GUI_DISABLE)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ MsgBox(0,"",$WKey&"=W "&$AKey&"=A "&$SKey&"=S "&$DKey&"=D "&$UpKey&"=up "&$DownKey&"=down "&$LeftKey&"=left "&$RightKey&"=right "&$xKey&"=xkey "&$Key&"=key "&$Dir&"=dir "&$x&"=x "&$y&"=y "&$Farcheck&"=FC")
    EndIf
    Else
    $x = ""
    $y = ""
    $Key = ""
    $WKey = ""
    $AKey = ""
    $SKey = ""
    $DKey = ""
    $UpKey = ""
    $DownKey = ""
    $LeftKey = ""
    $RightKey = ""
    $Dir = ""
    $xKey = ""
    $Farcheck = ""
    GUICtrlSetData($Done, "Done")
    GUICtrlSetData($PressedKey, "")
    GUICtrlSetData($PressedKey, "M1|M2|M3|Shift|CTRL|W|A|S|D|Up|Down|Left|Right|Combo WASD|Combo ARROW")
    GUICtrlSetData($PosDir, "")
    GUICtrlSetData($PosDir, "Up|Down|Left|Right|Combo")
    GUICtrlSetData($Far, "")
    GUICtrlSetData($Far, "1|2|5|10|25|50|75|100|150|250|350|500|750|1000|2000|5000|")
    GUICtrlSetState($PosDir, $GUI_ENABLE)
    GUICtrlSetState($PressedKey, $GUI_ENABLE)
    GUICtrlSetState($Far, $GUI_ENABLE)
    EndIf
    EndFunc ;==>_Done

    [/autoit] [autoit][/autoit] [autoit]

    Func _Info()
    MsgBox(0, "MouseMove", "Coded by ThirtySix")
    EndFunc ;==>_Info

    [/autoit] [autoit][/autoit] [autoit]

    Func _Exit()
    DllClose($DLL)
    Exit
    EndFunc ;==>_Exit

    [/autoit]
  • Super :thumbup:
    beide varianten funktionieren... aber ich entscheide mich für die von Xeno.
    Diese erscheint mir leichter. :p

    Ihr seid klasse!
    wäre ich nie drauf gekommen.

    Vielen Dank :rolleyes:

    // EDIT:

    Eins A, mit der variante von Xeno konnte ich es fertigstellen.
    Aber auch Oscar bekommt einen.... Keks! :rolleyes:
    Danke euch.

    Nun kann ich in Paint gerade striche mit der Tastatur ziehen!!! :D
    unter anderem.. HAHA!

    Wer Rechtschreibfehler findet darf sie behalten. :D

    2 Mal editiert, zuletzt von ThirtySix (26. Juli 2013 um 17:34)


  • Du könntes noch bitte das Präfix deines Themas auf [gelöst] setzen. Und das nächste mal wähle doch eine informative Überschrift und nicht einen mysteriösen Buchtitel...


    Hast ja recht ... :S

    Wer Rechtschreibfehler findet darf sie behalten. :D