Can someone help me to solve this problem?
Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance force
global first_notice := false
global second_notice := false
first_notice_msg := "/m [P.R.F] PLEASE, WE REQUEST YOUR COLLABORATION FOR A QUICK INSPECTION. Use /RENDER"
second_notice_msg := "/m [P.R.F] MANDATORY APPROACH. STOP AND EXIT THE VEHICLE AND USE /RENDER"
third_notice_msg := "/m [P.R.F] STOP IMMEDIATELY OR YOU WILL BE PUNISHED FOR DOP AND ESCAPE. LAST WARNING"
SendNotice(notice) {
SendText(notice)
Sleep 50
Send "{Enter}"
Sleep 2500
}
ResetNotices() {
global first_notice
global second_notice
first_notice := false
second_notice := false
}
NumpadDot & Numpad1:: {
global first_notice
global second_notice
if (first_notice) {
SendNotice(first_notice_msg)
first_notice := false
return
} else if (second_notice) {
SendNotice(second_notice_msg)
second_notice := false
} else {
ResetNotices()
SendNotice(third_notice_msg)
ResetNotices()
return
}
}