Something for everyone to consider when using hotkeys. Since onhotkey isn't latched, it's easy to miss the key. People originally reported in the CLAw that it would take quite a bit of time for the script to react to keyboard selections. My solution was to build a function that would just set flags and allow the script to handle a successful keypress later. So I had a function:
;-------------------------------------------------------------------------------
sub CheckHotKey
menu get EUOEditKey1
onhotkey #MENURES ALT
set %targetkey #TRUE
menu get EUOEditKey2
onhotkey #MENURES ALT
set %lootarea #TRUE
return
And then I could pepper the code with "gosub CheckHotKey" to scan and capture at a higher rate. Then you just look at the variables %targetkey and %lootarea to make the call that a key has been pressed.
To get onhotkey to be response, I'd just do this:
gosub HandleItemLoggingToHistory
gosub CheckHotKey
gosub VerifyLootCheckmarks
gosub CheckHotKey
gosub ManageIgnoreList
gosub CheckHotKey
gosub HandleExternalInterface
gosub CheckHotKey
No more hotkey lag complaints....
