The Official NPPAngband And NPPMoria Forum

You are not logged in.


November 28, 2016 - NPPAngband forum has been migrated to a new host. SSL has been enabled so please use https:// if possible.

#1 2013-08-20 21:13:03

NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647

How do you use macros?

In trying to find inspiration for what to do next, replacing macros with hotkeys seems like a good project to work on at the moment.  Macros have the problem right now of being unable to find inscribed inventory items that also serve as direction keys (@r2). 

So I would need to set up functions for each way macros are used.  So far I can think of:

1) casting spells  (the player would specify the spell from a manu, then potentially instructions for targeting and/or an object to cast the spell on.  This eliminates the need to specify a book, so they won't need to be inscribed for macro spellcasting.
2) using an object (again, would need to account for specific targeting spells for wands/rods, and objects for things scrolls of recharging, or objects in the player inventory for enchantment scrolls.
3) firing ammo and/or throwing an object
4) resting
5) casting several spells in succession (such as a variety of detection spells), even followed by resting back to full mana.
6) repeating any of the above actions multiple times

How else do you all use macros?  It is easy to code, but I will have to make sure hotkeys could handle the most complex macros.


#2 2013-08-21 01:15:13

Registered: 2007-10-22
Posts: 104

Re: How do you use macros?

Thanks! As it stands macros are a bit too 'arcane' with little clear explanation of what they are and why I should care. Last couple years I have been lazy and used my G15 Keyboard, it can record 18 sets of complex keystrokes and mouse clicks, and even preserve timings.

BTW, since Moria integration with 7, did we lose the 'repeat obvious' option? I might have missed it, but can't seem to find it anymore, and tunneling 1 whack at a time is sooo boring... smile

As to macros, most cast, search, dig, etc... automation's are too dangerous to use. Like in 5 above, lets say Cast A, Cast B, Cast C, Quaff D, Rest. Might work fine 99 times out of 100, that 100th when Saruman comes walking around the corner just after you Cast A.. well, it's not pretty...

What I have set up are mostly shortcuts that Hotkeys would work for nicely

Bank M1
G1 - Spell 1
G2 - Spell 2
G3 - AoE Spell 1
G4 - Bow attack at last target
G5 - Wand/Staff/Rod 1
G6 - Wand/Staff/Rod 2

Bank M2
G1 - Heal 1
G2 - Heal 2
G3 - Cure Poison
G4 - Cure Conditions
G5 - Find Doors/Traps (spell/item)
G6 - Destroy Traps

Bank M3
G1 - variable
G2 - variable
G3 - Move UP and Search 2x (each wall space would be subject to 4 or 6 searches)
G3 - Move Right and Search 2x
G3 - Move Down and Search 2x
G3 - Move Left and Search 2x

The keys functions always remain the same, but the method they work with can change. For instance 'Find Doors/Traps', one char uses a spell, another a scroll, yet another a Rod.


#3 2013-08-21 07:07:26

Diego Gonzalez
NPPAngband Source Contributor
Registered: 2004-10-09
Posts: 292

Re: How do you use macros?

I'll try to reproduce my macro/keymap from my memory since I don't use them anymore since they got broken.


\e\e\e\em1c              Cast "c" spell from book 1 (inscribed with @m1). Usually a spell that doesn't involve targetting, like heal, detection, haste, etc.

\e\e\e\em3f-a            Identify first item on floor. Can be used with *inscribed* rods of perception and other things.

\e\e\e\e0k-ay            Destroy first item on floor. Notice the "0" before the "k" to avoid the prompt for quantity.

\e\e\e\e0k-as            Destroy first item on floor and mark it for squelching.

*t                       Target the nearest monster. It must be a macro to work as part of the current command. I use it to complete a spell typed manually, a shot from a bow and things like that.

\s\s\s\s\s\s\s\s\s\s     Clear "more" prompts and messages (I use quick_messages off). Again, it must be a macro.


050\\s                   Find secret stuff or waste some turns waiting for a monster. Usually bound to the "s" key, ence the \\s to avoid infinite loop.

R&\n                     Rest until fully healed or to recover mana points.

m1a*t\e\e\e\e            Cast magic missile (or another offensive spell) targetting the nearest monster, then clear death messages.

I don't cast several spells within the same macro/keymap and I don't rest after casting a spell (all inside the same macro) because of monsters moving near the @.

I hope it helps you.



#4 2013-08-21 07:16:15

Diego Gonzalez
NPPAngband Source Contributor
Registered: 2004-10-09
Posts: 292

Re: How do you use macros?

Another possible task could be to emulate quick_messages = off when a monster takes a big chunk of HP with one single attack, to avoid deaths caused for pressing the arrow keys too much and Azathoth suddenly teleporting near to you. I happens to me a lot when I use quick_messages = on.



#5 2013-08-25 09:18:13

NPPAngband Maintainer
Registered: 2004-07-01
Posts: 1,647

Re: How do you use macros?

Diego - interesting.  But I think those macros could be re-created with the right hotkeys.  I could add an option for the hotkey to automatically clear the messages.  I should be able to give the option with commands to choose the xth item on the floor.

I would think resting would (or should) be interrupted during a macro/hotkey just like anything else.  That would be incredibly dangerous if it wasn't.


Board footer

Powered by FluxBB