#include #include #include #include ; Variable to control the loop Global $loopActive = False ; Set up hotkeys HotKeySet("{F1}", "ToggleLoop") HotKeySet("{F2}", "StopScript") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 254, 232, 192, 114) Global $Edit1 = GUICtrlCreateEdit("", 2, 0, 247, 229) GUICtrlSetData(-1, "Edit1") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Write($txt) GUICtrlSetData ($Edit1,@HOUR & ":" & @MIN & ":" & @SEC & "> " & $txt & @CRLF,0) EndFunc Func ToggleLoop() Write("F1") $loopActive = Not $loopActive Send("{Enter}") Write("Enter") Sleep(6000) Write("Sleep for 6000ms") Send("{LSHIFT}") ; Press LSHIFT once Write("Shift") ; Hold 'w' key for 50 seconds     $endTime = TimerInit() + 50000     While TimerDiff($endTime) < 0 And $loopActive         Send("{w down}") Send("{w}")         Write("W")     WEnd Send("{w up}") Sleep(2500) Send("x") Write("x") Sleep(250) Send("{ENTER}") Write("Enter_2") Sleep(6000) EndFunc Func StopScript() $loopActive = False Write("! Stop !") EndFunc