Two (hopefully) quick questions

saintonan

New member
Joined
Jan 25, 2014
Messages
53
Reaction score
0
Points
0
Two things I've been searching around for but haven't found:

1. Does anyone have an example of #chat using a custom chat channel? My macro works fine when I have it set to

Code:
#chat tell

but doesn't respond to either of

Code:
#chat 1
#chat customchannelname

2. Does anyone know how Target.Buff[] works on NPCs? One of the things I want my enchanter bot to do is to get a debuff called Deep Sleep on the mob. It's a random proc off a mez attempt, so I spam Stasis until Deep Sleep lands. I tried checking for Target.Buff[Deep Sleep] and Target.Buff["Deep Sleep"], but the macro crashes both ways, saying that the argument is non-numeric (even though DataType:target - MacroQuest Wiki says it should be able to take a spell name as well as an index). I'll try using BuffCount and cycling through Target.Buff.Name but I'd suspect that'd be fairly slow on a boss that has 30 debuffs on him.

Alternatively, is there an easier way to accomplish #2?

Thanks in advance for any help.
 
Last edited:
Pound Commands - MacroQuest Wiki

#chat


  • #chat channelname
This is a special type of #event which watches the specified channelname. Content from the channelname is accessed by creating a Sub Event_Chat.
Valid channels are: auc, chat, guild, group, ooc, say, shout, and tell. (chat represents channels)
Only one channel may be used on the #chat line, however multiple lines may be added. Example:

Code:
#chat guild #chat group  Sub Event_Chat(ChatChannel,ChatSender,ChatText)   /echo ${ChatSender} told me ${ChatText} in ${ChatChannel} /return
</pre> This would trigger Event_Chat for both guild and group chat.
Also see here for information on #events and the #chat special event.

Target.Buff[#], you do have to cycle, I can make a ${Target.DeepSleep} or similar TLO member for you as that is something I would be interested in too. I added like 30 other Target.Blah TLOs as of the latest update too such as Target.Mezzed, Target.Slowed, and several others. there is a post floating around somewhere.
 
Last edited:
I wrote up Target.DeepSleep, but I can't test tonight. I will give it a whirl tomorrow. If you compile your own stuff you can try it.

MQ2datatypes.cpp:
MQ2TargetType:
Code:
    case DeepSleep:
        if(!(((PCTARGETWND)pTargetWnd)->Type > 0))
            return false;
        for(i = 0; i < NUM_BUFF_SLOTS; i++)
        {
            buffID = ((PCTARGETWND)pTargetWnd)->BuffSpellID[i];
            if(buffID>0) {
                if(strstr(GetSpellByID(buffID)->Name,"Deep Sleep"))        
                {
                    Dest.DWord = ((((PCTARGETWND)pTargetWnd)->BuffTimer[i] / 1000) + 6)/6;
                    Dest.Type = pTicksType;
                    return true;
                }
            }
        }
        return false;

Then you need to add it in mq2datatypes.h.

Probably easier just to wait for it.
 
1. Lol so it's literally #chat chat. Thanks.

2. I haven't done my own compiles in a while, I'll take your advice and wait for it. In the meantime, looping isn't terrible.

Many thanks for your help!
 
One more thing I can't find: Is there a way to programmatically click off an aura? When my enchanter goes into burn support mode, I want him to click off the Twincast Aura and cast Amplifying Aura, then do the opposite when he gets the command to end burn support mode. Obviously the casting part is trivial, but is there a way to do a remove ${Me.Aura[1].Name} from the macro?
 
One more thing I can't find: Is there a way to programmatically click off an aura? When my enchanter goes into burn support mode, I want him to click off the Twincast Aura and cast Amplifying Aura, then do the opposite when he gets the command to end burn support mode. Obviously the casting part is trivial, but is there a way to do a remove ${Me.Aura[1].Name} from the macro?

I pulled this code snippet from Pete's bot.mac. It may have to be modified a bit to work correctly, but it may get you started:

Code:
/if (${Me.Buff[Shared Camouflage].ID}) /nomodkey /notify BuffWindow Buff${Math.Calc[${Me.Buff[Shared Camouflage].ID}-1].Int} leftmouseup
 
One more thing I can't find: Is there a way to programmatically click off an aura? When my enchanter goes into burn support mode, I want him to click off the Twincast Aura and cast Amplifying Aura, then do the opposite when he gets the command to end burn support mode. Obviously the casting part is trivial, but is there a way to do a remove ${Me.Aura[1].Name} from the macro?
Previously posted by Pete (I assume it still works):

Code:
                     /if (!${Window[AuraWindow].Open}) {
                        /squelch /windowstate AuraWindow Open
                        /delay 1s ${Window[AuraWindow].Open}
                     }
                     /notify AuraWindow AuraList listselect 1
                     /delay 5
                     /notify AuraWindow 0 contextmenu 1
                     }

htw
 
Makes perfect sense, I didn't think about simulating the clicks directly. Thanks to you both!
 
To see if you target has Deep Sleep, try this

${Target.Buff[Deep Sleep].ID}

That will return the buff slot as an integer. 0 if your target doesn't have the buff.