Can't get buff timer macro to work

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Can't get buff timer macro to work

Post by Draimen » Sun Jan 25, 2004 3:21 pm

I am trying to use the following macro:

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
I start the macro /macro buff (name of the file is buff.mac) and I get nothing.

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.

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

Post by ml2517 » Sun Jan 25, 2004 3:29 pm

I'm not seeing anything in the code that would inform you when you actually cast the buff. Just when the buff is wearing off.

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Sun Jan 25, 2004 3:54 pm

I am sure it tells you when you cast the buff because like I said, it worked one time. Maybe I am just losing my mind.

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

Post by ml2517 » Sun Jan 25, 2004 4:08 pm

ah sorry missed the second echo. Yeah its there.

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Sun Jan 25, 2004 4:19 pm

so any clue why I am getting no messages? Is there a filter I turned on somehow? I typed /macrofilter none, no luck.

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

Post by ml2517 » Sun Jan 25, 2004 4:41 pm

No clue, looked through the code and I don't see anything wrong with it. Make sure in EQ that you are seeing "You begin casting" messages. If you aren't you probable have them filtered in EQ.

Also, are you using mq2chatwnd? Can you see output when you do this?

/echo blah

Draimen
a lesser mummy
a lesser mummy
Posts: 69
Joined: Sun Jan 25, 2004 3:13 pm

Post by Draimen » Sun Jan 25, 2004 5:29 pm

ahh, I found the problem. This macro doesn't work with spelltext hack turned on. Turned it of and boom, got the cast message for the macro.

Thanks for the help =)