Goto page 1, 2  Next General Quick question...
Reply
Quick question...
I imagine this isn't possible, but who knows?

Is there a way that one can monitor the chat to fire off a macro on a certain phrase? Kinda like Audio Triggers but that will run a macro?

Thanks
R
Thu Oct 17, 2013 3:55 pm
You mean verbal chat?

I'm not aware of one, I started to write a plugin that would do it and it was a mess and required the user to install a bunch of crap. It was more effort than it was worth.
Thu Oct 17, 2013 4:51 pm
Project Lead
Ya, verbal chat. I didn't think there was anything, but thanks for confirming it for me. I will have to think this over and see if I can come up with something.

R
Fri Oct 18, 2013 12:51 am
You could have a macro running on a different char that looks for an event of the chat that would send a command to a char to start a different macro.
/bct Char //macro Newmacro
Fri Oct 18, 2013 8:42 am
Listen to This Guy
Neat idea.. how does one monitor the chat tho?

Also, many things that come across chat are character dependent. Say I wanted to set a macro to run when a pet buff expired. I can set an audio trigger of course to alert me that I need to manually do it, but if I wanted to make a macro run off of the event, can this be done?

Or, say.. I have a charmed pet. And the pet breaks charm. And on the break of that charm, I want the magician to coth me immediately or I am dead. (I am not as fast as I used to be :-) Just trying to come up with some ideas to give you an example, I am sure I will come up with more ways to use this if it proves possible.

I imagine this would entail using /doevents. However, I am not really sure how this works. If one could point me to something that explains it better than what I have read already? Or if I am wrong on that, explain?

Thanks guys
R
Fri Oct 18, 2013 10:27 am
Here is an example (untested but looks right) of using event based chat.

Macro
More +

| Ultrax 2013-10-18
| Chat macro switch using BCCMD


#Chat tell
#Chat group
#Chat say
#Chat rsay

#Turbo 20

#event SwitchMacro "#*#Enter Some Phrase Here#*#"

/declare CharName string outer EnterCharNameHereToTellTo
/declare MacroName string outer EnterMacroNameHere

Sub Main
        /cleanup
        /delay 5
       
        :MainLoop
                /doevents
                /delay 2s
                /goto :MainLoop
/return



Sub Event_SwitchMacro
        /BCT ${CharName} //macro ${MacroName}
        /delay 1s
/return



/endmacro
Fri Oct 18, 2013 11:05 am
Listen to This Guy
Thanks Ultrax.. Playing with it now. This might be just what I was looking for!!
Fri Oct 18, 2013 12:57 pm
Or you can also make a hotkey on the char that you are using to fight with. When you see something bad is gonna happen, you can hit a hotkey to CoTH you.

Macro
More +
/bct Char //Target ID ${Me.ID}
/pause 10
/bct Char //casting "Call of the Hero|gem8" -maxtries|5


**edited the bct line
Last edited by ultrax on Fri Oct 18, 2013 9:10 pm; edited 1 time in total
Fri Oct 18, 2013 1:18 pm
Listen to This Guy
Yes, already have those set up. Quite useful! But what I am looking for is to be able to run a bot group and have the bots be able to make decisions to do things pretty autonomously. At the moment, I have a s#it load of different macros that I launch from my main tank. I have my cleric running afcleric macro. Then depending on the situation, I can run pets, casters and melee toons all from my tank. But I would like to be able to make them all a little more intelligent. Typically I am running 12 characters, and keeping track of them the more difficult the content gets is getting more difficult, lol. So I am just trying to see what else I can do with MQ2.

So, while I was doing some testing, I ran a little macro based on the snip that you put up. Basically, it just watches the text and if a phrase pops up, it tells another toon to run a macro. But is there anyway to keep that macro running on said toon and be able to run another macro and continue to have the original macro running? Do I set something like that up with a different type of event? I am still not too clear on all I can do with events. Would I set up a separate event in the main macro to intercept a command to run a macro and then use a 'call' command to run the macro and return to the original?

Sorry, been a long time since I have done any serious coding and I am finding the documentation for this sometimes less than complete. But I really appreciate your help. Thanks much!

Hmm.. is it even possible to run a macro from inside a continuously running macro? Looks like calling a macro ends whatever macro calls it. I'd just have to restart the original calling macro from the end of the macro called? Bah, sorry for the circles, lol. Is there a better way to do this?

Thanks again
Fri Oct 18, 2013 2:47 pm
Just integrate it into your macro.

Chat, events, and declares go above the Sub Main.
Copy / Paste the Sub Event_SwitchMacro into the bottom of your mac.
Make sure you have /doevents in the most common loop / loops of your macro.


-- You could also set up additional events to trigger other Sub Events besides the 1 also or to flip back to your main macro...
Fri Oct 18, 2013 7:55 pm
Listen to This Guy
I was thinking you meant you wanted to verbally command your toons, like with you mouth :)

That last bit ultras said about integrating it as a sub is the answer to you problem. Instead of macro switching you merge them all into one macro with multiple routines and the routines are chat event triggered by commands and environment spam.

