#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.16.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include ; Variable to control the loop Global $loopActive = False ; Set up hotkeys HotKeySet("{F1}", "ToggleLoop") HotKeySet("{p}", "StopScript") While 1 Sleep(100) ; Keep the script running WEnd Func ToggleLoop() Send("{F1}") $loopActive = Not $loopActive Send("{Enter}") Sleep(6000) Send("{LSHIFT}") ; Press LSHIFT once ; Hold 'w' key for 50 seconds $endTime = TimerInit() + 50000 While TimerDiff($endTime) < 0 And $loopActive Send("{w down}") Sleep(50) Send("{w up}") WEnd Sleep(2500) Send("x") Sleep(250) Send("{ENTER}") Sleep(6000) EndFunc Func StopScript() $loopActive = False EndFunc