Macros


Ask fellow adventurers how to stay alive in the deep, dark, dangerous dungeon below, or share your own accumulated wisdom.

Lair Larrikin

Posts: 17

Joined: Wednesday, 15th August 2012, 10:29

Post Wednesday, 15th August 2012, 10:36

Macros

So I've gotten fed up with dying due to the letter movement macros.
Is there a way to get rid of them?
I tried turning them off using the .txt files etc
I managed to get it to work, but then some of the other macros seems to stop working too. Even though they're not in the no_vi_command_keys.txt file.

Only reason this is really that important is that when I go to use an ability but accidentally press z, without actually knowing any spells, and then instantly pressing b because I know what skill I want to use... I then suddenly walk diagonally and give the enemy a free attack on me. And sometimes (like just now) that results in me getting killed.
User avatar

Vestibule Violator

Posts: 1459

Joined: Sunday, 19th December 2010, 05:45

Location: New England

Post Wednesday, 15th August 2012, 15:57

Re: Macros

Well, there's several ways to get around keypress stupidity. The most basic, of course, is to get familiar enough with the setup to avoid or decrease them. But in the case of persistent control typos and the like, there are steps you can take against it.

I haven't found a good way around z / a confusion. It's just something you have to pay attention to. You could try mapping them to different keys so they're not right next to one another. You could train yourself to open the menu each time (z?, a?) so you have to look at the available abilities / spells before casting, and so you notice if you opened the wrong menu (or you could use a macro to force the menu open each time). You could bind specific spells and abilites to their own shortcut macros, so you don't mess up the menus as all. (za and aa are easy to confuse. 1 and 2 are harder).

You've already discovered bindkey, by the sound of it. Lines of the form

bindkey = [h] CMD_NO_CMD_DEFAULT

in your init.txt / your config assign a null command to the key in brackets, so nothing happens when it's pressed. This might mess with other macros that use the keys you've disabled, though (autofight / tab is a common offender, I think).

Another possible solution is to add confirmation prompts instead of disabling the command completely. I used this macro to stop myself from accidentally hitting autoexplore when I didn't want to.

  Code:
# Adds a confirmation prompt before autoexplore.  Map to o

{
function confirm_autoexplore()
    crawl.formatted_mpr("Really autoexplore?", "prompt")
    local res = crawl.getch()
    if string.lower(string.char(res)) == "y" then
        crawl.sendkeys("o")
    end
end
}

You could use something similar on the vi keys if you wanted. One advantage is if you call the protected key in another function or macro, the prompt doesn't muck it up (I think. I haven't tested that extensively).

(Moving this to advice, since that's what he's asking for).

For this message the author mageykun has received thanks:
Lainge

Lair Larrikin

Posts: 17

Joined: Wednesday, 15th August 2012, 10:29

Post Thursday, 16th August 2012, 11:59

Re: Macros

Ahh thanks for the help.
And yes the auto-attack macro did decide to stop working when I tried it previously so I put it back. I'll try the warnings.

Return to Dungeon Crawling Advice

Who is online

Users browsing this forum: No registered users and 17 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.