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.
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
But when I press 1 the script need to be unsuspended.
I was trying many different options but I can't write it. I can't even google anything similiar.
My code looks like that:
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
}
}
This script language is bit strange for me.
Can you help me. Thanks