Chanter AE Stun for PBAE Group (My first macro-Don't laugh!)

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Chanter AE Stun for PBAE Group (My first macro-Don't laugh!)

Post by Process » Thu Aug 05, 2004 11:32 pm

Code: Select all

Sub Main 
   :loop 
   /cast 1 
   /cast 2
   /cast 3
   /cast 4	
   /delay 4 
   /goto :loop 
/return
I 8 box 8 characters in a PBAE group (3 wizards, one enchanter, one cleric, one warrior, one shaman, one bard). So, I made a macro that would chain cast my four color stun spells in slots 1-4.

I'm sure this macro could be improved upon. It works great in it's simplicity, but the ability to trigger and pause the macro via a chat channel would be nice, however that is far beyond my expertise (Or lack thereof).

If someone felt like being really kind and adding chat channel control to start and stop the macro, I would be very appreciative.

It's not that I haven't RTFM, it's that I am ignorant when it comes to the more advanced coding required to write even the simplest of macros (I just don't seem to "get it".).

Thanks,

Process

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Fri Aug 06, 2004 12:12 am

here's a small example. to turn on auto stun just do /echo AutoStun on, and /echo AutoStun off, to turn it off.

Code: Select all

#include spell_routines.inc

#event AutoStun "[MQ2] AutoStun #1#"

Sub Main
   /declare useStun int outer 0
:loop
   /if ( ${useStun} ) {
      /call Cast "Color Slant"
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux"
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Shift"
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux"

      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Skew"
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux"

   }
   /doevents
   /goto :loop
/return

Sub Event_AutoStun(string line,string toggle)
   /if ( ${toggle.Equal[on]} ) {
      /varset useStun 1
   } else {
      /varset useStun 0
   }
/return

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Fri Aug 06, 2004 11:06 am

Why not have it automatically start when there are more than a certain number of mobs around the chanter? Add something like this to the main loop of rusty's macro.

Code: Select all

/if (${SpawnCount[npc radius 50]}>3) {
   /varset UseStun 1
} else {
   /varset UseStun 0
}

Mimatas
a hill giant
a hill giant
Posts: 262
Joined: Wed Mar 10, 2004 4:22 pm

Post by Mimatas » Fri Aug 06, 2004 11:51 am

may be good.. may not. He may want to start casting earlier/later than 3 mobs... he also may have 3 mobs around him while running, etc... so casting would be worthless.

Definitely a cool trick tho... I think I'll use that snippit in another macro of mine :)

User avatar
SukMage
a ghoul
a ghoul
Posts: 88
Joined: Fri Jun 04, 2004 5:08 pm

Post by SukMage » Fri Aug 06, 2004 4:04 pm

Rusty's example would mean you have to switch to each toon to /echo though...

I don't have time right now to grab the snipet from genbot but I know you could add the listen to group or chat channel ability from taking a snipet from there.

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

This macro looks great, but I can't get it to work yet

Post by Process » Fri Aug 06, 2004 4:15 pm

I tried the macro you wrote Rusty. I named it "rustyae.mac". I started the macro, then I typed in "/echo AutoStun on" and it started up. After it started, my enchanter casted one spell before the macro errored out with the following message:

Code: Select all

[MQ2] autostun on
[MQ2] Casting: Color Slant
Docommand - Couldn't parse #event AutoStun "[MQ2]Autostun #1#"
rustyae.mac@3 (Event_BeginCast):#event AutoStun "[MQ2]AutoStun#1#"
spell_routines.inc@294 (Cast(string spellName,string spellType,timer giveUpTimer,string mySub)):/doevents Recover
rustyae.mac@9(Main): /call Cast"Color Slant"
Flow ran into another subroutine.
rustyae.mac@5 (Main): Sub Main
spell_routines.inc@294 (Cast(string spellName,string spellType,timer giveUpTimer,string mySub)):/doevents Recover
rustyae.mac@9 (Main): /call Cast"Color Slant"
The current macro has ended.
Do you have any ideas on what is wrong with it? It looks much better than mine, but it has some error in it (Or maybe I'm not running it correctly?). Also, is there a way to modify it so that someone can send a tell to the person running the macro in order to start/stop the AutoStun sequence?

Thanks for all the responses : )

Process
Rusty~ wrote:here's a small example. to turn on auto stun just do /echo AutoStun on, and /echo AutoStun off, to turn it off.

Code: Select all

#include spell_routines.inc

#event AutoStun "[MQ2] AutoStun #1#"

Sub Main
   /declare useStun int outer 0
:loop
   /if ( ${useStun} ) {
      /call Cast "Color Slant"
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux"
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Shift"
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux"

      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Skew"
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux"

   }
   /doevents
   /goto :loop
/return

Sub Event_AutoStun(string line,string toggle)
   /if ( ${toggle.Equal[on]} ) {
      /varset useStun 1
   } else {
      /varset useStun 0
   }
/return

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Fri Aug 06, 2004 5:16 pm

not sure what's causing your problem. make sure you have the latest version of spell_routines.inc

just copy and pasted the code i wrote above into a macro and tested it and works fine.

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Fri Aug 06, 2004 5:31 pm

Rusty's example would mean you have to switch to each toon to /echo though...
this was just an example really. can easily change the event around to be triggered through tells or chat channels... replace the "privatechannel" with the name of the channel you wanna use to command the bot.

Code: Select all

#event AutoStun "[MQ2] AutoStun #1#"
#event AutoStun "#2# tells you#*#'AutoStun #1#'"
#event AutoStun "#2# tells |${channel}|#*#'AutoStun #1#'"

Sub Main 
   /declare useStun int outer 0 
   /declare channel string outer privatechannel
| .... rest of code 

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Thanks Rusty

Post by Process » Sat Aug 07, 2004 1:02 am

Well Rusty, your suggestion proved correct. I didn't realize my version of spellroutines.inc was out of date. Sorry about that. After I got the new version, it worked perfectly...That is, until I added this to the beginning of the macro:

Code: Select all

#event AutoStun "[MQ2] AutoStun #1#" 
#event AutoStun "#2# tells you#*#'AutoStun #1#'" 
#event AutoStun "#2# tells |${channel}|#*#'AutoStun #1#'" 

Sub Main 
   /declare useStun int outer 0 
   /declare channel string outer privatechannel 
| .... rest of code
After adding it, the macro errored out again. I know I'm probably annoying you by now, but is this the correct macro:

Code: Select all

#event AutoStun "[MQ2] AutoStun #1#" 
#event AutoStun "#2# tells you#*#'AutoStun #1#'" 
#event AutoStun "#2# tells |${channel}|#*#'AutoStun #1#'" 

Sub Main 
   /declare useStun int outer 0 
   /declare channel string outer privatechannel 
#include spell_routines.inc 

#event AutoStun "[MQ2] AutoStun #1#" 

Sub Main 
   /declare useStun int outer 0 
:loop 
   /if ( ${useStun} ) { 
      /call Cast "Color Slant" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Shift" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 

      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Skew" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 

   } 
   /doevents 
   /goto :loop 
/return 

Sub Event_AutoStun(string line,string toggle) 
   /if ( ${toggle.Equal[on]} ) { 
      /varset useStun 1 
   } else { 
      /varset useStun 0 
   } 
/return
I suspect I have somehow errantly added the two together. If you could bare with me just a bit longer and show this n00b what he's doing wrong, that would be great.

If not, I will appreciate what you've already done. Thanks so much for the AE Stun macro :smile:

Process

dman
a hill giant
a hill giant
Posts: 181
Joined: Fri Dec 05, 2003 12:54 pm

Post by dman » Sat Aug 07, 2004 2:34 am

remove the second

Code: Select all

Sub Main 
   /declare useStun int outer 0 

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Sat Aug 07, 2004 10:53 am

this would be the full code, heh. yeah i just meant to add the rest of the code under that line.

Code: Select all

#include spell_routines.inc 

#event AutoStun "[MQ2] AutoStun #1#"
#event AutoStun "#2# tells you#*#'AutoStun #1#'"
#event AutoStun "#2# tells |${channel}|#*#'AutoStun #1#'"

Sub Main 
   /declare useStun int outer 0 
   /declare channel string outer privatechannel
:loop 
   /if ( ${useStun} ) { 
      /call Cast "Color Slant" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 
      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Shift" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 

      /if ( ${Macro.Return.Equal[CAST_NOTREADY]} ) /call Cast "Color Skew" 
      /if ( ${Macro.Return.Equal[CAST_INTERRUPTED]} ) /call Cast "Color Flux" 

   } 
   /doevents 
/goto :loop 

Sub Event_AutoStun(string line,string toggle,string sender) 
   /if ( ${toggle.Equal[on]} ) { 
      /varset useStun 1 
   } else { 
      /varset useStun 0 
   } 
/return

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Thanks again

Post by Process » Sun Aug 08, 2004 1:33 am

Rusty, you have been so patient and helpful. I really appreciate it. If you could endure me just a little longer, I have one last question (hopefully).

Your code works flawelessly, but I can't seem to get the macro to work via private tells ingame. I sent my enchanter a tell saying, "AutoStun on", I tried "AutoStun" only, and many variations yet the macro would not start.

This is the last piece of information I need to make this macro work perfectly for me. Is there some setting within the macro that I need to edit in order for it to recognize the incoming tell message?

Thanks so much,

Process

Rusty~
a hill giant
a hill giant
Posts: 244
Joined: Wed Apr 14, 2004 2:55 pm

Post by Rusty~ » Sun Aug 08, 2004 3:21 am

hmmm you have the macro running on the bot before you send the tell right?
just /tell bot AutoStun on? if that still doesnt work. you can try changing the line

Code: Select all

#event AutoStun "#2# tells you#*#'AutoStun #1#'" 
to

Code: Select all

#event AutoStun "#2# tells you, 'AutoStun #1#'" 
and see if that works? and did the chat channel work?

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Sun Aug 08, 2004 10:07 am

That event won't catch tells sent through the chat channel server (;tell someone hiya) since they will show up as "xxx told you".Maybe that's it?

Process
a lesser mummy
a lesser mummy
Posts: 73
Joined: Fri Jun 25, 2004 5:30 pm

Thanks again

Post by Process » Sun Aug 08, 2004 11:16 am

Both the chat channel, and server ;tells are working perfectly now (Thanks for the tip on ;tells coming through as "told you" instead of "tells you" - I had no idea.).

Thanks so much Rusty. And BlueNinja, thanks for the tip about server ;tells.

I'm truly grateful for the help.

Process