Lazy Ranger self buff

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

eqrangerguy
orc pawn
orc pawn
Posts: 20
Joined: Tue Mar 08, 2005 10:01 am

Lazy Ranger self buff

Post by eqrangerguy » Mon Dec 26, 2005 11:12 pm

Ok, so I've been perusing the boards for a lil while, and can't seem to find quite what I'm looking for. It could be that I'm just not searching the right words, or maybe I didn't see what I needed in someone else's work. What I'm looking for is essentially a macro to check the buffs that are on me, and if any that are part of a set group are missing, to recast them from either a clicky item or from a gem. It's not something I want running full time, just a thing I run once then it ends so I can stay buffed without hassle.

If someone knows either the right place to look for a heads up on this, or has something like it already written, please point me in the right direction. Thanks in advance.

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Tue Dec 27, 2005 7:11 am

i have not written any Macros here for a while but im sure you could rip enough to make this real easy,

if all you want to do is check buffs then this logic will work.

Code: Select all

   /if (!${Me.Buff[BuffName].ID}) { 
   /cast item "buffitem" 
   /delay 4s 
   }

/if (!${Me.Buff[BuffName].ID}) { 
   /cast "buffspell" 
   /delay 4s 
   }
You will need a "Main" but thats about it and also include one of the working spell routines as in Inc

Code: Select all

#include SpellCast.inc



Sub Main
    
     
   /if (!${Me.Buff[BuffName].ID}) { 
   /cast item "BuffItem" 
   /delay 4s 
   }
   
      /if (!${Me.Buff[BuffName].ID}) { 
      /cast "Buffspell" 
      /delay 4s 
   }
/return
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Tue Dec 27, 2005 8:19 am

With the built in stacking logic you can just do:

Code: Select all

