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

thisisjustatest80
orc pawn
orc pawn
Posts: 10
Joined: Sun Feb 22, 2004 9:08 am

Canni

Post by thisisjustatest80 » Fri Feb 27, 2004 12:13 am

This is the first macro I wrote wrote myself. Basically, as I'm sure you know, you regen more hp/mana when you're sitting than when you're standing. However, Shamans also need to canni sometimes. This code waits until you get the sitting bonus, stands, casts canni, then sits again. This really, really helps with mana regen.

Code: Select all

| canni.mac - Cannabalize at the next level
| usage - /macro canni [# | health | fom]
|     # = number of times to canni
|    health = canni until health and mana are (roughly) equal
|    fom = canni until full of mana, healing along the way
|      *** fom still needs some work
|    this program won't let you canni below 20%
|   oh, i also wanted to be able to run without having to /end the macro...so
|   if you are running the macro automatically stops
sub Main
	/declare mana_now global
	/declare count global
	/declare number_of_times global
	/declare i local
	
	:Health
	/if "@Param0"~~"Health" {
	 	/if n $char(hp,pct)>$char(mana,pct) {
			/call Loopy
			/goto :Health
		} else /call ending
	}
	
	:FOM
	/if "@Param0"~~"FOM" {
		/if n $char(mana,max)>=$char(mana,cur) {
			/call Loopy
			/goto :FOM
		} else /call ending
	}
	/if n @Param0>=1 /varset number_of_times @Param0 else /varset number_of_times 1
	
	
	/if n $char(gem,"cannibalize")==0 {
		/echo Cannibalize not loaded
		/call ending
	}
	
	/for i 1 to @number_of_times 
		/call Loopy
	/next i
	
	
/call ending


Sub Loopy 

	/varset mana_now $char(mana,cur)
	/varset count 0

	/echo $char(mana,cur)

:Loop
	
	/if n $char(speed)!=0 {
		/echo Moving - cannot Canni
		/call ending
	}
	
	/if n $char(hp,pct)<20 {
		/echo Health Too Low!
		/call tryheal
		/return
	}

	/if n $char(mana,cur)!=@mana_now {
		/stand
		/echo $char(mana,cur)
		/cast "cannibalize"
		/delay $spell("cannibalize",casttime)s
		/delay 1s
		/if n $char(speed)!=0 {
			/echo Moving - cannot Canni
			/call ending
		}
		/sit
		/return
	}
	
	/delay 3
	/varadd count 1
	/if n $char(mana,max)==$char(mana,cur) {
		/echo FOM
		/call ending
	}
	/goto :Loop

:Exit

/return

sub tryheal
	/if n $char(gem,"greater healing")==0 {
		/echo Greater Healing not loaded
		/call ending
	}
	/if $char(state)!="STAND" /stand
:GreatHeal
	/if n $char(gem,"greater healing")>0 {
		/if n $char(hp,pct)<=75 {
			/target myself
			/cast "Greater healing"
		}
	} else {
		/delay 2s
		/goto :GreatHeal
	}
	
/return

sub ending
	/echo $char(mana,cur)/$char(mana,max)
	/echo $char(mana,pct)%
/endmacro