help with druid macro please

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

help with druid macro please

Post by geostone » Mon Jul 05, 2004 9:34 am

could someone take a look at this code please and give me some help/pointers. what im trying to get it to do is keep buffs up and heal mt below 57%. this is a combo of two macros and im hoping someone will be kind enough to guide me a little. eventually im wanting to add a debuff and attack from the rear as well but im trying to stick with just two ideas at the moment.

Code: Select all

#event MeHit " hits YOU for " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Fizzle "Your spell fizzles!" 
#event SkinBuffs "#*#Your skin returns to normal#*#" 
#event SoE "#*#The spirit of eagle leaves you#*#" 
#event Regen "#*#You have stopped regenerating#*#"  
#event Fizzle "#*#Your spell fizzles#*#" 
#event Death "#*#You have entered#*#" 


Sub Main 
/declare Healpct int outer 57
/declare Fastheal string outer Nature's Infusion 
/declare Groupnum int outer 
/declare i int outer  
/declare Delay int outer 
/declare Casting string outer 

:chkevent 
   /doevents 
   /varset Groupnum ${Group} 
   | *** AutoHeal *** 
:Healcheck 
   /for i 1 to ${Group} 
      /if (${Group[${i}].PctHPs}<=${Healpct}) { 
              /if (${Group[${i}].PctHPs}<1) /goto :nextmember 
              /if (${Group[${i}].Class.Name.Equal["Warrior"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Paladin"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Shadow Knight"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Monk"]}) /goto :Tankheal 
         /doevents 
         /goto :CasterHeal 

:Tankheal 
          
             /target ${Group[${i}].Name} 
             /stand 
             /g CH on %t! 
             /varset Casting Karana's Renewal 
             /cast "Karana's Renewal" 
             /doevents 
             /varset Delay ${Math.Calc[${Spell[Karana's Renewal].MyCastTime}*10+10]} 
             /delay ${Delay} 
             /if (${Sit}==1) /sit 
             /goto :nextmember 
          

:Casterheal 
    
             /target ${Group[${i}].Name} 
             /stand 
             /g Quickheal on %t! 
             /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]} 
             /varset Casting ${Fastheal} 
             /cast "${Fastheal}" 
             /doevents 
             /delay ${Delay} 
             /if (${Sit}==1) /sit 
         } 
:nextmember 
      } 
   /next i 
   /goto :chkevent 
/return 

Sub Event_MeHit 
    /if (${Me.PctHPs}<=60 AND ${Me.PctHPs}>40) { 
                
                /target myself 
                /stand 
                /g Quickhealing %t! 
                /varset Casting Nature's Infusion 
                /cast "Nature's Infusion" 
                /doevents 
                /varset Delay ${Math.Calc[${Spell[Nature's Infusion].MyCastTime}*10+5]} 
                /delay ${Delay} 
              
          
    } else /if (${Me.PctHPs}<=40 AND ${Me.PctHPs}>25) { 
            /target myself 
            /stand 
            /g Fast Heal on %t! 
            /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]} 
            /varset Casting ${Fastheal} 
            /cast "${Fastheal}" 
            /doevents 
            /delay ${Delay} 
          
    } else { 
        /stand 
    }    
          
        
      
/return 

Sub Event_SoE 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast 8 
        /varset SpellCast 8 
   /delay 6s 
   /doevents Fizzle 
   /keypress esc 
/return 

Sub Event_Regen 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast 1 
   /varset SpellCast 1 
   /delay 8s 
   /doevents Fizzle 
   /keypress esc 
/return 

Sub Event_SkinBuffs 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast 2 
   /varset SpellCast 2 
   /delay 10s 
   /doevents Fizzle 
   /cast 3 
   /varset SpellCast 3 
   /delay 10s 
   /dovents Fizzle 
   /cast 5 
   /varset SpellCast 5 
   /delay 6s 
   /dovents Fizzle 
   /varset NeedBuff FALSE 
   /keypress esc 
/return 

Sub Event_Fizzle 
    /goto :Healcheck 
/return 

Sub Event_OutOfRange 
    /g %t your OOR! 
    /delay 1s 
/return 

Sub Event_Fizzle 
   /if (${SpellCast}==1) { 
   /keypress F1 
   /delay 1s 
   /cast 1 
   /varset SpellCast 1 
   /delay 8s 
   /doevents Fizzle 
   /keypress esc 
   } 
   /if (${SpellCast}==2) { 
   /keypress F1 
   /delay 1s 
   /cast 2 
   /varset SpellCast 2 
   /delay 10s 
   /doevents Fizzle 
   /keypress esc 
   } 
   /if (${SpellCast}==3) { 
   /keypress F1 
   /delay 1s 
   /cast 3 
   /varset SpellCast 3 
   /delay 10s 
   /doevents Fizzle 
   /keypress esc 
   } 
   /if (${SpellCast}==5) { 
   /keypress F1 
   /delay 1s 
   /cast 5 
   /varset SpellCast 5 
   /delay 6s 
   /doevents Fizzle 
   /keypress esc 
   } 
   /if (${SpellCast}==6) { 
   /delay 1s 
   /cast 6 
   /varset SpellCast 6 
   /delay 3s 
   /doevents Fizzle 
   } 
   /if (${SpellCast}==8) { 
   /keypress F1 
   /delay 1s 
   /cast 8 
   /varset SpellCast 8 
   /delay 6s 
   /doevents Fizzle 
   /keypress esc 
   } 
/return 

no credit given to original writers until i have it working smooth then i will post it in depot. thanks for any help you might give.

geo

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

Post by Fuergrissa » Mon Jul 05, 2004 10:55 am

What is it not doing for you ?
First off i would use an Inc for your spell handing get spell_routines or Spellcast ( Why re-invent the wheel)
also

Code: Select all

      
/if (${Group[${i}].PctHPs}<=${Healpct}) { 
/if (${Group[${i}].PctHPs}<1) /goto :nextmember 

/if (${Me.PctHPs}<=60 AND ${Me.PctHPs}>40) { 

} else /if (${Me.PctHPs}<=40 AND ${Me.PctHPs}>25) { 



i dont know if these are here because the board changed them or are in your routine but they need changing from < to < and > to >
[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]

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

so far

Post by geostone » Thu Jul 08, 2004 9:55 pm

this is what ive gotten so far with adjustments. sorry i havent made more progress but its got a little something to do with wife faction. still dont have the spell.inc figured in but so far it does pretty close to what i want it too. trying to figure out a way to keep bot9 on my group but it does an awesome job of keeping everyone healed. going to one day add in nuke if above a certain % mana and maybe throw in a debuff or two but since i use this in bot debuffs are not really needed but it may come in handy in other places i havent made it to yet. oh yes mainly stolen from druid heal macro which is mostly based off afk cleric and i dont remember where the buffs part came from so sorry bout that will keep better notes next time. also what is the varset needbuffs false for?

Code: Select all

#event MeHit " hits YOU for " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Fizzle "Your spell fizzles!" 
#event SkinBuffs "#*#Your skin returns to normal#*#" 
#event FoE "#*#The avian spirit leaves you#*#"   
#event Fizzle "#*#Your spell fizzles#*#" 
#event Death "#*#You have entered#*#" 
#event bracken "#*#The bracken falls away#*#"
#event might "#*#Your natural might fades#*#"

Sub Main 
/declare Healpct int outer 57
/declare Fastheal string outer Nature's Infusion 
/declare Groupnum int outer 
/declare i int outer  
/declare Delay int outer 
/declare Casting string outer 

:chkevent 
   /doevents 
   /varset Groupnum ${Group} 
   | *** AutoHeal *** 
:Healcheck 
   /for i 1 to ${Group} 
      /if (${Group[${i}].PctHPs}<=${Healpct}) { 
              /if (${Group[${i}].PctHPs}<1) /goto :nextmember 
              /if (${Group[${i}].Class.Name.Equal["Warrior"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Paladin"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Shadow Knight"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Monk"]}) /goto :Tankheal 
         /doevents 
         /goto :CasterHeal 

:Tankheal 
          
             /target ${Group[${i}].Name} 
             /stand 
             /g Inc 'Super Duid' Incomplete Heal on %t in 10 seconds stay close or die trying! 
             /varset Casting Karana's Renewal 
             /cast "Karana's Renewal" 
             /doevents 
             /varset Delay ${Math.Calc[${Spell[Karana's Renewal].MyCastTime}*10+10]} 
             /delay ${Delay}  
             /goto :nextmember 
          

:Casterheal 
    
             /target ${Group[${i}].Name} 
             /g Incoming 'Super Druid' quickheal on %t! 
             /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]} 
             /varset Casting ${Fastheal} 
             /cast "${Fastheal}" 
             /doevents 
             /delay ${Delay} 
             /if (${Sit}==1) /sit 
         } 
:nextmember 
      } 
   /next i 
   /goto :chkevent 
/return 

Sub Event_MeHit 
    /if (${Me.PctHPs}<=60 { 
                
                /target myself 
                /stand 
                /g Quickhealing 'Super Druid' %t! 
                /varset Casting Nature's Infusion 
                /cast "Nature's Infusion" 
                /doevents 
                /varset Delay ${Math.Calc[${Spell[Nature's Infusion].MyCastTime}*10+5]} 
                /delay ${Delay} 
              
          
    } else /if (${Me.PctHPs}<=40 AND ${Me.PctHPs}>25) { 
            /target myself 
            /stand 
            /g Fast Heal on %t! 
            /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]} 
            /varset Casting ${Fastheal} 
            /cast "${Fastheal}" 
            /doevents 
            /delay ${Delay} 
          
    } else { 
        /stand 
    }    
          
        
      
/return 

Sub Event_FoE 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast "Flight of Eagles"
   /delay 6s 
   /keypress esc 
/return

Sub Event_SkinBuffs 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast "Brackencoat" 
   /delay 6s 
   /varset NeedBuff FALSE
   /keypress esc 
/return 

Sub Event_might
 /keypress back
  /keypress F1
  /delay 1s
  /cast "Nature' Might"

Sub Event_bracken
 /keypress back
  /keypress F1
  /delay 1s
  /cast "Legacy of Bracken"


Sub Event_Fizzle 
    /goto :Healcheck 
/return 

Sub Event_OutOfRange 
    /g %t your OOR! 
    /delay 1s 
/return 


geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

Post by geostone » Sun Jul 11, 2004 1:17 pm

ok some returns were left out but the prob i have now is when i fizzle a spell my macro ends because it flows into another routine. can someone point this error out to me please? once i get this fizzle worked out hopefully i will be able to add some nuking to it.

Code: Select all

#event MeHit " hits YOU for " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Fizzle "Your spell fizzles!" 
#event SkinBuffs "#*#Your skin returns to normal#*#" 
#event FoE "#*#The avian spirit departs#*#"   
#event Fizzle "#*#Your spell fizzles#*#" 
#event Death "#*#You have entered#*#" 
#event bracken "#*#The bracken falls away#*#"
#event might "#*#Your natural might fades#*#"

Sub Main 
/declare Healpct int outer 57
/declare Fastheal string outer Nature's Infusion 
/declare Groupnum int outer 
/declare i int outer  
/declare Delay int outer 
/declare Casting string outer 

:chkevent 
   /doevents 
   /varset Groupnum ${Group} 
   | *** AutoHeal *** 
:Healcheck 
   /for i 1 to ${Group} 
      /if (${Group[${i}].PctHPs}<=${Healpct}) { 
              /if (${Group[${i}].PctHPs}<1) /goto :nextmember 
              /if (${Group[${i}].Class.Name.Equal["Warrior"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Paladin"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Shadow Knight"]}) /goto :Tankheal 
              /if (${Group[${i}].Class.Name.Equal["Monk"]}) /goto :Tankheal 
         /doevents 
         /goto :CasterHeal 

:Tankheal 
          
             /target ${Group[${i}].Name} 
             /stand 
             /g Inc 'Super Duid' Incomplete Heal on %t in 10 seconds stay close or die trying! 
             /varset Casting Karana's Renewal 
             /cast "Karana's Renewal" 
             /doevents 
             /varset Delay ${Math.Calc[${Spell[Karana's Renewal].MyCastTime}*10+10]} 
             /delay ${Delay}  
             /goto :nextmember 
          

:Casterheal 
    
             /target ${Group[${i}].Name} 
             /g Incoming 'Super Druid' quickheal on %t! 
             /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]} 
             /varset Casting ${Fastheal} 
             /cast "${Fastheal}" 
             /doevents 
             /delay ${Delay} 
             /if (${Sit}==1) /sit 
         } 
:nextmember 
      } 
   /next i 
   /goto :chkevent 
/return 

Sub Event_MeHit 
    /if (${Me.PctHPs}<=60 { 
                
                /target myself 
                /stand 
                /g Quickhealing 'Super Druid' %t! 
                /varset Casting Nature's Infusion 
                /cast "Nature's Infusion" 
                /doevents 
                /varset Delay ${Math.Calc[${Spell[Nature's Infusion].MyCastTime}*10+5]} 
                /delay ${Delay} 
              
          
    } else /if (${Me.PctHPs}<=40 AND ${Me.PctHPs}>25) { 
            /target myself 
            /stand 
            /g Fast Heal on %t! 
            /varset Delay ${Math.Calc[${Spell[${Fastheal}].MyCastTime}*10+25]} 
            /varset Casting ${Fastheal} 
            /cast "${Fastheal}" 
            /doevents 
            /delay ${Delay} 
          
    } else { 
        /stand 
    }    
          
        
      
/return 

Sub Event_FoE 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast "Flight of Eagles"
   /delay 6s 
   /keypress esc 
/return

Sub Event_SkinBuffs 
 /keypress back 
   /keypress F1 
   /delay 1s 
   /cast "Brackencoat" 
   /delay 6s 
   /keypress esc 
/return 

Sub Event_might
 /keypress back
  /keypress F1
  /delay 1s
  /cast "Nature's Might"
/return

Sub Event_bracken
 /keypress back
  /keypress F1
  /delay 1s
  /cast "Legacy of Bracken"
/return

[color=red]Sub Event_fizzle
 /goto :Healcheck
/return[/color]
Sub Event_OutOfRange 
    /g %t your OOR of the Super Druid! 
    /delay 1s 
/return 



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

Post by Fuergrissa » Sun Jul 11, 2004 2:34 pm

Yes i "Think" i see your problem, you are trying to use a :goto in a different sub, i would suggest using a

Code: Select all

Sub Event_fizzle 
/return DAMN_FIZZLE
then at the return point use an IF

Code: Select all

/if (${Macro.Return.Equal["DAMN_FIZZLE"]}) /goto :Healcheck
Please feel free to "Put me right" if i have given false information.
[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]

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

Post by geostone » Sun Jul 11, 2004 9:15 pm

thanks ill give it a shot

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

Post by geostone » Mon Jul 19, 2004 9:15 pm

thanks much as that seemed to fix my problem. i ran it all day sunday with no problems. now for my next question-- how do i sqeeze in an assist to the main tank and a dd spell if no one needs a heal and my mana is above a certain percent? ie if groupmember hp>75% and mymana>70 then cast dd spell. please forgive my questions as i only have like one day a week to read these forums and one day to test any changes due to wife faction hits. im trying my best to learn but being from alabama and living in oklahoma it seems i get dumberer every day. and please when giving help any explanations as to why you do what would be most helpful in my learning process. one big problem im having understanding is the structure of the macro. ie what parts run when. any explanations would be great.

as always thanks in advance for any help you may give.

geo

hiipii
a ghoul
a ghoul
Posts: 93
Joined: Sat Jun 19, 2004 5:01 pm

Post by hiipii » Mon Jul 19, 2004 11:03 pm

You are gonna wanna change these
#event MeHit " hits YOU for "
#event OutOfMana "Insufficient Mana to cast this spell!"
#event OutOfRange "Your target is out of range, get closer!"
#event Fizzle "Your spell fizzles!"
to..

Code: Select all

#event MeHit "#*#hits YOU for#*#" 
#event OutOfMana "#*#Insufficient Mana to cast this spell!#*#" 
#event OutOfRange "#*#Your target is out of range, get closer!#*#" 
#event Fizzle "#*#Your spell fizzles!#*#"

geostone
a lesser mummy
a lesser mummy
Posts: 78
Joined: Thu Oct 31, 2002 6:16 pm

Post by geostone » Sun Aug 15, 2004 10:10 am

ok i'm going to start this over from scratch. all ive come up with so far is an idea flow of sorts. ill post my whole thought process and ask that flaws be pointed out so i can learn.

1- what i want it to do
a- check buffs
b- heal
c- nuke
d- forage
e- assist tank and melee


2- sub main
group heal check->call heal
mana check->call nuke
ability ready forage->call forage
melee->call melee
do events (idea is to have buff check be event driven)

sub heal
check group hp
if %hp<57 and distance<200 cast natures infusion
if distance>200 next group member

if me mana>75 target mob cast summers flame
possibly add in the melee portion here

sub forage
if me mount=true /dismount
do ability forage /autoinventory (keep everything)
cast tan rope bridle

sub melee
target tank
/assist (attack on assist off)
if tank target hp<95 /attack
(would like to be able to stick behind mob somehow)

now is this the correct thought process? i think i can scrounge through all the available macros and come up with most of this (but any help would be obviously greatly appreciated). also the sub main runs constantly and when conditions are met it calls appropriate sub, right? and could the subs be turned into .inc files so that they could be used with other macros and called when needed.

IronMaiden
decaying skeleton
decaying skeleton
Posts: 7
Joined: Thu Jul 15, 2004 5:47 pm

.

Post by IronMaiden » Mon Aug 16, 2004 9:35 am

Mq2MoveUtils plugin works well for sticking.