canny.mac

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Soultrapper
orc pawn
orc pawn
Posts: 28
Joined: Thu Apr 22, 2004 1:30 pm

canny.mac

Post by Soultrapper » Sun May 09, 2004 4:59 pm

Requires spellcast.inc

Code: Select all

| canny.mac
| Version 1.1
| Written by Soultrapper
| Some code sniplets borrowed from GenBot [LordGiddion]
| Edited 05/13/04 - removed the timers, thanks to Skye and Chill for suggestions
| Spell names for sHoTSpell and sCanniSpell may have to be changed depending on the level of the shaman

#include spellcast.inc 

sub Main 
	/declare CanniSpell string outer "Cannibalize IV" 
	/declare sHoTSpell string outer "Quiescence"
    
	:MainLoop 
		/if (${Me.PctHPs}<=70 && !${Me.Buff[${sHoTSpell}].Duration}) { 
|			/echo "Casting ${sHoTSpell}" 
			/target myself 
			/call Cast ${sHoTSpell}
		} 
		/if (${Me.PctMana}>98) { 
			/echo "mana good, exiting" 
			/return 
		} 
		/call CheckCann 
	/goto :MainLoop 
/return 

Sub CheckCann 
	/if (!${Me.Moving}) {
		/if (${Me.AltAbilityReady["Cannibalization"]} && ${Me.PctMana}<75 && ${Me.CurrentHPs}>2900) { 
			:cani5 
|			/echo "AA Cani 5" 
			/call cast ${AltAbility["Cannibalization"].ID} activate
			/return 5
		} else { 
			/if (${Me.PctMana}<=98) { 
				/if (${Me.PctHPs}>=40) { 
					:cani4 
|					/echo "Casting ${CanniSpell}"  
					/call Cast ${CanniSpell} 
					/return 4 
				} 
			} 
		} 
	} 
/return
Last edited by Soultrapper on Thu May 13, 2004 5:19 am, edited 2 times in total.

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Post by wilso132 » Sun May 09, 2004 6:46 pm

You'll also need to change ${Me.CurrentHPs}>2900 depending on how low you want your hp to get.

Skye
a lesser mummy
a lesser mummy
Posts: 33
Joined: Thu Jan 08, 2004 10:17 pm

Post by Skye » Mon May 10, 2004 10:29 pm

Just as a point of reference, you can make use of:

Code: Select all

${Me.AltAbilityTimer[Cannibalization]}
and:

Code: Select all

/alt activate ${AltAbility[Cannibalization].ID}
and:

Code: Select all

${AltAbility[Cannibalization].Spell.CastTime}
to remove timers and other "magic numbers" from this macro.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Tue May 11, 2004 11:06 am

using the same ideas as Skye, here is a sample macro I suggested for someone else:

Code: Select all

#include spellcast.inc 

sub Main 
   /declare CanniSpell string outer "Cannibalize IV" 
    
   :MainLoop 
      /if (${Me.PctHPs}<=80 && !${Me.Buff["Quiescence"].Duration}) { 
         /echo "Casting Quiescence" 
         /target myself 
         /call Cast "Quiescence" 
      } 
      /if (${Me.PctMana}>97) { 
         /echo "mana good, exiting" 
         /return 
      } 
      /call CheckCann 
   /goto :MainLoop 
/return 

Sub CheckCann 
   /if (!${Me.Moving}) { 
      /if (${Me.AbilityReady["Cannabalization"]}) { 
         /if (${Me.PctMana}<80) { 
            /if (${Me.CurrentHPs}>2900)) { 
               :cani5 
               /echo "AA Cani 5" 
               /call cast "47" activate 
               /return 5 
            } 
         } 
      } 

      /else { 
         /if (${Me.PctMana}<97) { 
            /if (${Me.PctHPs}>=40) { 
               :cani4 
               /echo "Casting " & ${CanniSpell} 
               /call Cast ${CanniSpell} 
               /return 4 
            } 
         } 

      } 
   }
You can add in checks for your elixers again if you wish, but this should do away with the need for timer variables and events.

other basic change is that I broke out the big compound if statement into nested if statements.

Soultrapper
orc pawn
orc pawn
Posts: 28
Joined: Thu Apr 22, 2004 1:30 pm

