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
