Page 1 of 1

Buff Check/Recast

Posted: Mon Apr 25, 2005 8:56 am
by leptoid
I am trying to get an answer to this without having to spend a month like last time making it so I hope someone could help.. it'll be benificial to more than me.

I am looking for the lines of code I would have to insert into the hunter mac to check and see if a buff has faded. If it has, then I'd like it to recast it. I think I have the recast part figured out cause the creator already has one example of a healing cast in there. However, I want to add a subroutine for checking and recasting buffs.

If anyone could help, I'd appreciate it.

Posted: Mon Apr 25, 2005 10:17 am
by fearless

Code: Select all

/if ( !${Me.Buff["Shroud of Chaos"].ID} && !${Me.Casting.ID} ) /call Cast "Shroud of Chaos" gem8

Posted: Mon Apr 25, 2005 10:19 am
by pw
Try this. I can't claim credit for it .. and I can't remember where I stole it from either.

First, you need some stuff in your main to store what buffs you want.

Code: Select all

   /declare RV_SummonPetRange   int outer  250 
   /declare RV_NumberOfBuffs int outer 2 
   /declare RV_MyBuffs[${RV_NumberOfBuffs}] string outer 
   /declare RV_NumberOfPetBuffs int outer 1 
   /declare RV_PetBuffs[${RV_NumberOfPetBuffs}] string outer 
   /declare RV_PetSpellName string outer "Legacy of Zek" 

   |Buffs to be kept up on self 
   /varset RV_MyBuffs[1] "Shield of the Arcane" 
   /varset RV_MyBuffs[2] "Force Shield" 

   |Buffs to be kept up on pet    
   /varset RV_PetBuffs[1] "Rune of Death" 

Then, inside your main loop, make a call to a function like maintainbuffs in a part where you are not fighting.

Code: Select all

  ...
   /call maintainbuffs 
  ...

And finally, the buffing function:

Code: Select all

|-------------------------------------------------------------------------------- 
|SUB: MaintainBuffs 
|-------------------------------------------------------------------------------- 
Sub MaintainBuffs 
/declare PetBuffLoop    int inner  0 
/declare MyBuffLoop    int inner  0 
/declare iCount int 1 
/declare tmp 
/doevents 
   /for MyBuffLoop 1 to ${RV_NumberOfBuffs} 
      /if (!${Me.Buff[${RV_MyBuffs[${iCount}]}].ID}) { 
         /target ${Me} 
         /call Cast ${RV_MyBuffs[${iCount}]} gem7
         /delay 1s 
         /if (${iCount}==5) /delay 20s 
         /doevents 
      } 
      /varcalc iCount ${iCount}+1 
   /next MyBuffLoop 

   /varset iCount 1 

   |If we have pet, make one      
   /if ( !${Me.Pet.ID} ) { 
         /echo Creating new pet 
         /call Cast ${RV_PetSpellName} gem7
         /delay 1s 
         /target ${Me.Pet.Name} 
         /call Cast "Tiny companion"  gem7
   } 
    
      
   /if ( ${Me.Pet.Distance}>${RV_SummonPetRange}) { 
        /echo Summoning pet. Its range is ${Me.Pet.Distance} 
        /call Cast "Summon Companion" gem7
        /delay 1s    
   } 
   /for PetBuffLoop 1 to ${RV_NumberOfPetBuffs} 
      /if (!${Me.PetBuff[${RV_PetBuffs[${iCount}]}]}) { 
         /target ${Me.Pet.Name} 
         /call Cast ${RV_PetBuffs[${iCount}]} gem7
         /delay 1s 
         /doevents 
      } 
      /varcalc iCount ${iCount}+1 
   /next PetBuffLoop 
/keypress esc 
/return 

Posted: Mon Apr 25, 2005 10:34 am
by A_Druid_00
I like the CheckBuffs sub from RaidDruid. I'm kind of partial cuz I made it (albeit with a lot of comparing different self buff routines here on the boards) though. This code also uses an ini where you can define up to 10 different self buffs that are items, spells, or AAs. It also uses my Indoors checking code which is event driven so that you don't try to chain cast things like SoW when you're in a zone that you can't cast in. It's probably a lot more than you were looking for, but it's very very easy to customize for multiple characters using the same routine.

Code: Select all