Post by Soultrapper » Thu May 13, 2004 5:09 am

Will ${Me.AltAbilityReady["Cannibalization"]} take care of the case if the shaman doesn't have Canny 5? I would assume it does, since I'm guessin it will return NULL ie false. In this case this is just perfect, I put an extra boolean in my old code that I was gonna post as an update wheter to use Canny 5 or not, but this is a much nicer solution in that case.

Chill, can't bust up the if codes like that, at least not for the Canny 5 condition, so had to put them back together. If you're over 80% mana (in your code, or 70% in mine) and Canny 5 AA just happens to pop, the code will just "hang". It won't enter into the canny 5 condition, nor the canny 4 one.

Oh I almost forgot, Wilso, the 2900 I put in there as a "magic number" figuring ~1k hps should be enough to avoid blood aggro, but guess you're right, if someone feels that's not enought, or too much, that could be changed as well.

shuttle
a lesser mummy
a lesser mummy
Posts: 62
Joined: Mon Nov 11, 2002 6:08 am

Post by shuttle » Fri May 14, 2004 12:57 pm

Nicely done Soultrapper

shuttle

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Wed Jun 30, 2004 8:23 pm

Does this just cast canni over and over, or does it do a "proper" canni dance? EG. Sit and watch mana tick up and at that moment stand and cast canni and sit again until next mana tick up?

Not so important if over lvl 60 with canni 4, but noticiable difference in the lower end.

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Fri Jul 02, 2004 7:58 pm

My shammy only up to 35 but thinking ahead.

How does this look Soultrapper?
-Added couple more variables for easier personalization
-Adjusted the canni check logic
-Added an optional "cani dance" paramater to make the macro sit between casts and wait for mana to "tic up". Default is off.
-Added a couple checks to exit early if you change your target

Code: Select all

|cani.mac: a simple cani macro
|usage:    /mac cani [sit]

#include spellcast.inc 

sub Main
   /declare CanniSpell  string outer "Cannibalize IV"
   /declare HealSpell   string outer "Quiescence"
   /declare MinHP    int outer 2900
   /declare HealHP   int outer 80
   /declare C5Mana   int outer 80
   /declare MaxMana  int outer 97
   /declare SitStand int outer 0
   /declare MyMana   int outer

   /if (${Param0.Equal[sit]}) /varset SitStand 1

   /target myself 

   :MainLoop
      /if (${Target.ID}!=${Me.ID}) /return
      /if (!${Me.Moving} && ${Me.PctHPs}<=${HealHP} && !${Me.Buff["${HealSpell}"].Duration}) { 
         /echo Casting ${HealSpell}
         /call Cast "${HealSpell}"
      }
      /if (${Target.ID}!=${Me.ID}) /return
      /if (!${Me.Sitting} && ${SitStand}) /sit
      /varset MyMana ${Me.PctMana}
      /if (${MyMana}>=${MaxMana}) { 
         /echo mana good, exiting
         /return 
      } 
      /if (!${Me.Moving} && ${Me.CurrentHPs}>${MinHP}) {
         /if (${Me.AbilityReady["Cannabalization"]} && ${MyMana}<${C5Mana}) {
            /call cast "47" activate 
         } else /if (${MyMana}<${MaxMana}) {
            /call Cast ${CanniSpell}
         }
      }
      /if (${Target.ID}!=${Me.ID}) /return
      /if (${SitStand}) {
         /if (!${Me.Sitting}) /sit
         /varset MyMana ${Me.PctMana}
         /delay 6s ${MyMana}!=${Me.PctMana}
      }
   /goto :MainLoop

/return
(untested)

What you guys think?

s16z
a ghoul
a ghoul
Posts: 97
Joined: Thu Apr 01, 2004 12:03 pm

Post by s16z » Fri Jul 02, 2004 10:36 pm

Instead of using a % level to heal at, use the heal amount, i.e. say your heal is 2k, then:

Code: Select all

/declare HealFor int outer 2000

... code here, till we get to ...
/if (${Math.Calc[${Me.MaxHPs}-${Me.CurrentHPs}]}>${HealFor}) {
    /cast healing spell here.

Also throw in a check, like you did, for a duration type heal so you don't cast it over and over again.