Spell Duration Timer / Warning

Got a cool macro idea? Wanna request a macro? Here is the place for you!

Moderator: MacroQuest Developers

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Spell Duration Timer / Warning

Post by Flea » Fri Dec 26, 2003 5:33 am

I couldn't find anything in other posts that did this, so here goes.

Would there ba a way to set a macro that would start timing upon cast of a spell such as Necromancer snare (Dooming Darkness, Cascading Darkness, etc etc) and at 30 seconds to wearing off give a warning in chat box. And also work on other spells as well (Such as Enchanter Mez, Fear spells). Would there have to be an individual macro for each spell, or would there be a way for the macro to assume full duration of casted_spell (no matter which it is) and give 30 sec warning?

Also, not sure if above mentioned would also include all buffs, not that I would necessarily want or not want it to include buff durations, just curious, and if there is a way around it to only include detrimental spells.

Thanks
-Flea

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri Dec 26, 2003 4:07 pm

This is a post in the macro depot by merkzu. It works similarly to what you are asking. I believe if you remove the sections I've marked in red it should do what you are asking.

Code: Select all

#event casting "You begin casting"

Sub Main
  /declare bufflist array
  /declare targlist array
  /declare timelist array
  /declare lastspel global
  /declare x global
  /declare y global
  /declare z global
  :loop
    /for x 0 to 20
      /if @timelist(@x)!="UNDEFINED-ARRAY-ELEMENT" /if n @timelist(@x)<$calc($time(h)*3600+$time(m)*60+$time(s)) {
        /echo .x( @bufflist(@x) is fading on @targlist(@x) )x.
        /varset timelist(@x) UNDEFINED-ARRAY-ELEMENT
      }
      /doevents
    /next x
  /goto :loop
/return

Sub Event_casting
  /varset y "$mid(18,$int($calc($strlen("@Param0")-19)),"@Param0")"
  /varset lastspel "@y"
  /if n $spell("@y",duration)<30 {
    /return
  }
[color=red]  /if $target(type)=="player" {[/color]

    /echo tracking @y on $target(name)
    /for z 0 to 20
      /if @timelist(@z)=="UNDEFINED-ARRAY-ELEMENT" {
        /varset bufflist(@z) "@y"
        /varset targlist(@z) $target(name)
        /varset timelist(@z) $calc($spell("@y",duration)+$calc($time(h)*3600+$time(m)*60+$time(s)-10))
   /return
      }
    /next z
    /echo BUFFLIST IS FULL
[color=red]  }[/color]
/return 

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Fri Dec 26, 2003 8:43 pm

So you meant for me to remove all this:

Code: Select all

  /if $target(type)=="player" { 

    /echo tracking @y on $target(name) 
    /for z 0 to 20 
      /if @timelist(@z)=="UNDEFINED-ARRAY-ELEMENT" { 
        /varset bufflist(@z) "@y" 
        /varset targlist(@z) $target(name) 
        /varset timelist(@z) $calc($spell("@y",duration)+$calc($time(h)*3600+$time(m)*60+$time(s)-10)) 
   /return 
      } 
    /next z 
    /echo BUFFLIST IS FULL 
  }
Ok, did that, getting this message when i /macro spelltimer.mac

The current macro has ended.
Variable name already defined.
Variable name already defined.
Variable name already defined.
Variable name already defined.

Any ideas?

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Fri Dec 26, 2003 9:26 pm

No.. I meant for you to get rid of only the stuff that is actually red.

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Fri Dec 26, 2003 10:29 pm

Ah thanks, was a bit confused there, works fine now, thanks :)

Just another question, would there be a way to account for Resists and OOR?

Flea
a lesser mummy
a lesser mummy
Posts: 55
Joined: Fri Dec 26, 2003 4:56 am

Post by Flea » Fri Dec 26, 2003 10:31 pm

--interrupted also, basically any time the spell doesnt finish casting / land on the mob like it should.

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Sat Dec 27, 2003 3:59 am

check out SpellCast.mac and/or SpellCast.inc to see how that is handled.

se7en
orc pawn
orc pawn
Posts: 21
Joined: Sun Dec 14, 2003 6:51 pm

Post by se7en » Sun Dec 28, 2003 5:52 am

Trying to figure out the timing on this, and I can't seem to make it warn me every 10 seconds from the 30 second count down... I know it does it once, but I'd prefer to see it a few times..

Also, if we're using mq2chatwnd, can we use color to echo back to us or is that only when you contain the code within a plugin itself?