title: Suspend AHK script
body: <p>I'm writing a script for AHK which automate few things in my MMORPG game.
  I want to perform 2 different automation when F2 or F3 is pressed.</p>
  
  <p>Sometimes this script is with interaction with another action from keyboard/mouse so I need to suspend script when one of the following keys is pressed: 2,3,4,5,E,R</p>
  
  <p>But when I press 1 the script need to be unsuspended.</p>
  
  <p>I was trying many different options but I can't write it. I can't even google anything similiar. </p>
  
  <p>My code looks like that:</p>
  
  <pre><code>  key_a:="F2"
  key_b:="F3"
  
  loop {
  sleep 1
  
  if GetKeyState(key_a) {
      a:=true
      b:=false
  }
  
  if GetKeyState(key_b) {
      a:=false
      b:=true
  }
  
  if a {
      MsgBox, Do something
  }
  
  if b {
      MsgBox, Do somethiung else
  }
  }
  </code></pre>
  
  <p>This script language is bit strange for me.</p>
  
  <p>Can you help me.
  Thanks</p>