Food/water for fippy

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

Moderator: MacroQuest Developers

dannuic
orc pawn
orc pawn
Posts: 26
Joined: Sun Oct 03, 2004 8:59 am

Food/water for fippy

Post by dannuic » Tue Feb 22, 2011 1:12 pm

I know this is probably not too useful to most people, but I whipped this up to use on fippy... so maybe someone else will find it useful.

Code: Select all

|foodwater.mac
|
|/mac foodwater [castType] [numLoops]
|castType = 0 for food and water, 1 for food, and 2 for water
|numLoops = number of stacks to summon

#include Spell_Routines.inc

Sub Main
	| castType = 1 for food, 2 for water, 0 for both
	/declare castType int outer
	/declare loops int local
	
	/if (${Defined[Param1]}) {
		/varset loops ${Param1}
		/if (${loops}<1) /varset loops 1
	} else {
		/varset loops 1
	}
	
	/declare i int local
	/for i 1 to ${loops}
		/echo On stack ${i} of ${loops}...
		/if (${Defined[Param0]}) {
			/varset castType ${Param0}
			/if (${castType}==1) {
				/call Food
			} else /if (${castType}==2) {
				/call Water
			} else {
				/call Food
				/call Water
			}
		} else {
			/call Food
			/call Water
		}
	/next i
	/echo Finished summoning sustenance.
/return

Sub Food
	/varset castType 1
	/declare i int local
	/echo Summoning a stack of food...
	/for i 1 to 20
		:castFood
		/if (${Me.PctMana}<10) /call Med
		/call Cast "Summon Food" gem1
		/if (!${castReturn.Equal[CAST_SUCCESS]}) /goto :castFood
		/if (${Cursor.ID}) /autoinventory
	/next i
/return

Sub Water
	/varset castType 2
	/declare i int local
	/echo Summoning a stack of water...
	/for i 1 to 20
		:castWater
		/if (${Me.PctMana}<10) /call Med
		/call Cast "Summon Drink" gem1
		/if (!${castReturn.Equal[CAST_SUCCESS]}) /goto :castWater
		/if (${Cursor.ID}) /autoinventory
	/next i
/return

Sub Med
   :Med
   /if (!${Me.Sitting} && !${Me.Mount.ID}) /sit
   |/echo Mana: ${Me.CurrentMana}/${Me.MaxMana} (${Me.PctMana}%)
   /delay 5s
   /if (${Me.PctMana} < 100) /goto :Med
/return