PosChengband macro question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sose
    Rookie
    • Jan 2014
    • 13

    PosChengband macro question

    Hey, does anyone know if it's possible to make a "fail-safe" macro in PosChengband, so that if an action fails, the macro won't finish?

    Situation: I'm playing a possessor with a caster form who has the Eat Magic ability. The ability has 11% chance to fail. I'm trying to make a macro that automatically drains one of my more or less useless rods.

    '\eUc' is the first part. And if I want to play it safe, I can macro that and then press '1' (rod inscribed with @U1) manually if the ability doesn't fail. However, to reduce keypresses, it'd be really cool to have a macro that does '\eUc1' automatically, but this one will move my character 11% of the time, when the Eat Magic ability fails.

    I hope that makes some sense! Thanks

    Edit: I found out a solution. This always happens, when you go ahead and post a question, the answer just comes to you 5 minutes later. I'm using "@Uj" inscription as 'j' is the command to "spike" something and apparently doesn't use a turn if used on nothing so it's pretty failsafe. And if you're pressing the key multiple times, the \e clears the menu that asks which direction to spike. So the macro is '\eUcj' and inscription on rod is for example '@zd@Uj'
    Last edited by Sose; January 12, 2015, 07:29.
  • chris
    PosChengband Maintainer
    • Jan 2008
    • 702

    #2
    Also, make sure the flush_failure option is turned on (=5). If the macro includes a spell or whatever that fails, the rest of the macro sequence should then be flushed from the queue.

    As you mention, starting macros with \e is good practice too as this flushes the message queue -more- prompts before starting the real macro sequence.

    Comment

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