Advanced Canni

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

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

Advanced Canni

Post by MoonRaverX » Fri Dec 19, 2003 12:48 am

Just added a few toys, haven't bug tested with new toys. Here goes...

Edited: Corrected functions using /call Main instead of /return

Code: Select all

| Canni.mac
| Autocanni and heal for a 65 with Q and C4
| Usage: /macro canni.mac
|   Parameters...
|   help   - Display this information
|   noheal - Canni and dont stop. Good for slow groups with a cleric healing you.
|   nostop - Do not end the canni loop when you are done. It will continue to 
|   .        loop and canni as necissary to keep you up on mana.
|   nosit  - Perform basic, but do not sit between casts. 
|   Note: Noheal will still heal if you hit 35%, there is some sanity to it. 
|
| Brought to you by MoonRaverX


| Used for all my spell macros. 
#include SpellCast.mac

|Main Loop
Sub Main

   /declare Canni_nosit  global
   /declare Canni_noheal global
   /declare Canni_nostop global

   /varset Canni_nosit  0 
   /varset Canni_noheal 0 
   /varset Canni_nostop 0 

|  Lets check out paramters. 
   /if "@Param0"=="help"   /call Canni_Syntax 

   /if "@Param0"=="nosit"  /varset Canni_nosit  1 
   /if "@Param0"=="noheal" /varset Canni_noheal 1 
   /if "@Param0"=="nostop" /varset Canni_nostop 1 

   /if "@Param1"=="nosit"  /varset Canni_nosit  1 
   /if "@Param1"=="noheal" /varset Canni_noheal 1
   /if "@Param1"=="nostop" /varset Canni_nostop 1 

   /if "@Param2"=="nosit"  /varset Canni_nosit  1 
   /if "@Param2"=="noheal" /varset Canni_noheal 1
   /if "@Param2"=="nostop" /varset Canni_nostop 1 
   
:loopstart
|  If your hp are less than 35% start a heal first. 
   /if n $char(hp,pct)<35 /call Canni_CastHeal

|  If your mana is more than 5%, and hp are between 25 and 50%, heal. 
   /if n $char(mana,pct)>5 /if n $char(hp,pct)>25 /if n $char(hp,pct)<50 /call Canni_CastHeal

|  If hp are more than 40% and mana is under 90%, canni.
   /if n $char(hp,pct)>40 /if n $char(mana,pct)<90 /call Canni_CastCanni

|  If your done canni'ing stop the macro.
   /if n $char(mana,pct)>90 /if Canni_nostop == 0 /call Canni_AllDone

   /doevents
   /delay 1
   /goto :loopstart

/return


Sub Canni_CastCanni
   :tryagain
   /delay 1
   /if n $char(gem,"Cannibalize IV")<1 /goto :tryagain
   /sit off
   
   /call Cast "Cannibalize IV"
   /if $return==CAST_RESTART /call CastCanni
   /if $return==CAST_OUTOFMANA /call ErrorTrap
   /if $return==CAST_OUTOFRANGE /call ErrorTrap
   /if $return==CAST_CANNOTSEE /call ErrorTrap
   /if $return==CAST_STUNNED /call ErrorTrap
   /if $return==CAST_RESISTED /call ErrorTrap
   /if Canni_nosit == 0 /sit on
   /delay 1
/return

Sub Canni_CastHeal
|  Noheal catch, with stupidity checking
   /if Canni_noheal == 1 /if n $char(hp,pct)>35 /call Canni_CastCanni
   
   :tryagain
   /delay 1
   /if n $char(gem,"Quiescence")<1 /goto :tryagain
   /sit off
   /target myself
   
   /call Cast "Quiescence"
   /if $return==CAST_RESTART /call CastHeal
   /if $return==CAST_OUTOFMANA /call ErrorTrap
   /if $return==CAST_OUTOFRANGE /call ErrorTrap
   /if $return==CAST_CANNOTSEE /call ErrorTrap
   /if $return==CAST_STUNNED /call ErrorTrap
   /if $return==CAST_RESISTED /call ErrorTrap
   /delay 1
   /if Canni_nosit == 0 /sit on
   /delay 90
/return

Sub Canni_Syntax
   /echo Canni..Syntax (Brought to you by MoonRaverX)
   /echo help   - Display this information
   /echo noheal - Canni and dont stop. Good for slow groups with a cleric healing you.
   /echo nostop - Do not end the canni loop when you are done. It will continue to 
   /echo .        loop and canni as necissary to keep you up on mana.
   /echo nosit  - Perform basic, but do not sit between casts. 
   /echo Note: Noheal will still heal if you hit 35%, there is some sanity to it. 
   /endmacro
/return

Sub Canni_ErrorTrap
   /echo Something went wrong with the macro. Killing now.
   /endmacro
/return

Sub Canni_AllDone
   /delay 1
   /sit off
   /echo Cannidance done.
   /endmacro
/return
Last edited by MoonRaverX on Fri Dec 19, 2003 6:58 am, edited 1 time in total.
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

Post by Imperfect » Fri Dec 19, 2003 3:44 am

What exactly are you trying to do with this?

Code: Select all

   /endmacro 
/call Main
The reason I ask is that as far as I know calling main is kind of a bad deal. You could /return out of the function if you wanted to though.

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

Post by MoonRaverX » Fri Dec 19, 2003 6:54 am

/shrug
I guess it should be fixed. Bad code on my part. Hopefully I did a halfway decent job. First "release" I've done, hopefully it benefits others.
-MoonRaverX
(Removed character from my sig due to owner of said character requesting me to.)

"ASCII stupid question, get a stupid ANSI"

User avatar
Jon100
a hill giant
a hill giant
Posts: 161
Joined: Mon Sep 22, 2003 6:15 am
Location: UK

Post by Jon100 » Fri Dec 19, 2003 8:38 am

Code: Select all

/if "@Param0 @Param1 @Param2"~~"nosit" /varset Canni_nosit 1 
/if "@Param0 @Param1 @Param2"~~"noheal" /varset Canni_noheal 1 
/if "@Param0 @Param1 @Param2"~~"nostop" /varset Canni_nostop 1 
little bit neater. (MQ down so untested)

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

Post by Imperfect » Fri Dec 19, 2003 10:53 am

You will have to forgive me... Fiance dumped me last night and I could have been a little more helpful than just saying what are you doing? Anyway my aplogies.

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Mon Dec 22, 2003 9:32 am

Keeps spamming "Variables already defined" 3 times on every loop.

Code: Select all

/if "@Param0 @Param1 @Param2"~~"nosit" /varset Canni_nosit 1 
/if "@Param0 @Param1 @Param2"~~"noheal" /varset Canni_noheal 1 
/if "@Param0 @Param1 @Param2"~~"nostop" /varset Canni_nostop 1 
I'm no programmer, and am just beginning to learn scripting macros, but I'm 99% sure that's the reason. Is it necessary to use /varset, or can you just use canni_xxx==1? Also, this is outside the loop, so why would it keep doing this? I can see it doing it once at startup, but on every loop?
Also, you need to delete all spaces around your =='s.
Other than that, it works perfectly. =)

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Mon Dec 22, 2003 10:05 am

/varset is necessary.

Lane
a hill giant
a hill giant
Posts: 201
Joined: Fri Dec 06, 2002 11:57 am

Post by Lane » Mon Dec 22, 2003 1:36 pm

You will have to forgive me... Fiance dumped me last night and I could have been a little more helpful than just saying what are you doing? Anyway my aplogies.
I think we can probably forgive that. Sorry Dude.

-Lane

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Mon Dec 22, 2003 9:54 pm

Wow...don't ever let me post after 2am when I was at work since 4am the previous day. lol...

/return

It's amazing what a little sleep followed by a bit of quiet time on the commode will do for your thinking skillz. :wink:

Time to test some theories with this and see if I'm picking up on these .mac's or not. Will post what I find.

BTW: This mac saved my group from a very bad pull last night while I was testing it out. For as simple as it is, it's amazing how useful it's been. Running 2 chars on one computer can be a pain...and having to stop to canni just to toss out spot heals/debuffs/dots/etc would have wiped us all.