как установить hercules на линукс
Установка и настройка Геркулеса версии 2.16.5-3.01 (CygWin) под Windows
Часть вторая. Геркулес. Как я уже писал выше, Геркулес – программа, портированная из Линукс. Поэтому, если есть желание, можно скачать только исходные коды, установить CygWin в крнфигурации, достаточной для работы компиляторов, и самостоятельно оттранслировать его. Я не буду рассматривать такой вариант – как это сделать, подробно рассказывается на сайте ответственного за поддержку Геркулеса на Win32- CygWin платформе (http://www.bsp-gmbh.com/hercules/herc_w32_2.html) Дальше я буду исходить из соображения, что пользователь скачал с официального сайта http://www.conmicro.cx/hercules/ готовые исполняемые коды для Windows.
На этом этапе нужно правильно выбрать исполняемый файл для скачивания в зависимости от поколения Вашего процессора – либо для Pentium IV, либо для младших моделей. Если у Вас процессор AMD, то могут быть проблемы, поэтому Вам лучше самому оттранслировать исходные тексты.
Кроме того, есть две модели реализации потоков в приложениях – fthread и pthread. Первая – более быстрая, поэтому лучше начинать с нее, но известны случаи, когда быстрые fthread-ы не работают. В таких, крайне немногочисленных случаях, надо брать pthread. У меня на сайте – файлы для fthread и для Pentium IV.
Итак, файл выбран и скачан. При запуске исполняемого файла он попросит каталог для распаковки, по умолчанию он предлагает C: cygwin. При распаковке воспроизводится структура подкаталогов – всякие bin, lib и прочие. Такая структура удобна для тех пользователей, которые устанавливают CygWin в «солидной» комплектации и хотят видеть Геркулес там, где он находится в Линукс. Мы договорились, что нам это не нужно. Поэтому я рекомендую распаковать Геркулес в промежуточный каталог, а потом все исполнимые части собрать вместе (я собираю все в каталог c: Hercules. xxxx, где хххх – номер версии). Туда же я помещаю http-каталог – но это просто мой способ, у Вас он может быть другой. Именно так у меня все собрано в сборках, которые лежат на сайте. И в этот же каталог я копирую необходимый минимальный набор библиотек от CygWin-а.
Часть третья. Конфигурационный файл. Подробно о том, что какой параметр означает, написано в документации Геркулеса. Я только добавлю некоторые моменты:
Часть четвертая. Сетевая поддержка. С Геркулесом, как известно, можно работать двумя способами – через его, Геркулесовский, TN3270-сервер и через моделируемый сетевой адаптер. В первом случае специальная Геркулесовская программа моделирует локальное УУ для терминалов типа 3270 путем создания TN3270-сервера. Это значит, что Вы заходите на машину с Геркулесом по сети (или с этой же самой машины) на специально указанный порт (по умолчанию – 3270, параметр CNSLPORT конфигурационного файла) любым TN3270-клиентом, а мэйнфреймовская ОС видит Вас как старый добрый локальный 3270-совместимый терминал. Это особенно удобно при работе со старыми ОС, которые ни слухом, ни духом не знают ничего о протоколе TCP/IP, и это самый простой способ работы. В этом случае от Вас ничего не надо – только правильно указать нестандартный порт при конфигурировании клиента. Недостатком такого метода можно считать его (метода) неторопливость при передаче файлов с использовании компоненты IBM PC File Transfer (модуль IND$ FILE) и то, что для многих ОС (ну для того же мэйнфреймовского Линукса) является крайне желательным наличие TCP/IP-протокола. В этом, втором, случае, нужно сделать следующее:
0010 3088 CTCI-W32 192.1.2.250 192.1.2.1 1024 64
0011 3088 CTCI-W32 192.1.2.250 192.1.2.1 1024 64
для версии 3 этот же фрагмент будет выглядеть
0010.2 3088 CTCI-W32 192.1.2.250 192.1.2.1 1024 64
Вот теперь можете работать с Геркулесом как с нормальным TCP/ IP узлом, но если вы планируете входить на мэйнфрейм по TCP/ IP с других машин сети, то ПЭВМ с Геркулесом должна поддерживать маршрутизацию. Если у Вас что-то не получается – смотрите книжки по Windows. Более подробно все вопросы реализации TCP/ IP для Геркулеса рассмотрены на страничках разработчиков и часто обсуждаются в профильной конференции.
Часть пятая. Откуда грузится и с чем работать – диски и ленты. Естественно, главный вопрос для начинающего – где взять систему на Геркулесовских дисках. Вариантов несколько.
Первый вариант – взять готовые образы загрузочных лент или дисков у того, у кого они есть. Юридические, финансовые и технические сложности – на совести дающего. Я этот вариант не обсуждаю – тут все понятно.
Второй вариант – взять готовые диски и ленты от IS/390, либо PC/390, либо PC/370. Таких дисков в свое время много появлялось у мэйнфреймщиков, поищите, может, и у Вас есть.
Третий вариант – изготовить образы самому, имея систему на мэйнфрейме. Технологий существует несколько. Например, в состав самого Геркулеса входит программа cckddump.hla для OS/390 (делает из физического диска сжатый AWS-файл), либо программы rawstape.jcl и tapeconv.jcl для работы с лентами. Я в VM делаю DDR-образы, которые перекачиваю в Геркулес и там раскрываю на диски, используя программу DDR2 CMSX со странички загрузок от IBM. А для мэйнфреймовского Линукса готовые ленты для загрузки поставляются в составе дистрибутива.
Так что готового рецепта не предложу, но обилие вариантов показывает, что данная проблема решается. Ищите – и обрящете.
Часть шестая, и последняя. TN3270-клиент. Эта часть самая короткая. Работая в Windows, самым большим, «тяжелым» и качественным является знаменитый IBM Personal Communication разных версий. Для 32-разрядных систем рекомендую версии 4.3 и последнюю на момент написания статьи 5.71. Существуют и альтернативные, платные и бесплатные версии похожих продуктов. По моему личному мнению наилучшими являются Mocha3270, QWS3270 и SDI TN3270. Качайте, решайте вопрос с лицензионными ключами и используйте. Либо просто купите – все они стоят недорого.
Все. Теперь Вы знаете достаточно, чтобы начать работать. Если что-то не получается – читайте документацию. Если все равно не получается – сходите в Интернет. Получится обязательно.
Hercules Version 3: Installation and Operation
Contents
Installation Procedure
Installing pre-built binaries for Mac OS X:
Installing pre-built binaries for Windows:
Configuration Procedure
You will need to amend the configuration file hercules.cnf to reflect your device layout and intended mode of operation (S/370, ESA/390, or z/Architecture). See the Hercules Configuration File page for a complete description.
Creating DASD volumes
The Creating Hercules DASD page describes various methods of creating and loading virtual DASD volumes. The compressed CKD DASD support is described in this page.
Operating Procedure
Note: If you intend to run any licensed software on your PC using Hercules, it is your responsibility to ensure that you do not violate the software vendor’s licensing terms.
Starting Hercules
To start Hercules enter this command at the Unix or Windows command prompt:
is the name of the configuration file. The default, if none is specified, is hercules.cnf. The default may be overridden via the HERCULES_CNF environment variable.
specifies that Hercules is to be run in ‘daemon’ mode, wherein it runs invisibly with no attached console.
is the directory from which dynamic modules are to be loaded. The default depends on the host platform on which Hercules is being run. This option overrides the default.
is an optional log file which will receive a copy of all messages displayed on the control panel
Next connect a tn3270 client to the console port (normally port 3270). The client will be connected to the first 3270 device address specified in the configuration file (this should be the master console address). If your master console is a 1052 or 3215, connect a telnet client instead of a tn3270 client.
Now you can enter an ipl command from the control panel.
Using the keyboard
The main Hercules screen contains a scrollable list of messages with a command input area and system status line at the bottom of the screen.
To scroll through the messages, use either the Page Up or Page Down keys, the Ctrl + Up Arrow or Ctrl + Down Arrow keys, or the Home or End and/or the Ctrl + Home or Ctrl + End keys.
Important messages are highlighted in a different color (usually red) and are prevented from being scrolled off the screen for two minutes. If Extended Cursor handling is available then important messages currently at the top of the screen can be removed early by moving the cursor to the line containing the message and then pressing enter.
Use the Insert key to switch between insert and overlay mode when typing in the command input area. Use the Home and End keys to move to the first or last character of the command you are typing, or the use the left/right arrow keys to move to a specific character. Use the Escape key to erase the input area.
Pressing Escape when the command input area is already empty causes the screen to switch to the semi-graphical «New Panel» display mode, which shows the overall status of the system and devices.
When in the semi-graphical «New Panel» display mode there is no command input area. Instead, single character «hot keys» are used to issue some of the more common functions such as starting or stopping the CPU. The hot-keys are those which are highlighted. Pressing the ‘?’ key displays brief help information on how to use the semi-graphical panel.
Normal cursor handling | |
---|---|
Key | Action |
Esc | Erases the contents of the command input area. If the command input area is already empty, switches to semi-graphical New Panel. |
Del | Deletes the character at the cursor position. |
Backspace | Erases the previous character. |
Insert | Toggles between insert mode and overlay mode. |
Tab | Attempts to complete the partial file name at the cursor position in the command input area. If more than one possible file exists, a list of matching file names is displayed. |
Home | Moves the cursor to the start of the input in the command input area. If the command input area is empty, scrolls the message area to the top. |
End | Moves the cursor to the end of the input in the command input area. If the command input area is empty, scrolls the message area to the bottom. |
Page Up | Scrolls the message area up one screen. |
Page Down | Scrolls the message area down one screen. |
Up arrow | Recalls previous command into the input area. |
Down arrow | Recalls next command into the input area. |
Right arrow | Moves cursor to next character of input area. |
Left arrow | Moves cursor to previous character of input area. |
Ctrl + Up arrow | Scrolls the message area up one line. |
Ctrl + Down arrow | Scrolls the message area down one line. |
Ctrl + Home | Scrolls the message area to the top. |
Ctrl + End | Scrolls the message area to the bottom. |
The following additional keyboard functions are effective when the Hercules Extended Cursor Handling feature (OPTION_EXTCURS) is activated at compile time. At present, this feature is activated on the Windows platform only.
Extended cursor handling | |
---|---|
Key | Action |
Alt + Up arrow | Moves cursor up one row. |
Alt + Down arrow | Moves cursor down one row. |
Alt + Right arrow | Moves cursor right one column. |
Alt + Left arrow | Moves cursor left one column. |
Tab | If cursor is outside the command input area, moves cursor to the start of the input in the command input area. Otherwise behaves as described in previous table. |
Home | If cursor is outside the command input area, moves cursor to the start of the input in the command input area. Otherwise behaves as described in previous table. |
End | If cursor is outside the command input area, moves cursor to the end of the input in the command input area. Otherwise behaves as described in previous table. |
Panel commands
The following is what is displayed on the Hercules harware console (HMC) in response to the ‘?’ command being entered. Please note that it may not be completely accurate or up-to-date. Please enter the ‘?’ command for yourself for a more complete, accurate and up-to-date list of supported panel commands.
The ipl command may also be used to perform a load from cdrom or server. For example if a standard SuSE S/390 Linux distribution CD is loaded and mounted on /cdrom for example, this cdrom may then be ipl-ed by: ipl /cdrom/suse.ins
The attach and detach commands are used to dynamically add or remove devices from the configuration, and the define command can be used to alter the device number of an existing device.
The devinit command can be used to reopen an existing device. The args (if specified) override the arguments specified in the configuration file for this device. The device type cannot be changed and must not be specified. This command can be used to rewind a tape, to mount a new tape or disk image file on an existing device, to load a new card deck into a reader, or to close and reopen a printer or punch device.
In single-step mode, pressing the enter key will advance to the next instruction.
Some commands also offer additional help information regarding their syntax, etc. Enter «help » to display this additional help information. (Note: not every command supports help)
When a command is prefixed with ‘-‘, the the command will not be redisplayed at the console. This can be used in scripts and is also used internally when commands are to be invoked without being redisplayed at the panel.
The hercules.rc (run-commands) file
Hercules also supports the ability to automatically execute panel commands upon startup via the ‘run-commands’ file. If the run-commands file is found to exist when Hercules starts, each line contained within it is read and interpreted as a panel command exactly as if the command were entered from the HMC system console.
The default filename for the run-commands file is «hercules.rc», but may be overridden by setting the «HERCULES_RC» environment variable to the desired filename.
Lines starting with ‘#‘ are treated as «silent comments» and are thus not logged to the console. Line starting with ‘*‘ however are treated as «loud comments» and will be logged.
In addition to being able to execute any valid panel command (including the ‘sh’ shell command) via the run-commands file, an additional ‘pause nnn‘ command is supported in order to introduce a brief delay before reading and processing the next line in the file. The value nnn can be any number from 1 to 999 and specifies the number of seconds to delay before reading the next line. Creative use of the run-commands file can completely automate Hercules startup.
The «Hercules Automatic Operator» (HAO) Facility
The Hercules Automatic Operator (HAO) feature is a facility which can automatically issue panel commands in response to specific messages appearing on the Hercules console.
To use the Hercules Automatic Operator facility, you first define a «rule» consisting of a «target» and an associated «command». The «target» is a regular expression pattern used to match against the text of the various messages that Hercules issues as it runs. Whenever a match is found, the rule «fires» and its associated command is automatically issued.
The Hercules Automatic Operator facility only operates on messages issued to the Hercules console. These messages may originate from Hercules itself, or from the guest operating system via the SCP SYSCONS interface or via the integrated console printer-keyboard (3215-C or 1052-C). HAO cannot intercept messages issued by the guest operating system to its own terminals.
Defining a Rule
To define a HAO rule, enter the command:
to define the rule’s «target» match pattern followed by the command:
to define the rule’s associated panel-command.
The target is a regular expression as defined by your host platform. When running on Linux, Hercules uses POSIX Extended Regular Expression syntax. On a Windows platform, regular expression support is provided by Perl Compatible Regular Expression (PCRE). The HAO facility can only be used if regular expression support was included in Hercules at build time.
The associated command is whatever valid Hercules panel command you wish to issue in response to a message being issued that matches the given target pattern.
Substituting substrings in the command
As an example, the rule below issues the command ‘i 001F’ in response to the message HHCTE014I 3270 device 001F client 127.0.0.1 connection reset:
Another example, shown below, illustrates how the dot matrix display of a 3480 tape unit might be used to implement an automatic tape library:
Other commands and limitations
To delete a fully or partially defined HAO rule, first use the ‘hao list’ command to list all of the defined (or partially defined) rules, and then use the ‘hao del nnn‘ command to delete the specific rule identified by nnn (all rules are assigned numbers as they are defined and are thus identified by their numeric value). Optionally, you can delete all defined or partially defined rules by issuing the command ‘hao clear’.
The current implementation limits the total number of defined rules to 64. This limit may be raised by increasing the value of the HAO_MAXRULE constant in hao.c and rebuilding Hercules.
All defined rules are checked for a match each time Hercules issues a message. There is no way to specify «stop processing subsequent rules». If a message is issued that matches two or more rules, each associated command is then issued in sequence.
Technical Support
For technical support, please see the Hercules Technical Support page.
Как установить hercules на линукс
Issues and pull requests:
Development and Community:
Hercules is a collaborative software development project revolving around the creation of a robust Massively Multiplayer Online Role-Playing Game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. Hercules is a continuation of the original Athena project.
Before installing Hercules, you will need to install certain tools and applications. This differs between the varying Operating Systems available, so the following list is broken down into Windows and Unix (incl. Linux) prerequisites.
For a list of supported platforms, please refer to the Supported Platforms wiki page.
Unix/Linux/BSD (names of packages may require specific version numbers on certain distributions)
Optional, useful tools
This section is a very brief set of installation instructions. For more concise guides relevant to your Operation System, please refer to the Wiki (links at the end of this file).
If you’re having problems with starting your server, the first thing you should do is check what’s happening on your consoles. More often than not, all support issues can be solved simply by looking at the error messages given.
Relax. This is just indicating that you’re using the default username and password. To fix this, check over the part in the installation instructions relevant to the login table.
If this shows up on the map server, it generally means that there is no Char Server available to accept the connection.
The following list of links point to various help files within the repository, articles or pages on the Wiki or topics within the Hercules forum.
Hercules IRC Channel: Network: irc.rizon.net Channel: #Hercules
Hercules has a large collection of help files and sample NPC scripts located in /doc/
It is recommended to look through /doc/script_commands.txt for help, pointers or even for ideas for your next NPC script. Most script commands have a usage example.
In-game, Game Masters have the ability to use Atcommands ( @ ) to control players, create items, spawn mobs, reload configuration files and even control the weather. For an in-depth explanation, please see /doc/atcommands.txt
The Hercules emulator has a permission system that enables certain groups of players to perform certain actions, or have access to certain visual enhancements or in-game activity. To see what permissions are available, they are detailed in /doc/permissions.md
There are more files in the /doc/ directory that will help you to create scripts or update the mapcache, or even explain how the job system and item bonuses work. Before posting a topic asking for help on the forums, we recommend that all users take the time to look over this directory.
Hercules Version 3: Installation and Operation
Contents
Installation Procedure
For building the MSVC version of Hercules on Windows (a version of Hercules that does not require Cygwin), Fish has instructions on his «MSVC Hercules Build Instructions» web page at http://www.softdevlabs.com/Hercules/hercules-msvc-build.html.
For building the Cygwin version of Hercules on Windows, Volker Bandke has instructions on his «Building Hercules for Windows» web page at http://www.bsp-gmbh.com/hercules/herc_w32_2.html.
Important: You must use at least version 2.95 of the gcc compiler and the glibc2 library. Refer to the Hercules Frequently-Asked Questions page for required compiler and other software levels.
Installing prebuilt RPMs:
This will leave the Hercules executables in /usr/bin and the dynamic libraries in /usr/lib and /usr/lib/hercules, where you can run them from anywhere. Sample configuration files will be placed in /etc/hercules, and the IPLable card deck for the ZZSA standalone utility will be placed in /var/share/hercules.
Installing Debian packages:
Installing on Gentoo Linux:
Installing on Mac OS X:
Installing on Windows (without Cygwin):
Installing on Windows with Cygwin:
Configuration Procedure
You will need to amend the configuration file hercules.cnf to reflect your device layout and intended mode of operation (S/370, ESA/390, or z/Architecture). See the Hercules Configuration File page for a complete description.
Creating DASD volumes
The Creating Hercules DASD page describes various methods of creating and loading virtual DASD volumes. The compressed CKD DASD support is described in this page.
Operating Procedure
Note: If you intend to run any licensed software on your PC using Hercules, it is your responsibility to ensure that you do not violate the software vendor’s licensing terms.
Starting Hercules
To start Hercules enter this command at the Unix or Windows command prompt:
is the name of the configuration file. The default, if none is specified, is hercules.cnf. The default may be overridden via the HERCULES_CNF environment variable.
specifies that Hercules is to be run in ‘daemon’ mode, wherein it runs invisibly with no attached console.
is the directory from which dynamic modules are to be loaded. The default depends on the host platform on which Hercules is being run. This option overrides the default.
is an optional log file which will receive a copy of all messages displayed on the control panel
Next connect a tn3270 client to the console port (normally port 3270). The client will be connected to the first 3270 device address specified in the configuration file (this should be the master console address). If your master console is a 1052 or 3215, connect a telnet client instead of a tn3270 client.
Now you can enter an ipl command from the control panel.
Using the keyboard
The main Hercules screen contains a scrollable list of messages with a command input area and system status line at the bottom of the screen.
To scroll through the messages, use either the Page Up or Page Down keys, the Ctrl + Up Arrow or Ctrl + Down Arrow keys, or the Home or End and/or the Ctrl + Home or Ctrl + End keys.
Important messages are highlighted in a different color (usually red) and are prevented from being scrolled off the screen for two minutes. If Extended Cursor handling is available then important messages currently at the top of the screen can be removed early by moving the cursor to the line containing the message and then pressing enter.
Use the Insert key to switch between insert and overlay mode when typing in the command input area. Use the Home and End keys to move to the first or last character of the command you are typing, or the use the left/right arrow keys to move to a specific character. Use the Escape key to erase the input area.
Pressing Escape when the command input area is already empty causes the screen to switch to the semi-graphical «New Panel» display mode, which shows the overall status of the system and devices.
When in the semi-graphical «New Panel» display mode there is no command input area. Instead, single character «hot keys» are used to issue some of the more common functions such as starting or stopping the CPU. The hot-keys are those which are highlighted. Pressing the ‘?’ key displays brief help information on how to use the semi-graphical panel.
Normal cursor handling | |
---|---|
Key | Action |
Esc | Erases the contents of the command input area. If the command input area is already empty, switches to semi-graphical New Panel. |
Del | Deletes the character at the cursor position. |
Backspace | Erases the previous character. |
Insert | Toggles between insert mode and overlay mode. |
Tab | Attempts to complete the partial file name at the cursor position in the command input area. If more than one possible file exists, a list of matching file names is displayed. |
Home | Moves the cursor to the start of the input in the command input area. If the command input area is empty, scrolls the message area to the top. |
End | Moves the cursor to the end of the input in the command input area. If the command input area is empty, scrolls the message area to the bottom. |
Page Up | Scrolls the message area up one screen. |
Page Down | Scrolls the message area down one screen. |
Up arrow | Recalls previous command into the input area. |
Down arrow | Recalls next command into the input area. |
Right arrow | Moves cursor to next character of input area. |
Left arrow | Moves cursor to previous character of input area. |
Ctrl + Up arrow | Scrolls the message area up one line. |
Ctrl + Down arrow | Scrolls the message area down one line. |
Ctrl + Home | Scrolls the message area to the top. |
Ctrl + End | Scrolls the message area to the bottom. |
The following additional keyboard functions are effective when the Hercules Extended Cursor Handling feature (OPTION_EXTCURS) is activated at compile time. At present, this feature is activated on the Windows platform only.
Extended cursor handling | |
---|---|
Key | Action |
Alt + Up arrow | Moves cursor up one row. |
Alt + Down arrow | Moves cursor down one row. |
Alt + Right arrow | Moves cursor right one column. |
Alt + Left arrow | Moves cursor left one column. |
Tab | If cursor is outside the command input area, moves cursor to the start of the input in the command input area. Otherwise behaves as described in previous table. |
Home | If cursor is outside the command input area, moves cursor to the start of the input in the command input area. Otherwise behaves as described in previous table. |
End | If cursor is outside the command input area, moves cursor to the end of the input in the command input area. Otherwise behaves as described in previous table. |
Panel commands
The following is what is displayed on the Hercules harware console (HMC) in response to the ‘?’ command being entered. Please note that it may not be completely accurate or up-to-date. Please enter the ‘?’ command for yourself for a more complete, accurate and up-to-date list of supported panel commands.
The ipl command may also be used to perform a load from cdrom or server. For example if a standard SuSE S/390 Linux distribution CD is loaded and mounted on /cdrom for example, this cdrom may then be ipl-ed by: ipl /cdrom/suse.ins
The attach and detach commands are used to dynamically add or remove devices from the configuration, and the define command can be used to alter the device number of an existing device.
The devinit command can be used to reopen an existing device. The args (if specified) override the arguments specified in the configuration file for this device. The device type cannot be changed and must not be specified. This command can be used to rewind a tape, to mount a new tape or disk image file on an existing device, to load a new card deck into a reader, or to close and reopen a printer or punch device.
In single-step mode, pressing the enter key will advance to the next instruction.
Some commands also offer additional help information regarding their syntax, etc. Enter «help » to display this additional help information. (Note: not every command supports help)
When a command is prefixed with ‘-‘, the the command will not be redisplayed at the console. This can be used in scripts and is also used internally when commands are to be invoked without being redisplayed at the panel.
The hercules.rc (run-commands) file
Hercules also supports the ability to automatically execute panel commands upon startup via the ‘run-commands’ file. If the run-commands file is found to exist when Hercules starts, each line contained within it is read and interpreted as a panel command exactly as if the command were entered from the HMC system console.
The default filename for the run-commands file is «hercules.rc», but may be overridden by setting the «HERCULES_RC» environment variable to the desired filename.
Lines starting with ‘#‘ are treated as «silent comments» and are thus not logged to the console. Line starting with ‘*‘ however are treated as «loud comments» and will be logged.
In addition to being able to execute any valid panel command (including the ‘sh’ shell command) via the run-commands file, an additional ‘pause nnn‘ command is supported in order to introduce a brief delay before reading and processing the next line in the file. The value nnn can be any number from 1 to 999 and specifies the number of seconds to delay before reading the next line. Creative use of the run-commands file can completely automate Hercules startup.
The «Hercules Automatic Operator» (HAO) Facility
The Hercules Automatic Operator (HAO) feature is a facility that allows one to automatically issue panel commands in response to certain messages being issued.
To use the Hercules Automatic Operator facility, one first defines a «rule» consisting of a «target» and an associated «command». The «target» is just a regular expression pattern used to match against the text of the various messages that Hercules issues as it runs. Whenever a match is found, the rule «fires» and its associated command is automatically issued.
The Hercules Automatic Operator facility is only for those messages issued by Hercules to its HMC (hardware console). It cannot be used for whatever messages the guest operating system may issue to any of its terminals. It is only a Hercules automatic operator and not a «VSE», «MVS», «VM», etc, automatic operator.
Defining a Rule
To define a HAO rule, enter the command:
to define the rule’s «target» match pattern (a simple regular expression), followed by the command:
to define the rule’s associated panel-command.
The target pattern is a simple regular expression value as defined by whatever regular expression facility your host build platform happens to support. For Windows it must be a Perl Compatible Regular Expression (PCRE). For other supported build platforms it might be some other supported regular expression syntax. Check your host platform’s programming documentation for further details.
The associated command is whatever valid Hercules panel command you wish to issue in response to a message being issued that matches the given pattern target.
Other commands and limitations
To delete a fully or partially defined HAO rule, first use the ‘hao list’ command to list all of the defined (or partially defined) rules, and then use the ‘hao del nnn‘ command to delete the specific rule identified by nnn. (All rules are assigned numbers as they are defined and are thus identified by their numeric value). Optionally, one may delete ALL defined or partially defined rules by issuing the command ‘hao clear’.
The current implementation limits the total number of defined rules to 64. If you need to define more than 64 rules you will either have to build Hercules for yourself (increasing the value of the HAO_MAXRULE constant in hao.c) or else beg one of the Hercules developers to please do it for you.
Note that there is currently no way to define a command whose arguments vary based on actual message text. That is to say, there is currently no way to say
«Reply with the command ‘devinit cuu filename’ in response to message text ‘HHCXXnnnI Device cuu intervention required.’ where cuu is whatever cuu was identified in the message.»
The HAO is not that sophisticated (yet). Only simple plain-text commands may be defined and issued. No automatic substitution is done based on message text (although normal ‘DEFSYM’ symbol substitution is supported however, as that is a normal panel-command feature supported separately from the HAO). This may possibly change in the future however, depending on user need/demand.
All defined rules are checked for a match each time Hercules issues a message. There is no way to specify «stop processing subsequent rules». If a message is issued that matches two or more rules, each associated command is then issued in sequence. Thus the advice to choose your rules’ target patterns carefully very much applies here.
Technical Support
For technical support, please see our Technical Support web page.
- как установить hearthstone на windows phone
- как установить heroku на windows