Buff Tracking macro

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

merkzu
a ghoul
a ghoul
Posts: 99
Joined: Wed May 14, 2003 2:08 pm

Buff Tracking macro

Post by merkzu » Thu Nov 27, 2003 4:57 pm

Someone had asked me on irc to post my buff tracker, so here it is. It will track the buffs you cast on people and tell you when they are fading. It only tracks buffs casted on players (not NPC's) that are over 30 seconds long:

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
  }
  /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
  }
/return