I'm on my phone ill find a good example for you later today when I'm at keyboard.
Sat Oct 19, 2013 7:24 am
Project Lead
Ha! Sorry for the confusion Maudigan. Now that I look back through it, I see what you mean. Doh! Ya, I meant the chat channels in the game. I suppose I could have made that more clear, even after you asked me.. I guess I had tunnel visioned my way in there.

Thanks for all your help guys. I am kinda getting this now and headed in the right direction. But any examples of this sort that you can throw my way would be very much appreciated.

Cheers
R
Sat Oct 19, 2013 11:05 am
Okay, so here is our example, I chopped up an old macro that I used to use. Hopefully I got out all the remnants of the things removed but maybe not. The point should still come across. I used this one because I went nuts with comments in it, and there is an example of chat fired events (EVENTS), non chat fired subs(SUBS), and chat modulated commands(COMMANDS).

Macro
More +
#turbo

|'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|   EVENTS
|'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#event invite "#1# invites you to join a group."
#event zoned "LOADING, PLEASE WAIT..."


|'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|   COMMANDS
|'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#event follow "<#1#> FOLLOW,#3#,#2#"
#event stop "<#1#> STOP,#2#"


sub Main
|''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
| VVV      VV     AA    RRRRRRR   IIII       AA     BBBBBBB   LLLL    EEEEEEE   SSSSSS
|  VV      V     AAA     RR   RR   II       AAA      BB   BB   LL      EE      SSS   SS
|   VV    V     AA A     RRRRRR    II      AA A      BBBBBB    LL      EEEE      SS
|    VV  V     AA   A    RR  R     II     AA   A     BB   BB   LL      EE         SSS
|     VVV     AA AA  A   RR   R    II    AA AA  A    BB   BB   LL      EE      SS   SSS
|      VV    AAA     AA RRR   RR  IIII  AAA     AA  BBBBBBB   LLLLLLL EEEEEEE   SSSSSS
|''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

        |TRACKS DELAY IN BOTCHAT RECONNECT
        /declare bctimer timer outer

        |BOT CHAT VARIABLES
        /if (!${Ini[MaudBot.ini,All,BCAddress].Length}) /ini "MaudBot.ini" "All" "BCAddress" "127.0.0.1"
        /declare BCADDRESS string outer  ${Ini[MaudBot.ini,All,BCAddress]}
        /if (!${Ini[MaudBot.ini,All,BCPort].Length}) /ini "MaudBot.ini" "All" "BCPort" "2112"
        /declare BCPORT string outer  ${Ini[MaudBot.ini,All,BCPort]}


|'''''''''''''''''''''''''''''''''''''''''''''''''
|  MMMM   MMM         AA       IIII    NNNN  NNN
|   MM M M M         AAA        II      NNN   N
|   MM  M  M        AA A        II      NN N  N
|   MM     M       AA   A       II      NN  N N
|   MM     M      AA AA  A      II      NN   NN
|  MMMM   MMM    AAA     AA    IIII    NNNN  NNN
|'''''''''''''''''''''''''''''''''''''''''''''''''

        :Loop

                |MAKE SURE IM IN BOTCHAT STILL
                /call bccheck

                /doevents
        /goto :Loop
/return



|'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|  EEEEEEE  VVV      VV EEEEEEE  NNNN  NNN TTTTTTTT   SSSSSS
|   EE       VV      V   EE       NNN   N     TT     SSS   SS
|   EEEE      VV    V    EEEE     NN N  N     TT       SS
|   EE         VV  V     EE       NN  N N     TT        SSS
|   EE          VVV      EE       NN   NN     TT     SS   SSS
|  EEEEEEE       VV     EEEEEEE  NNNN  NNN   TTTT     SSSSSS
|'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


        |'''''''''''''''''''''''''''''
        |  Invite player
        |'''''''''''''''''''''''''''''
        sub Event_invite
          |ACCEPT ALL GROUP INVITES    
          /invite
        /return


        |''''''''''''''''''''''''''''
        |   IM DEAD!
        |''''''''''''''''''''''''''''
        sub event_slain
            |LET THE HUD KNOW THAT I DIED
            /bc ZONED,${Me}
        /return



|'''''''''''''''''''''''''''''''''''''''''
|   SSSSSS   UUUU  UU  BBBBBBB    SSSSSS  
|  SSS   SS   UU   U    BB   BB  SSS   SS
|    SS       UU   U    BBBBBB     SS
|     SSS     UU   U    BB   BB     SSS
|  SS   SSS   UU   U    BB   BB  SS   SSS
|   SSSSSS     UUUU    BBBBBBB    SSSSSS
|'''''''''''''''''''''''''''''''''''''''''


        |''''''''''''''''''''''''''''''''''''''
        |   CHECKS TO MAKE SURE IM IN BOT CHAT
        |''''''''''''''''''''''''''''''''''''''
        sub bccheck
                |IF CONNECTED RETURN
                /if (${EQBC.Connected}) /return

                |IF DELAY TIMER ISNT UP RETURN
                /if (${bctimer}) /return
               
                /bccmd connect ${BCADDRESS} ${BCPORT}
                /varset bctimer 20s
        /return



