sorry for the delay... didn't get as much computer time as I hoped this weekend but...
the code I use to manage my AHK script and suspend during chat is...
This section is near the top and works regardless of the forground application... it ensures that I can suspend the script in the event of a crazy loop and can also edit or restart it in the suspended state.
[code:1]
; CTRL+ALT+p - toggle suspend manually
^!p::
Suspend, Permit
Suspend
return
; CTRL+ALT+o - reload script even if suspended
^!o::
Suspend, Permit
Reload
return
; CTRL+ALT+' - edit the script even if suspended
^!'::
Suspend, Permit
Edit
return
[/code:1]
This code explicitly sets the suspend state after checking the current state... it displays a small window with a suspend notification picture to show it is suspended.
[code:1]
;*** Gui Notifications ***
; set up the dialog which will be displayed when scrip is suspended
Gui, Add,Picture,w100 h-1 ,C:\scripts\resources\suspended.png
;*** Chat Functions ***
; in order to show the suspended dialog this explicitly sets the suspend state
~/::
~Enter::
Suspend, Permit
if (A_IsSuspended = 1) {
Suspend, off
Gui, Show, Hide
} else {
Suspend, on
Gui, Show, W100 H100 X1390 Y10
WinActivate, ahk_id %idMain%
}
return
[/code:1]
instead of the above code, if you don't want a gui window displaying just use
[code:1]
~/::
~Enter::
Suspend, toggle
return
[/code:1]
I find that my logging into the game (pressing enter) takes me into suspended state so I have a [code:1]Suspend, off [/code:1] command immediately after this routine.
Connect With Us