PDA

View Full Version : Some questions about macros and keymaps


danvari
August 14, 2008, 16:10
hey!

i played tome for a while and used it great macro recorder to record some keybindings. now i am playing angband and do not know what to do ^^. i read the documentation, but i do not understand everything, i am learning quite well from examples, so here is what i want:

i want to bind F1 to Magic Thrust at an enemy. what i did: i created a new macro (using "@") with the trigger F1 and typed in: maa*t
ok that is working, but what happens if the order of my books changes? so i have to type mba*t for example? i read that i need to inscribe my stuff...ok with the "{" - key...

a) but how can i tell angband to use my inscriptions?
b) what is the difference between macros and keymaps? which should i use?
c) i read that many people are using an "\e\e..." before the macro..why? in the documentation it is said that this is the escape key, but what does it do?

i hope you can help me :).

Skelwing
August 14, 2008, 18:37
a) but how can i tell angband to use my inscriptions?

Angband will pay attention to inscriptions including certain characters; the one you're looking for is @. If you (for example) inscribe a spellbook with {@1}, then that spellbook will be selected when you press 1 or the book's inventory letter at a command prompt. If you want the book to only respond to 1 when casting spells, then you want to inscribe it with {@m1}.

This works in macros too; with this inscription, you can change the macro to: m1a*t and it will work even if the inventory order changes.

b) what is the difference between macros and keymaps? which should i use?

Macros will not take effect while other keymaps/macros are being processed, and keymaps will. In general, use macros for making "shortcuts", and keymaps for changing the underlying action of a key.

c) i read that many people are using an "\e\e..." before the macro..why? in the documentation it is said that this is the escape key, but what does it do?

The escape key will advance -more- messages, as well as cancel out other prompts you may have open. This is important because if you don't have the escape keys and try to use the macro, Angband will interpret the beginning of the macro for something other than what was intended, and completely screw up the macro.

danvari
August 14, 2008, 19:56
ahhh yes thank you, you helped me much :)

ok, one last question: how do i know that a "@" refers to spellbooks? ok i know it now, but does it stand somewhere in the docs where i can find it?

Psi
August 14, 2008, 20:43
ahhh yes thank you, you helped me much :)

ok, one last question: how do i know that a "@" refers to spellbooks? ok i know it now, but does it stand somewhere in the docs where i can find it?
It doesn't. The command follows the @. ie @m1 means this will be the item referenced when m1 is entered. Similarly inscribing @b1 will mean b1 browses this item, @w3 means w3 will wield this item etc.

I usually inscribe my spell books !d!k!v@m1@b1, !d!k!v@m2@b2 etc

Which means confirm on dropping, destroying and throwing and treat this as book x for casting and browsing.

Zikke
August 14, 2008, 21:44
Wow that's pretty advanced stuff. And here I thought I was hot sh*t for setting 4 damage spells and 3 detect spells to my F1-7 keys... ;)