Step macro issues
Posted: Sat Feb 21, 2009 11:26 am
Hi all. First, I came across ACK while I was reliving a little of my youth with ACS on an emulator. ACK is giving me that warm nostalgia I was looking for without all the aggravation of emulation or the horrible ACS interface. THANKS!
I am having a little trouble with macros and items that I wanted to run by y'all. I may be doing something wrong. I may also just be dissatisfied with some of the implementation.
What I would like to do is create a consumable object that provide a short, temporary buff. Here is my code for one that meets the following requirements:
1. Applies a 20 pt bonus to weapon skill for 10 turns
2. Only one buff can be active at a time
3. Applies buff on 'u'se and consumes an object if successful
4. If not successful, does not consume the object
Object 39: usage requires nothing, does not disappear, execute macro on use:
1: IF Z2 = 0 THEN 4 (allow use *only* if not buffed)
2: SMSG 40 (failure message)
3: STOP
4: SET Z2 = 10 (number of turns active)
5: SET WSK = WSK + 20 (buff)
6: SET INV[39] = INV[39] - 1 (consume if successful)
7: SMSG 42 (usage message)
Step macro:
1: IF Z2 = 0 THEN 6 (its not active, so ignore it)
2: SET Z2 = Z2 - 1 (decrement the time)
3: IF Z2 > 0 THEN 6 (still time left on the buff)
4: SET WSK = WSK - 20 (remove the buff)
5: SMSG 41 (expiration message)
6:
I have 2 problems:
1. Using the item takes 2 turns. I can't figure out why this happens. If, say, I use it in melee the monster will get 2 hits on me when I would only expect 1.
2. Every action decrements the counter even if it doesn't consume a turn of time. For instance, if I check my inventory 8 times, the buff expires.
I don't know if 1 is a bug or user error. 2 may not be a bug (I don't know if there are macros that need to be executed on every screen refresh). If its not a bug, it sure would be nice to have a macro that is executed with every action that consumes a game turn.
I am having a little trouble with macros and items that I wanted to run by y'all. I may be doing something wrong. I may also just be dissatisfied with some of the implementation.
What I would like to do is create a consumable object that provide a short, temporary buff. Here is my code for one that meets the following requirements:
1. Applies a 20 pt bonus to weapon skill for 10 turns
2. Only one buff can be active at a time
3. Applies buff on 'u'se and consumes an object if successful
4. If not successful, does not consume the object
Object 39: usage requires nothing, does not disappear, execute macro on use:
1: IF Z2 = 0 THEN 4 (allow use *only* if not buffed)
2: SMSG 40 (failure message)
3: STOP
4: SET Z2 = 10 (number of turns active)
5: SET WSK = WSK + 20 (buff)
6: SET INV[39] = INV[39] - 1 (consume if successful)
7: SMSG 42 (usage message)
Step macro:
1: IF Z2 = 0 THEN 6 (its not active, so ignore it)
2: SET Z2 = Z2 - 1 (decrement the time)
3: IF Z2 > 0 THEN 6 (still time left on the buff)
4: SET WSK = WSK - 20 (remove the buff)
5: SMSG 41 (expiration message)
6:
I have 2 problems:
1. Using the item takes 2 turns. I can't figure out why this happens. If, say, I use it in melee the monster will get 2 hits on me when I would only expect 1.
2. Every action decrements the counter even if it doesn't consume a turn of time. For instance, if I check my inventory 8 times, the buff expires.
I don't know if 1 is a bug or user error. 2 may not be a bug (I don't know if there are macros that need to be executed on every screen refresh). If its not a bug, it sure would be nice to have a macro that is executed with every action that consumes a game turn.