Page 1 of 1

Pet_Buff_Duration snippet

Posted: Mon Aug 15, 2005 3:00 am
by Jon100
This snippet of code is equivelent to ${Me.PetBuffDuration}. After the call you can get the result from the variable ${Macro.Return}

Hope it helps some.

Jon100

Code: Select all

Sub Pet_Buff_Duration(string buffname)

   /if (${Me.PetBuff[${buffname}]}==0) /return 0

   /declare buffslot int local 0
   /declare tooltip string local
   /declare buff_ticks int local 0

   /varset buffslot ${Math.Calc[${Me.PetBuff[${buffname}]}-1]}
   /varset tooltip ${Window[PetInfoWindow].Child[PIW_PetBuff${buffslot}_Button].Tooltip}
   /varset tooltip ${tooltip.Right[6].Left[5]}
   /varset buff_ticks ${Math.Calc[((${tooltip.Left[2]}*60)+${tooltip.Right[2]})/6]}

/return ${buff_ticks}

Posted: Mon Aug 15, 2005 1:43 pm
by KokoNutz
My bald spot thanks you. :)

Posted: Mon Aug 15, 2005 1:56 pm
by fearless
Some slight modifications

Code: Select all

Sub Pet_Buff_Duration(string buffname)

   /if ( !${Me.PetBuff[${buffname}]} ) /return 0

   /declare buffslot int local 0
   /declare tooltip string local
   /declare buff_ticks int local 0

   /varcalc buffslot ${Me.PetBuff[${buffname}]}-1
   /varset tooltip ${Window[PetInfoWindow].Child[PIW_PetBuff${buffslot}_Button].Tooltip}
   /varset tooltip ${tooltip.Right[6].Left[5]}
   /varcalc buff_ticks ( ( ${tooltip.Left[2]}*60 ) + ${tooltip.Right[2]} ) / 6

/return ${buff_ticks} 

Posted: Mon Aug 15, 2005 8:45 pm
by Night Hawk

Code: Select all

/if ( !${Me.PetBuff[${buffname}]} ) /return 0
Is this tested? I'm just wondering, because I recall that ${Me.PetBuff["buffname"]} doesn't return a BOOL value, therefor messing up the check. /shrug

I just know that my hud has:

Code: Select all

${If[${Me.PetBuff["buffname"]}>0,pet buffed,pet not buffed]}
because I was having trouble just using !${Me.PetBuff}.... but this this was awhile ago.


Also, I'd suggest just using the TLO ${Me.PetBuffTime} posted in the development forum anyhow.

Posted: Mon Aug 15, 2005 10:16 pm
by fearless

Code: Select all

/if ( ${Me.Pet.ID} && !${Me.PetBuff[Augmentation of Death]} && ${Me.Pet.Distance}<100 ) {
  /call Cast "Augmentation of Death" gem8 
}
Is known working as I use it on a daily basis in my SK macro.