Problems with macros

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Skippy
    Rookie
    • Aug 2008
    • 2

    Problems with macros

    I just came back to Angband after a little hiatus and was trying to get my macros going again.

    I used to have macros on 'x' and 'y' for, say, stinking cloud and lightning bolt. I use these because they are empty commands.

    My mage.prf file has the following entry:
    # x -- Stinking cloud

    A:\e\e*tm1i5
    P:x

    Now I find that these macros don't work properly anymore. Or rather, they work too well, they work everywhere including when responding to [y/n] prompts and when trying to inscribe some armour "Orfax". It is taking the final x and interpreting it. Similarly when I try to respond 'y' to any prompt it will interpret my command and do weird things.

    What have I done wrong - or - is this a bug?
  • aeneas
    Adept
    • Jun 2007
    • 158

    #2
    Hmm- I'm sure someone who knows a bit more about how macros are implemented can weigh in more definitively, but this is behavior that I would expect, or at least not find all that surprising. I use a very small number of macros constantly, but I'm set in my ways. I figured out a system that worked for me a long time ago and haven't changed it since. I only use function keys for macros though. Assuming you have function keys you might try just using them, as it would solve your problem. Also, your example macro looks a bit funny to me- one thing is certain: two \e\e escapes are not enough. I use six. For some reason I think that using \a might do the same thing, but like I said, I'm set in my ways.

    Comment

    • Skippy
      Rookie
      • Aug 2008
      • 2

      #3
      I suppose that the reason for my comment is that this, if my memory serves me right, appears to be changed behaviour from, say, 2.9.x and 3.0.x where x<6. I don't remember having trouble inscribing things and have used 'x' as a macro key in earlier versions of Angband. But maybe I never actually tried to inscribe something with Orfax before.

      I would expect that macros behave in the same way as commands - and don't try to interpret things you type in an inscription or responding to a y/n prompt.

      The model for this macro is the macros that are in the user-mac.prf file that 'ships' with the game and they all use 2 escapes. At any rate, I've only ever used 2 escapes and have never had any problems. I have shifted these macros to F4-F7 - but it is harder to reach the F keys than, say, x. I guess I am also set in my ways.

      But a definitive answer would be appreciated.

      Comment

      • aeneas
        Adept
        • Jun 2007
        • 158

        #4
        Originally posted by Skippy
        I suppose that the reason for my comment is that this, if my memory serves me right, appears to be changed behaviour from, say, 2.9.x and 3.0.x where x<6. I don't remember having trouble inscribing things and have used 'x' as a macro key in earlier versions of Angband. But maybe I never actually tried to inscribe something with Orfax before.

        I would expect that macros behave in the same way as commands - and don't try to interpret things you type in an inscription or responding to a y/n prompt.
        Well you may well be right about that changing, as far as I know- I've always used just the function keys, so I wouldn't have noticed a change in behavior. The macro facility has always been a bit under-documented. I'm just stabbing in the dark, but you might look at keymaps to see if they behave differently. I just use macros, though I have a feeling it is generally better to use keymaps. Like I said, I just have a system that works for me, and I only use a few macros (though I could hardly play the game without them).

        Originally posted by Skippy
        The model for this macro is the macros that are in the user-mac.prf file that 'ships' with the game and they all use 2 escapes.
        That's pretty dangerous, I think. If I'm not mistaken (always an iffy proposition) each \e clears one prompt. If there are more than two prompts your macro may be only partially interpreted, starting in the middle, and that can lead to some unexpected things happening, sudden tombstones among them. On top of that you are most likely to get a lot of prompts at a critical time. I used to use three \e escapes, but found that that was occasionally not enough. I don't recall ever having a problem with six, but if \a does what I think it does it would be better.

        Originally posted by Skippy
        At any rate, I've only ever used 2 escapes and have never had any problems. I have shifted these macros to F4-F7 - but it is harder to reach the F keys than, say, x. I guess I am also set in my ways.

        But a definitive answer would be appreciated.
        Well I'm sure one will happen along any time now, at least in terms of telling you what the behavior is now. You might not get a definitive answer about whether or not it has changed, as the versions you are talking about are a number of years old now, and changes might have been made by someone who is no longer involved with Angband- you might have to start looking at the sources to answer that (or just try the same macros in an older version ). I imagine you would have noticed the 'y' though, if not the 'x'. In the absence of a spec it is the sort of thing I would consider implementation dependent.

        I certainly understand what you mean about being set in your ways- after a few years of playing it is not easy to adjust to changes in your fingering patterns.

        Comment

        • Caesum
          Rookie
          • Aug 2008
          • 12

          #5
          macros

          Are you sure you didn't use to bind it to X instead of x ? The behaviour has always been like this I think, see the macro FAQ section 6.1 where it warns against y/n prompts etc.

          Comment

          • Narvius
            Knight
            • Dec 2007
            • 589

            #6
            ...but you know, this is a very old thread?
            If you can convincingly pretend you're crazy, you probably are.

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