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
If I type /macro buff again I get "Variable name already defined" 4 times.
I can end macro and it says it ends, and I can pause macro while it is running and it says it is paused, so I think the macro is running, but I get no text when I cast a buff on someone.
It did work the very first time I tried it lol.
I may be running it wrong, I dunno. I have read the manual a few times and also searched on here but can't find if I am doing something wrong.
Any help would be great.

