Looking for a macro that will use food and drink summoning items until I've summoned x amount.
For example, I could do
and it would run and summon the set amount (edited in the .mac) then end.
My goal with this .mac is to avoid having to click these items all of the time on various characters for 1 food or drink each.
THANK XENIAZ FOR THE MACRO BELOW. YOU CAN USE EITHER SPELL OR ITEM, SPELLS MUST BE DECLARED AS "gem#" AND ITEM AS "item" THEN JUST ENTER THE NAMES AND AWAY YOU GO! YOU CAN ALSO PASS A PARAMETER ON MACRO START FOR HOW MANY STACKS YOU WANT MADE.
For example, I could do
Code:
/mac smnprv
My goal with this .mac is to avoid having to click these items all of the time on various characters for 1 food or drink each.
THANK XENIAZ FOR THE MACRO BELOW. YOU CAN USE EITHER SPELL OR ITEM, SPELLS MUST BE DECLARED AS "gem#" AND ITEM AS "item" THEN JUST ENTER THE NAMES AND AWAY YOU GO! YOU CAN ALSO PASS A PARAMETER ON MACRO START FOR HOW MANY STACKS YOU WANT MADE.
Code:
Sub Main(szStacks)
/declare DrinkSpell string outer Warm Milk Dispenser
/declare DrinkType string outer item
/declare FoodSpell string outer Fresh Cookie Dispenser
/declare FoodType string outer item
/declare DrinkItem string outer Warm Milk
/declare FoodItem string outer Fresh Cookie
/declare nStacks int outer 0
/declare Once int outer 0
/if (${Defined[szStacks]}) /varset nStacks ${szStacks}
/if (${nStacks}<1) /varset Once 1
/if (${nStacks}<1 || ${nStacks}>20) /varset nStacks 1
/if (${Once}) /echo Summoning up to 1 stack of food and drink, then ending macro.
/if (!${Once}) /echo Summoning ${nStacks} stack(s) of food and drink per cycle.
/call SummonDrinkFood
/echo Done summoning stuff!
/return
Sub SummonDrinkFood
/declare mycount int local
/declare count int local
/if (${FindItemCount[=${DrinkItem}]} < ${Math.Calc[20*${nStacks}]} || ${FindItemCount[=${FoodItem}]} < ${Math.Calc[20*${nStacks}]}) {
/if (!${Me.Gem[${DrinkSpell}]} && ${DrinkType.Find[gem]}) /memspell 1 "${DrinkSpell}"
/if (!${Me.Gem[${FoodSpell}]} && ${FoodType.Find[gem]}) /memspell 2 "${FoodSpell}"
:BigLoop
/if (${Me.SpellReady[${DrinkSpell}]} || !${FindItem[${DrinkSpell}].TimerReady} ) {
:DrinkLoop
/if (${Me.CombatState.Equal[COMBAT]} || ${Me.Moving} || !${Me.State.Equal[STAND]} || ${Cursor.ID} || ${Me.Casting.ID}) {
/delay 2s
/autoinv
/goto :DrinkLoop
}
/call Summon "${DrinkSpell}" ${DrinkType}
/autoinv
}
/if (${Me.SpellReady[${FoodSpell}]} || !${FindItem[${FoodSpell}].TimerReady}) {
:FoodLoop
/if (${Me.CombatState.Equal[COMBAT]} || ${Me.Moving} || !${Me.State.Equal[STAND]} || ${Cursor.ID} || ${Me.Casting.ID}) {
/autoinv
/delay 2s
/goto :FoodLoop
}
/call Summon "${FoodSpell}" ${FoodType}
/autoinv
}
/if (${Math.Calc[20*${nStacks}]}>=${Math.Calc[${FindItemCount[=${DrinkItem}]}+1]}) /goto :BigLoop
/if (${Math.Calc[20*${nStacks}]}>=${Math.Calc[${FindItemCount[=${FoodItem}]}+1]}) /goto :BigLoop
}
/return
Sub Summon(string what, string castType)
/if ( ${castType.Equal[item]} ) {
/useitem ${FindItem[=${what}].ItemSlot} ${FindItem[=${what}].ItemSlot2}
}
/if ( ${castType.Find[gem]} ) {
/casting "${what}" ${castType}
}
:castwait
/delay 2
/if ( ${Me.Casting.ID} ) /goto :castwait
/delay 5
/autoinv
/delay 5
/return
Attachments
Last edited by a moderator: