Updated My Canni Script : Lag Proof

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

Moderator: MacroQuest Developers

MoonRaverX
a ghoul
a ghoul
Posts: 91
Joined: Tue Dec 16, 2003 5:09 pm
Location: Tampa, Fl

Updated My Canni Script : Lag Proof

Post by MoonRaverX » Tue May 11, 2004 4:00 am

Well, as lag proof as you can get. 8)

Setup is straightforward, it can use any spells you tell it, and heals itself. Also has support for Canni5, which is easily turned off.

Suggestions and ideas always welcome, though this is daily life tested working.

Edit: Changed global to outer for new system.

Code: Select all

| Title     : Canni
| Filename  : Canni.mac
| Release   : 2.0
| Date      : 5/11/04
| Author    : MoonRaver

| Auto Canni and Heal
| Canni5 Support
| Lag proof as possible

| Requires this...
#include SpellCast.inc

Sub Main

|-----------------------------------------------------------
| Set your spells and thresholds here...
|-----------------------------------------------------------
|  Your Canni spell name
   /declare cCanni  string outer "Cannibalize IV" 
|-----------------------------------------------------------
|  Your Heal spell name.
   /declare cHeal   string outer "Quiescence"     
|-----------------------------------------------------------
|  At what percent hp to stop canni, and start a heal.
   /declare cHealAt int    outerl 50 
|-----------------------------------------------------------
|  At what percent mana to stop the macro.
   /declare cCannTo int    outer 90 
|-----------------------------------------------------------

|-----------------------------------------------------------
| For those with Canni 5...
|-----------------------------------------------------------
|  Set this 1 to use it, 0 if you don't want it to.
   /declare cUseAA  int    outer 1    
|-----------------------------------------------------------
|  This is the minimum hp at which you will activate Canni5.
   /declare cMinHP  int    outer 3000 
|-----------------------------------------------------------


:loopstart
   /if ( ${Me.PctHPs}<${cHealAt}  ) /call CastHeal
   /if ( ${Me.PctMana}>${cCannTo} ) /call AllDone
   /if ( ${cUseAA} && !(${Me.AltAbilityTimer[Cannibalization]}) ) /call BigCan
   /if ( ${Me.PctMana}<${cCannTo} ) /call CastCanni

   /doevents
   /delay 1
   /goto :loopstart

/endmacro

Sub BigCan
   :tryagain
   /if ( ${Me.MaxHPs}<${cMinHP} ) {
      /deletevar cUseAA
      /declare cUseAA int outer 0
      /echo Your MaxHP is less than you set as minimum. Will not use Canni5 right now.
      /return
   }
   /if ( ${Me.CurrentHPs}<${cMinHP} && ${Me.MaxHPs}>${cMinHP} && !${Me.Buff[${cHeal}].ID} ) /call CastHeal
   /if ( ${Me.CurrentHPs}<${cMinHP} && ${Me.MaxHPs}>${cMinHP} ) /goto :tryagain
   /sit off

   /declare cA string local ${Me.CurrentHPs}
   /declare cB string local ${cA}

   /alt activate ${AltAbility[Cannibalization].ID}
   
   :WaitFinish
   /varset cB ${Me.CurrentHPs}
   /if ( !${cB.Equal[${cA}]} ) /goto :WaitFinish
   
   /deletevar cA
   /deletevar cB

   /if ( !${Me.Buff[${cHeal}].ID} ) /call CastHeal
   
   /sit on
   /delay 1
/return

Sub CastCanni
   :tryagain
   /if (!${Me.SpellReady[${cCanni}]}) /goto :tryagain
   /sit off
   
   /call Cast ${cCanni}

   /if ( ${Macro.Return.Equal["CAST_RESTART"]} ) /goto :tryagain
   /if ( ${Macro.Return.Equal["CAST_SUCCESS"]} ) /goto :success
   /call ErrorTrap

   :success
   /sit on
   /delay 1
/return

Sub CastHeal
   :tryagain
   /if (!${Me.SpellReady[${cHeal}]}) /goto :tryagain
   /if ( ${Me.Buff[${cHeal}].ID} ) /goto :success
   /sit off
   /target myself
   
   /call Cast ${cHeal}

   /if ( ${Macro.Return.Equal["CAST_RESTART"]} ) /goto :tryagain
   /if ( ${Macro.Return.Equal["CAST_SUCCESS"]} ) /goto :success
   /call ErrorTrap

   :success
   /sit on
   /if ( ${Me.PctHPs}<${cHealAt} ) /goto :success
   /delay 1
/return

Sub ErrorTrap
   /echo Something went wrong with casting. Killing macro now.
   /delay 1
/endmacro

Sub AllDone
   /sit off
   /echo Cannidance Complete.
   /delay 1
/endmacro
Last edited by MoonRaverX on Wed May 12, 2004 12:36 am, edited 2 times in total.
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Tue May 11, 2004 4:53 am

Haven't tested it, but I was wondering why you are using global variables instead of outer variables:

MoonRaverX
a ghoul
a ghoul
Posts: 91
Joined: Tue Dec 16, 2003 5:09 pm
Location: Tampa, Fl

Post by MoonRaverX » Tue May 11, 2004 6:11 am

it's from how i had my old one set up... would it be better to switch? (used to c style globals that work between functions)
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"

3x
orc pawn
orc pawn
Posts: 20
Joined: Sun Jan 25, 2004 12:54 am

Post by 3x » Tue May 11, 2004 6:21 am

Use outer, global variables are kept stored long as mq is running. outer variables are kept long as macro is running (which is the old global)

MoonRaverX
a ghoul
a ghoul
Posts: 91
Joined: Tue Dec 16, 2003 5:09 pm
Location: Tampa, Fl

Post by MoonRaverX » Wed May 12, 2004 12:38 am

fixed global/outer guess i missed the change of them, any other poking you can do? or did i finally figure out how to work out a nice clean macro?
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"

3x
orc pawn
orc pawn
Posts: 20
Joined: Sun Jan 25, 2004 12:54 am

Post by 3x » Thu May 13, 2004 2:46 am

Was using this macro and got beat on past my % where it was supposed to stop canni and heal, but it didn't heal.. just kept on going. Would have died but I noticed with 5% hp left :p

MoonRaverX
a ghoul
a ghoul
Posts: 91
Joined: Tue Dec 16, 2003 5:09 pm
Location: Tampa, Fl

Post by MoonRaverX » Thu May 13, 2004 9:51 pm

not sure why, first check is if your hp are below whatever amoun t you set... should see your hp under and heal, same for if you start the macro with say, 30%hp, it'll heal itself up first... i have no problems
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"