AutoMenu
Sets up a reusable menu trap. Works the same as WaitMenu, but the hook is persistent — it triggers every time a matching menu appears, until explicitly removed via CancelMenu.
When an incoming menu’s caption contains MenuCaption and the menu has an element containing ElementCaption, that element is automatically selected.
To set a one-time trap, use WaitMenu instead. To remove all menu hooks, use CancelMenu.
Устанавливает многоразовую ловушку на меню. Работает так же, как WaitMenu, но хук постоянный — он срабатывает каждый раз при появлении подходящего меню, пока не будет явно удалён через CancelMenu.
Когда заголовок входящего меню содержит MenuCaption, а в меню есть элемент, содержащий ElementCaption, этот элемент выбирается автоматически.
Для одноразовой ловушки используйте WaitMenu. Для удаления всех хуков используйте CancelMenu.
procedure AutoMenu(MenuCaption: String; ElementCaption: String);
Parameters:
- MenuCaption — substring to match against the menu title.
- ElementCaption — substring to match against a menu element to auto-select.
def AutoMenu(MenuCaption: str, ElementCaption: str) -> None: ...
begin
CancelMenu; // clear any existing hooks
AutoMenu('Tracking', 'Animals');
UseSkill('Tracking');
end.
CancelMenu()
AutoMenu('Tracking', 'Animals')
UseSkill('Tracking')