|''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|    CCCC      OOOO    MMMM   MMM  MMMM   MMM      AA    NNNN  NNN  DDDDDD     SSSSSS
|  CCC   C   OOO   O    MM M M M    MM M M M      AAA     NNN   N    DD   D   SSS   SS
| CCC       OOO     O   MM  M  M    MM  M  M     AA A     NN N  N    DD    D    SS
| CCC       OOO     O   MM     M    MM     M    AA   A    NN  N N    DD    D     SSS
|  CCC   C   OOO   O    MM     M    MM     M   AA AA  A   NN   NN    DD   D   SS   SSS
|   CCCCC     OOOOO    MMMM   MMM  MMMM   MMM AAA     AA NNNN  NNN  DDDDDD     SSSSSS
|''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


        |'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        |  TURNS MY FOLLOW ON
        |'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        sub Event_follow

                |IS THIS FOR ME?
                /if (!${Param2.Equal[${Me}]}&&!${Param2.Equal[All]}) /return

                |CANT FOLLOW MYSELF
                /if (${Param3.Equal[${Me}]}) /return
               
                |IS MY TARGET IN ZONE?
                /if (!${Spawn[${Param3} PC].ID}) /return


                |CLEAR MY TARGET
                /target clear
                /delay 2s !${Target.ID}
                /if (${Target.ID}) {
                        /bc I can't clear my current target
                        /return
                        }
               
                |GET MY TARGET
                /target PC ${Param3}
                /delay 2s ${Target.Name.Equal[${Param3}]}
                /if (${Target.Name.NotEqual[${Param3}]}) {
                        /bc I can't find my follow target
                        /return
                        }

                |TURN NETFOLLOW ON
                /netfollow on
                /delay 2s ${NetAdvPath.Following}
                /if (!${NetAdvPath.Following}) {
                        /bc I can't turn NetAdvPath on
                        /return
                        }
               
                |DOUBLE CHECK PLUGIN GOT RIGHT TARGET
                /if (${NetAdvPath.Monitor.Name.NotEqual[${Param3}]}) {
                        /bc Plugin seems to have wrong target
                        /netfollow off
                        /return
                        }

                |BROADCAST FOLLOW
                /bc Following ${Param3}.       
        }
        /return

        |'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        |  stops follow/attack/cast/move
        |'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        sub Event_stop
                |IS THIS FOR ME?
                /if (!${Param2.Equal[${Me}]}&&!${Param2.Equal[All]}) /return
               
                |TURN AUTOATTACK OFF
                /if (${atk}) /varset atk 0
               
                |SHUT MOVEUTILS DOWN
                /if (${Stick.Status.NotEqual[OFF]}) /stick off

                |STOP CASTING
                /if (${Me.Casting.ID}) /interrupt
               
                |STOP FOLLOWING
                /if (${NetAdvPath.Following}) /netfollow off

                |TURN ATTACK OFF
                /if (${Me.Combat}) /attack off

                |IF MOVING THEN STOP
                /if (${Me.Moving}) {
                        /keypress forward
                        /keypress back
                        /keypress strafe_left
                        /keypress strafe_right
                        }
        /return




The events/commands are setup in the first few lines using the #event listener for both. You'll see the "EVENTS" are triggered by being invited to join a group or the zoneing message. Those call the two functions that are under the EVENTS header further down. One just makes you accept the invite, the other just tells everyone else in bot chat that you zoned.

The commands are setup right below, they are formatted to be triggered by botchat stuff. So if I wanted Maudigan to follow Ultrax, I could--from any character--send a botchat message of "FOLLOW,Maudigan,Ultrax". That may seem a tad contrived... unatural; it was meant to be used with a program that had follow keys for every character. You'd want something easier to type or to set on hotkeys. Anyway, every character recieves the command, but they check to see if that 2nd name is their's, if not they ignore it. There is also an example of a stop command that makes you quit doing a bunch of different things.

Lastly, there is a sub, and I distinguished that as something that isn't triggered by the environment or chat, but just something that gets run constantly. So if you look under the MAIN section you'll see the the sub "bccheck" get's called non stop.

SO! what this is all getting at is--and this is up to you--instead of having a bunch of separate macro's that you make your character run with hotkeys, or perhaps make them swap macros based off environmental triggers, you just make each one of those macro's a sub program in 1 larger macro. Those subs can then be triggered without any fancy macro swapping by one of these 3 methods (constantly,command,environmental event).
Sat Oct 19, 2013 12:28 pm
Project Lead
I think there might be an extra } in the follow routine... this may not work, but hopefully it'll function as a demonstration
Sat Oct 19, 2013 12:31 pm
Project Lead
word to the wise, if you decide to go this route, start small. Make one that has like a sit command and get that working first. Then start adding your other routines in 1 at a time and test it each step of the way. Nothing worse then slapping together 900 lines of code and then discovering it doesn't work.
Sat Oct 19, 2013 12:34 pm
Project Lead
Goto page 1, 2  Next General Quick question...
Reply