/if (${Spell[BuffName].Stacks}) { 
And it will only try buffing if you don't have another buff of the same spell line on you. Of course that's still not smart enough to check if you even have any free buff slots, but you didn't ask for that. If you want to just do self buff, AutoBot in VIP does that just fine, and also allows you to configure your self buffs so that you will always leave a couple buff slots open for AEs, HoTs, etc.
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

eqrangerguy
orc pawn
orc pawn
Posts: 20
Joined: Tue Mar 08, 2005 10:01 am

Post by eqrangerguy » Tue Dec 27, 2005 11:28 am

Thank you for the snippets guys, much appreciated. I'll look into VIP access on the first when Im not in the negative with my bank :P

I gotta learn what exactly those words mean/do, so its off to the manual for me, so I can make it work for me.

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Tue Dec 27, 2005 2:20 pm

Needs updated but here is an inc I use for my ranger in the macros I run

Code: Select all

#Event Bufffade  "#*#The avian presence departs.#*#"
#Event Bufffade  "#*#The avian spirit departs.#*#"
#Event Bufffade  "#*#The rage subsides#*#"
#Event Bufffade  "#*#The electrical energy fades from your weapons.#*#"
#Event Bufffade  "#*#Your skin returns to normal.#*#"
#Event Bufffade  "#*#Your features return to normal#*#"
#Event Bufffade  "#*#The savage spirits depart#*#"
#Event Hastefade "#*#The quickening spirit departs#*#"


Sub buffs
/squelch /declare needswap int outer 0
/declare BuffSlot int local
/if (${Bool[${Me.Buff[Brell's Stalwart Shield]}]}) {
   /varcalc BuffSlot ${Me.Buff[Brell's Stalwart Shield].ID}-1
   /notify BuffWindow Buff${BuffSlot} leftmouseup
   }
/if (${Bool[${Me.Buff[Spiritual Vigor]}]}) {
   /varcalc BuffSlot ${Me.Buff[Spiritual Vigor].ID}-1
   /notify BuffWindow Buff${BuffSlot} leftmouseup
   }
/if (${Me.Buff["Eagle Eye"].Duration}<30) /call Cast "Eagle Eye"
/if (${Me.Buff[Aura of Rage].Duration}<30) /call Earringbuff
/if (${Me.Buff[Call of Lightning].Duration}<30) /call Cast "Call of Lightning"
/if (${Me.Buff[Ward of the Hunter].Duration}<60) /call Cast "Ward of the Hunter"
/if (${$wantregen}==1 && ${Me.Buff[Hunter's Vigor].Duration}<60) {
/target myself
/call Cast "Hunter's Vigor"
/keypress TAB
}
/if (${Me.Buff[Mask of the Stalker].Duration}<30) /call Cast "Mask of the Stalker"
/if (${Me.Buff[Savage Guard].Duration}<30) {
/if (${InvSlot[ranged].Item.Name.NotEqual[Serrated Dart of Energy]}) {
/declare Currentranged string outer
/varset needswap 1
/varset Currentranged ${Me.Inventory["Ranged"]}
/exchange "Serrated Dart of Energy" ranged
}
/call Cast "Serrated Dart of Energy" item
/delay 3
/if (${needswap}==1) {
/exchange "${Currentranged}" ranged
}
/if (${Defined[needswap]}) /squelch /deletevar needswap
/if (${Defined[Currentranged]}) /squelch /deletevar Currentranged
}
/if (${Me.Buff[Vengeful Guard].Duration}<30) {
/itemnotify back rightmouseup
/delay 10
}

/return

Sub Haste
/if (${Me.Buff[Captain Nalots Quickening].Duration}<30) {
/exchange "Eyepatch of Plunder" face
/call Cast "Eyepatch of Plunder" item
/exchange "Mask of Strategic Insight" face
/delay 2
/itemnotify face rightmouseup
}
/return


Sub Event_Bufffade
/stick pause
/delay 2
/call Buffs
/delay 2
/stick unpause
/return

Sub Event_Hastefade
/squelch /declare combat int local 0
/stick pause
/call Haste
/delay 2
/stick unpause
/return

Sub Earringbuff
/exchange "Fabled Shrunken Goblin Skull Earring" rightear 
/delay 10
/itemnotify rightear rightmouseup
/delay 10
/exchange "Earring of Corporeal Essence" rightear
/delay 10
/itemnotify rightear rightmouseup
/return

eqrangerguy
orc pawn
orc pawn
Posts: 20
Joined: Tue Mar 08, 2005 10:01 am

Post by eqrangerguy » Tue Dec 27, 2005 2:59 pm

Very nice... A little tweaking to fix that to my level and gear and it should do exactly what I want it to. I'm not good yet at following all the loops and whatnot, but when it swaps an item to do a clicky cast, does it swap back?

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Tue Dec 27, 2005 4:57 pm

Goof-

An event driven rebuffing routine has got to be one of the craziest things I have ever seen.

Anyway, if you weren't able to piece things together from the above responses, here's a simple and quick way to handle self buffs:

Code: Select all

|Automated Self Buffing Macro
|v0.1
|When you run this macro it will automatically recast 
|any buffs that have less then 30 seconds left on them.


|You need spell_routines.inc for this which is found in the VIP forums.
#include spell_routines.inc

Sub Main
|To use this for spells, replace SpellBuffName 
|with the name of the Spell that you want to keep on you.
|For example, a Shadowknight would want to keep his 
|cloak spell on at all times so the line below becomes
|/if (${Me.Buff[Cloak of Luclin].Duration}<30 && ${Spell[Cloak of Luclin].Stacks}) /call cast "Cloak of Luclin" gem1 10s
|Repeat this line for as many buffs as you want that come from spells.

/if (${Me.Buff[SpellBuffName].Duration}<30 && ${Spell[SpellBuffName].Stacks}) /call cast "SpellBuffName" gem1 10s

|To use this for items, replace ItemBuffName with the 
|name of the Buff that results from clicking your item.
|For example, if you want to keep Grim Aura on you at 
|all times from your Shrunken Goblin Skull Earring
|the line below becomes
|/if (${Me.Buff[Grim Aura].Duration}<30 && ${Spell[Grim Aura].Stacks}) /call cast "Shrunken Goblin Skull Earring" Item 10s

/if (${Me.Buff[ItemBuffName].Duration}<30 && ${Spell[ItemBuffName].Stacks}) /call cast "ItemName" Item 10s

|To use this for alternate abilities, replace AltBuffName 
|with the name of the Buff that results from casting your AA.
|For example, if you want to keep Unholy Steed on you 
|at all times from your Unholy Steed AA the line below becomes
|/if (${Me.Buff[Unholy Steed].Duration}<30 && ${Spell[Unholy Steed].Stacks}) /call cast "Unholy Steed" alt 10s

/if (${Me.Buff[AltBuffName].Duration}<30 && ${Spell[AltBuffName].Stacks}) /call cast "AltName" alt 10s

/return
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

eqrangerguy
orc pawn
orc pawn
Posts: 20
Joined: Tue Mar 08, 2005 10:01 am

Post by eqrangerguy » Tue Dec 27, 2005 7:21 pm

Very nice. Guess I'll be waiting till the 1st to donate and get in VIP for that inc :P Thanks for the hard work there guys.

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Wed Dec 28, 2005 12:12 pm

I never said I wasn't crazy. But it is event driven so that I don't check all the buffs each loop of whatever macro I throw it into.. I can just check all events or a specific buff event when I want to in the macro.

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Dec 28, 2005 1:05 pm

Goofmester1 wrote:I never said I wasn't crazy. But it is event driven so that I don't check all the buffs each loop of whatever macro I throw it into.. I can just check all events or a specific buff event when I want to in the macro.
You do realize that doing /if ({!Me.Buff[Somebuff]}) /blah will take infinitely less time then running a /doevents, particularly when you are in a spammy environment.

You could make the macro significantly faster by not having it event driven.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

A_Druid_00
Macro Maker Extraordinaire
Posts: 2378
Joined: Tue Jul 13, 2004 12:45 pm
Location: Rolling on the Lawn Farting

Post by A_Druid_00 » Wed Dec 28, 2005 1:18 pm

Fearless's version won't quite work as intended anyway. The check would have to be something like:

Code: Select all

/if ((${Me.Buff[SpellBuffName].Duration}<10 && ${Me.Buff[SpellBuffName].ID}) || ${Spell[SpellBuffName].Stacks}) /call cast "SpellBuffName" gem1 10s 
.Stacks returns false when you have the buff up already, so in the original post, it would only cast the spell if it had worn off. This way it will cast if you have the buff and there's less than 10 ticks left until it wears off, or you don't have the buff and no other buffs that would block it are on you. In fact, I think I have this check screwed up in Autobot, BBL to take my own advice!
[quote]<DigitalMocking> man, A_Druid_00 really does love those long ass if statements
<dont_know_at_all> i don't use his macro because i'm frightened of it[/quote]
[quote][12:45] <dont_know_at_all> never use a macro when you can really fuck up things with a plugin[/quote]

xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Lazy Ranger self buff

Post by xyilla » Mon Jun 30, 2025 8:37 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Lazy Ranger self buff

Post by xyilla » Mon Jun 30, 2025 8:38 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Lazy Ranger self buff

Post by xyilla » Mon Jun 30, 2025 8:39 am


xyilla
naggy
naggy
Posts: 29514
Joined: Sun Feb 23, 2025 5:36 am

Re: Lazy Ranger self buff

Post by xyilla » Mon Jun 30, 2025 8:40 am