Macroes

Tangaria is real-time game (till you will be hurt by monsters – then time slowes) and the adventurer will often find himself in situations where he won’t have time to enter all the commands manually. So if you want to survive in Tangaria, you will have to learn how to create macroses. A macros is a programmed key on your keyboard which map a single keypress to a series of keypresses. For example you might map the key F1 to “maa” (the keypresses to cast “Magic Missile” as a spellcaster). This can speed up access to commonly-used features.

You can program any ley to do whatever keypresses you want, in any order you want. Most people use the function keys (F1-F12) for the macroses because none of them are used for game commands.

To create macro and set up keymaps you need to go to the options menu = and select “Edit keymaps” k. Lets first create an example macro – to macro Cure Light Wounds potion at F1 key:

• Inscribe { potion as @q1
• Push =k to enter macro mode (you’ll see the menu)
• Press d to create new macro
• push a key on which bind to macro: F1
• input the action: q1 (it will become [Escape]q1)
• Press $ when finished • Push y to save the key • Push b (‘save keymaps to file’) • Now, push Esc to get out of the menu and back in the game. • Push F1, and you will drink Cure Light Wounds potion. But why there is [Escape] part? The command also could look like \eand it’s the same as Esc key. So if you were doing something else, like eating, quaffing, or gaining spells, and something bad happens, you want the macro to work at once! Also, it’s useful when you don’t want to push Esc on numerous occations, like when firing rapid stinking cloud or something. Time is precious in Tangaria. You could put \e’s in the back too, but not overdo it. The more \e’s you have, the more lag you will get. So if you had the first four spells in the first book, the macro-actions would be like this: Remember to macro all your items and spells (if you play caster). You can use ctrl+F1-F12 too, not only simple F’s. As you saved your macros to the default file, it will be autoloaded every time you start the client; otherwise you should load the file manually. Keymaps have two parts: the trigger key and the action. These are written where possible just as ordinary characters. However, if modifier keys (shift, control, etc.) are used then they are encoded as special characters within curly braces {}. As you probably know, throwing flasks of oil at monsters hurt them. If you are a mage, inscribe your flasks @v1, and set the action [ESCAPE]v1*t. • Here’s how to shoot with your bow: • Macro your arrows @f1 • Set action as [ESCAPE]ef1*t The *t is for targetting. Happy shooting 🙂 So back to theory: when Possible modifiers are: K = Keypad (for numbers) M = Meta (Cmd-key on OS X, alt on most other platforms) ^ = Ctrl S = Shift If the only modifier is the control key, the curly braces {} aren’t included. For example: {^S}& = Ctrl + Shift + & ^D = Ctrl + D Special keys, like F1, F2, or Tab, are all written within square brackets []. For example: ^[F1] = Ctrl + F1 {^S}[Tab] = Ctrl + Shift + Tab Special keys include [Escape]. The game will run keymaps in whatever keyset you use (original or roguelike). So if you write keymaps for roguelike keys and switch to original keys, they may not work as you expect! Keymap actions aren’t recursive either, so if you had a keymap whose trigger was F1, including F1 inside the action wouldn’t run the keymap action again. Keymaps are written in pref files as: A:<action> C:<type>:<trigger> The action must always come first, <type> means ‘keyset type’, which is either 0 for the original keyset or 1 for the roguelike keyset. For example: A:maa C:0:[F1] Tangaria uses a few built-in keymaps. These are for the movement keys (they are mapped to ; plus the number, e.g. 5 -> ;5), amongst others. You can see the full list in pref.prf but they shouldn’t impact on you in any way. To avoid triggering a keymap for a given key, you can type the backslash \ command before pressing that key. Examples of macroses by Warrior Example 1: You’re a Mage. Gain the spell Detect Creatures. Hit G then 1 then b. Inscribe { your Beginners magic book with @m1. This gives your book a specific number instead of just a position in your inventory. Positions may change as you drop items or if an item is destroyed so if you don’t give your book a number the keymap might not find the right book. This is VERY important. Push =k to go to the keymap screen. Press d) Create a keymap. Push F1 on your keyboard. Set the action as [Escape]m1b then hit $. Press y to save the keymap. You have now programmed the F1 key to execute the Detect Creature spell.

Now, hit Esc to get out of the keymap menu. If you now try hitting F1 you will cast the Detect Creature spell. But why we used the [Escape] part in [Escape]m1b? The [Escape] is the same as Esc key. So if you were doing something else, like eating, quaffing, or gaining spells, and something bad happens, you want the keymap to work.

Example 2: You’re a Warrior. Inscribe your potion of Berserk Strength with @q1. Go to the keymap menu =k and choose option d) Create a keymap. Press the key where you want this keymap, F2 for example. Set the action as [Escape]q1 (see above). Then hit Esc, and you’re in the game again.

When you now press F2 it will quaff your potion of Berserk Strength.

Example 3: You want to use a bow. Inscribe your arrows @f1. Set action as [Escape]f1' to target the closest monster, or even use the h command to fire the default ammo in your quiver at the closest monster.

Remeber to save your macroses =kb; otherway when you will quite the game and start it again – you will need to map macroses again, which is quite annoying. Better to save macroses after change.

Examples from Jir

Action             Macro   Inscription corresponding
-----------------  ----------------  -----------------
read a scroll      \er1    @r1 (phase door, teleport, etc)
phase door(magic)  \em1c   @m1 ("Magic for Beginners")
quaff a potion     \eq1    @q1 (!crit, !healing etc.)
magic missile      \em1a*t @m1 ("Magic for Beginners")
fire a missile     \ef1*t  @f1 (arrows, bolts, shot, etc)

'magic missile' and 'fire a missile' macro will
target and shoot automatically;)

teleport(staff)    \eu1    @u1 (staff of teleportation)
satisfy hunger     \em3a   @m3 ("Incantations" book)
detection          \ep6b   @p6 ("Godly Insight")

auto-pickup on     \e=1\s\s\s\s\sy\e\e
auto-pickup off    \e=1\s\s\s\s\sn\e\e
[foo.prf can be the filename you want]
machine gun        \et1*tt1*tt1*tt1*tt1*t
[work well with pern archers]

An example of continuous actions macro:
quaff & PhaseDoor \eq1r1 @r1,@q1


If you save macros to files with some special names, the macros will be autoloaded only in corresponding situation.

–file name— — autoloaded when playing ———
druid.prf              druid class
Jir.prf                   character named ‘Jir’

Special Keys

Certain special keys may be intercepted by the operating system or the host machine, causing unexpected results. In general, these special keys are control keys, and often, you can disable their special effects.

It is often possible to specify “control-keys” without actually pressing the control key, by typing a caret ^ followed by the key. This is useful for specifying control-key commands which might be caught by the operating system as explained above.

Pressing backslash \ before a command will bypass all keymaps, and the next keypress will be interpreted as an “underlying command” key, unless it is a caret ^, in which case the keypress after that will be turned into a control-key and interpreted as a command in the underlying Angband keyset. The backslash key is useful for creating actions which are
not affected by any keymap definitions that may be in force, for example, the sequence \ + . + 6 will always mean “run east”, even if the . key has been mapped to a different underlying command.

The 0 and ^ and \ keys all have special meaning when entered at the command prompt, and there is no “useful” way to specify any of them as an “underlying command”, which is okay, since they would have no effect.

For many input requests or queries, the special character ESCAPE will abort the command. The ‘[y/n]’ prompts may be answered with y or n, or Esc.

If you saved macros when they were messed up and now you can’t do something – just delete your macro-file pref.prf