Sub CheckBuffs 
/declare i        int local 
/declare a        int local 
/declare MyTarget int local 
/if (${RDPause} && ${SelfBuffTotal} && ${SelfBuffs} && !${SelfBuffTimer} && !${Me.Moving} && !${Me.Casting.ID} && (!${SitTimer} || ${Me.Gem[${SelfBuff[${i}]}]} || ${Me.Mount.ID})) { 
  /for i 1 to ${SelfBuffTotal} 
  /call CheckGroup 
  /if (${Me.Buff[${SelfBuffIcon[${i}]}].Duration}<10 && ${Me.CountBuffs}<=${SelfBuffCount[${i}]}) { 
    /for a 1 to 20 
    /if (${SelfBuffBlock[${i}].Find[${Me.Buff[${a}].Spell}]}) /goto :NextSelfBuff 
    /next a 
    /if (!${Outdoors} && !${SelfBuffIndoors[${i}]}) /goto :NextSelfBuff 
    /varset MyTarget ${Target.ID} 
    /squelch /target myself 
    /if (${ReportSelfBuffs} && !${SpamTimer}) /${ChatChannel} Buffing myself with ${SelfBuff[${i}]} 
    /varset SpamTimer ${SpamDelay} 
    /if (${SelfBuffGem[${i}].Equal[item]}) { 
      /call Cast "${SelfBuff[${i}]}" item 1s Check4Pad 
    } else /if (${SelfBuffGem[${i}].Equal[alt]} && ${Me.AltAbilityReady[${SelfBuff[${i}]}]}) { 
      /call Cast "${SelfBuff[${i}]}" alt 1s Check4Pad 
    } else /if (${Me.CurrentMana}>${Spell[${SelfBuffID[${i}]}].Mana}) { 
      /call Cast "${SelfBuff[${i}]}" ${SelfBuffGem[${i}]} 1s Check4Pad 
    } 
    /target id ${MyTarget} 
  } 
  :NextSelfBuff 
  /next i 
  /varset SelfBuffTimer ${SelfBuffRecheck} 
} 
/return 

Posted: Mon Apr 25, 2005 10:36 am
by leptoid
sweet! I'll try those out later on today after work. thanks for the help! :P

Posted: Mon Apr 25, 2005 10:45 am
by A_Druid_00
You'll have to dig around my RaidDruid code a bit to pull out all the associated code involved in my little snippet, FYI

Posted: Mon Apr 25, 2005 5:40 pm
by Night Hawk
And I shall recommend something like this:
http://macroquest2.com/phpBB2/viewtopic.php?t=9903

which can easily be changed into a Sub.

If your just worrying about one buff however, I would go with something of the above.

Posted: Tue Apr 26, 2005 12:46 am
by leptoid
it'll actually be for about 6 buffs. I should invest some time in the game and get the master buff to replace all those things. lol

Awesome Product Website

Posted: Fri Aug 25, 2023 6:25 pm
by FrankJScott
Please Google it! before posting

Best Natural Nutri Supplements Blog

Posted: Sat Aug 26, 2023 10:32 am
by FrankJScott
In response to the people inquiring about turmeric curcumin with bioperine 1500mg, fermented turmeric supplement, peanut butter meal replacement smoothie, traditional medicinals turmeric with meadowsweet & ginger, delicious meal replacement smoothies, lean1 chocolate smoothie king, I highly recommend this top tumeric black pepper capsules url or healthy smoothies as meal replacements, cheapest collagen supplement, cheap and effective pre workout, cheap good quality whey protein, nutri advanced contact number, turmeric curcumin supplement with black pepper, on top of this best natural nutri vitamins link and don't forget turmeric and pepper, best keto shake mix, best meal replacement uk, organic turmeric curcumin pills, turmeric black pepper and apple cider vinegar, adreset nutri advanced, alongside all this new natural nutri supplements tips which is also great. Also, have a look at this top rated tumeric black pepper capsules tips not to mention turmeric vitality organic turmeric with organic black pepper & ginger, turmeric capsules with ginger and black pepper, nutrigain plus, apple cider vinegar turmeric and black pepper, good meal replacement smoothies, enagic kangen ukon pills, not to mention this recommended natural nutri vitamins site on top of nutri c plus, curcuma with black pepper, meal replacement shakes smoothie king, nutri advanced nac, meal replacement smoothie mix, best shakes for keto diet, on top of top rated natural nutri supplements link which is also worth a look. I also recommend this awesome tumeric black pepper capsules advice not to mention ready made diet shakes uk, nutri master calcium plus, green smoothie meal replacement, nutri slim garcinia cambogia, global healing turmeric with black pepper, inexpensive whey protein powder, not to mention this useful shake meal replacements details alongside all affordable vitamins and supplements, replacement for protein powder in smoothies, the best weight loss shakes uk, nutri dyn fruits and greens, turmeric curcumin supplement with black pepper, wholistic turmeric, as well as awesome tumeric black pepper capsules forum on top of buy vitamins online cheap, turmeric ginger black pepper tea, best meal replacement smoothie king, curcumin bioperine, cheap lean protein powder, cvs turmeric curcumin with black pepper, which is also great. Finally, have a look at this high rated tumeric black pepper capsules advice with nutri advanced vitamin d3 with k2, ebay turmeric and black pepper, smoothie king meal replacement powder, viva naturals organic turmeric curcumin ginger tablets, nutri advanced adrenomax, nutriwest dsf, for good measure. Check more @ Awesome Tumeric Black Pepper Capsules Blog 1ac75_0