Commodo
NGBler
- Registriert
- 17 Mai 2014
- Beiträge
- 151
Mein Skript bisher, Beispielcode von der Autohotkey-Webseite für eine Taste zum starten/stoppen innerhalb eines Loops.
Funktioniert auch soweit, ich weiss nur noch nicht wie ich 'c' dazu bringen kann das Skript zu starten/stoppen.
Konkret soll mein Skript folgendes tun:
'c' schaltet das Skript an oder aus.
Linke Maustaste drücken oder gedrückt halten = Loop starten
Loop, in dem die linke Maustaste unendlich oft gedrückt wird + Maus zurück in die Bildschirmmitte.
Linke Maustaste nochmal drücken = Loop stoppen
Funktioniert auch soweit, ich weiss nur noch nicht wie ich 'c' dazu bringen kann das Skript zu starten/stoppen.
Konkret soll mein Skript folgendes tun:
'c' schaltet das Skript an oder aus.
Linke Maustaste drücken oder gedrückt halten = Loop starten
Loop, in dem die linke Maustaste unendlich oft gedrückt wird + Maus zurück in die Bildschirmmitte.
Linke Maustaste nochmal drücken = Loop stoppen
;#IfWinActive ahk_class Planetside2 PlayClient (Live) x64
#NoEnv
x := (A_ScreenWidth // 2)
y := (A_ScreenHeight // 2)
mousemove, x, y
~$*LButton:: ;This makes the hotkey, so Lbutton triggers the script
Loop ;loop the script until broken
{ ;loop start
GetKeyState, var, LButton, P ;Get the state of Lbutton
If var = U ;has it been released?
Break ;its been released so break the loop
Send {LButton} ;It hasnt been released so send another Click
MouseMove, (A_ScreenWidth // 2), (A_ScreenHeight // 2)
sleep 0 ; This is the time between presses, after its slept it will return to the top of the loop and start
} ;loop end
Zuletzt bearbeitet: