title: End continuous loop and restart script with same hotkey - AutoHotkey
body: <p>I have this script below. It has a continuous loop in it. </p>
  
  <p>I want to be able to: <strong>press the hotkey again (ie F4) and for the continuous loop to end, and for the script to restart</strong>. </p>
  
  <p>I've tried using #MaxThreadsPerHotkey but have not had much luck. Anyone's help would be much appreciated. Thanks!</p>
  
  <pre><code>#MaxThreadsPerHotkey 10
  F4::
  Send, z
  Sleep, 100
  Send, ^{Left}
  Loop,
  {
  Sleep, 30000
  WinActivate, ahk_exe PotPlayerMini64.exe
  Send, z
  SoundBeep
  }
  Return
  </code></pre>