MousePos für klicks????

  • es gibt ja den Befehl MousePos, der angibt wo sich der zeiger grade befindet.
    Gibt es auch einen, oder irgend was das ausgibt ob grade gedrückt ist ????

    Einmal editiert, zuletzt von TheLol (21. April 2008 um 20:06)

  • wie müsste dan so was ausehen?

    [autoit]


    _IsPressed("01")
    Func _IsPressed("01")
    MsgBox (0,"TEST","angekommen")
    EndFunc

    [/autoit][autoit][/autoit][autoit][/autoit]
  • Wenn du überprüfen willst, ob eine taste gedrückt wurde dann brauchst du eine schleife.

    [autoit]

    #include <misc.au3>

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

    while 1
    If _IsPressed("01") Then _pressed()
    sleep(100)
    WEnd

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

    Func _pressed()
    MsgBox (0,"TEST","angekommen")
    EndFunc

    [/autoit]

    // sorry :P

  • [autoit]

    #include<Misc.au3> ; Wars glaub ich
    While 1
    If _IsPressed('01') Then MsgBox(0,"","Links gedrückt")
    WEnd

    [/autoit]


    // Och nee :P

  • Ich hab mal ne kleine Spielerei gebastelt^^, jetzt kann man was in paint malen, und es dan weider nach malen lassen xD.

    Spoiler anzeigen
    [autoit]


    #include <misc.au3>
    $VorFrage = InputBox("Achtung", "Wie lange soll aufgezeichnet werden?")

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

    For $i = $VorFrage To 1 Step -1
    Sleep(10)
    If _IsPressed("01") Then
    IniWrite("cords.ini", "" & $i & "", "maus", "1")
    EndIf
    If _IsPressed("02") Then
    IniWrite("cords.ini", "" & $i & "", "maus", "2")
    EndIf
    $pos = MouseGetPos()
    IniWrite("cords.ini", "" & $i & "", "pos 0", "" & $pos[0] & "")
    IniWrite("cords.ini", "" & $i & "", "pos 1", "" & $pos[1] & "")
    TrayTip("Hinweis", "" & $i & "/" & $VorFrage & "", 1)
    Next
    MouseUp("left")
    If Not IsDeclared("iMsgBoxAnswer") Then Local $iMsgBoxAnswer
    $iMsgBoxAnswer = MsgBox(36, "Achtung", "Soll die aufzeichnung wieder ausgegeben werden?")
    Select
    Case $iMsgBoxAnswer = 6 ;Yes
    _ausgabe()
    Case $iMsgBoxAnswer = 7 ;No
    Exit
    EndSelect

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

    Func _ausgabe()
    For $i = $VorFrage To 1 Step -1
    $pos = MouseGetPos()
    If IniRead("cords.ini", "" & $i & "", "maus", "") = 1 Then
    MouseDown("left")
    EndIf
    If IniRead("cords.ini", "" & $i & "", "maus", "") = 2 Then
    MouseDown("right")
    EndIf
    $pos1 = IniRead("cords.ini", "" & $i & "", "pos 0", "")
    $pos2 = IniRead("cords.ini", "" & $i & "", "pos 1", "")
    MouseMove($pos1, $pos2, 1)
    MouseUp("left")
    TrayTip("Hinweis", "" & $i & "/" & $VorFrage & "", 1)
    Next
    MouseUp("left")
    MsgBox(0, "Hinweis", "fertig")
    EndFunc ;==>_ausgabe

    [/autoit] [autoit][/autoit] [autoit][/autoit]
  • Ich habs noch nen bissel verbessert^^. Aber jetzt erkennts nicht immer so gut ob gedrückt ist, bzw. gibt es schlecht wieder

    Spoiler anzeigen
    [autoit]


    HotKeySet("!a", "_abbruch")

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

    Func _abbruch()
    Exit
    EndFunc ;==>_abbruch

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

    #include <misc.au3>
    #include <GUIConstants.au3>

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

    $i = 0
    $iIn = 0
    $WarteZeit = 1000

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Maus-Logger", 203, 187, 193, 125)
    $Label1 = GUICtrlCreateLabel("Wie lange soll aufgezeichnet werden?", 8, 0, 184, 17)
    $Radio1 = GUICtrlCreateRadio("1 Minute", 8, 16, 73, 17)
    $Radio2 = GUICtrlCreateRadio("2 Minuten", 8, 40, 73, 17)
    $Radio3 = GUICtrlCreateRadio("5 Minuten", 8, 64, 73, 17)
    $Radio4 = GUICtrlCreateRadio("10 Minuten", 8, 88, 73, 17)
    $Radio5 = GUICtrlCreateRadio("Unendlich", 8, 112, 73, 17)
    $Button1 = GUICtrlCreateButton("Starte aufzeichnen", 96, 24, 99, 25, 0)
    $Button2 = GUICtrlCreateButton("Starte ausgabe", 96, 64, 99, 25, 0)
    $Button3 = GUICtrlCreateButton("Öffne Log-Datei", 96, 104, 99, 25, 0)
    $Input1 = GUICtrlCreateInput("", 128, 136, 33, 21)
    $Label2 = GUICtrlCreateLabel("Warte-Zeit bis start:", 8, 138, 117, 17)
    $Label3 = GUICtrlCreateLabel("sec.", 174, 138, 23, 17)
    $MenuItem1 = GUICtrlCreateMenu("Menu")
    $MenuItem2 = GUICtrlCreateMenuItem("Optionen", $MenuItem1)
    $MenuItem3 = GUICtrlCreateMenuItem("Exit", $MenuItem1)
    $MenuItem4 = GUICtrlCreateMenu("Hilfe")
    $MenuItem5 = GUICtrlCreateMenuItem("Credits", $MenuItem4)
    $MenuItem6 = GUICtrlCreateMenuItem("Hilfe", $MenuItem4)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    _vorauslesen()
    Case $Button2
    _ausgabe()

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

    EndSwitch
    WEnd

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

    Func _vorauslesen()
    $WarteZeit = GUICtrlRead ($Input1) * 1000
    If GUICtrlRead($Radio1) = $GUI_CHECKED Then
    $iIn = 1000
    ElseIf GUICtrlRead($Radio2) = $GUI_CHECKED Then
    $iIn = 1000 * 2
    ElseIf GUICtrlRead($Radio3) = $GUI_CHECKED Then
    $iIn = 1000 * 5
    ElseIf GUICtrlRead($Radio1) = $GUI_CHECKED Then
    $iIn = 1000 * 10
    ElseIf GUICtrlRead($Radio1) = $GUI_CHECKED Then
    $iIn = 1000 * 99999999
    Else
    MsgBox (0,"Achtung","Bitte Länge der Aufzeichnung wählen!!!")
    EndIf
    _startAuslesen()
    EndFunc

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

    Func _startAuslesen()
    Sleep ($WarteZeit)
    For $i = $iIn To 1 Step -1
    Sleep(10)
    If _IsPressed("01") Then
    IniWrite("cords.ini", "" & $i & "", "maus", "1")
    EndIf
    $pos = MouseGetPos()
    IniWrite("cords.ini", "" & $i & "", "pos 0", "" & $pos[0] & "")
    IniWrite("cords.ini", "" & $i & "", "pos 1", "" & $pos[1] & "")
    TrayTip("Hinweis", "Noch: " & $i & "/" & $iIn & " Log´s", 1)
    Next
    MouseUp("left")
    MsgBox(0, "Hinweis", "fertig")
    EndFunc

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

    Func _ausgabe()
    Sleep($WarteZeit)
    For $i = $iIn To 1 Step -1
    $pos = MouseGetPos()
    If IniRead("cords.ini", "" & $i & "", "maus", "") = 1 Then
    MouseDown("left")
    EndIf
    $pos1 = IniRead("cords.ini", "" & $i & "", "pos 0", "")
    $pos2 = IniRead("cords.ini", "" & $i & "", "pos 1", "")
    MouseMove($pos1, $pos2, 1)
    MouseUp("left")
    TrayTip("Hinweis", "Noch: " & $i & "/" & $iIn & " Log´s", 1)
    Next
    MouseUp("left")
    MouseUp("right")
    MsgBox(0, "Hinweis", "fertig")
    EndFunc ;==>_ausgabe

    [/autoit]