Pet attack macro?
Posted: Fri May 26, 2023 2:41 am
is there a macro that we can use to cast a spell and have your pet attack without clicking the attack button?? Thanks
Mysteries of Azeroth — is a story expansion made by the Turtle WoW Team, inspired by the Warcraft universe of Blizzard Entertainment.
https://forum.turtle-wow.org/
Code: Select all
PetAggressiveMode() - Set your pet in aggressive mode.
PetAttack() - Instruct your pet to attack your target.
PetStopAttack() - Stop the attack of the pet.
PetDefensiveMode() - Set your pet in defensive mode.
PetFollow() - Instruct your pet to follow you.
PetPassiveMode() - Set your pet into passive mode.
PetWait() - Instruct your pet to remain still.
Code: Select all
/run --CastSpellByName("Shoot")
/run PetAttack(); CastSpellByName("Shoot") end
Code: Select all
/run --CastSpellByName("Immolate")
/run PetAttack(); local c=CastSpellByName; if IsShiftKeyDown() or n==0 then c("Immolate") n=1; elseif n==1 then c("Corruption") n=2 else c("Shadow Bolt") end
Code: Select all
function WarlockPetSkinMACRO(drinkslot, foodslot, hearthslot, wandactionbutton)
if drinkslot == "help" then
local function lockprint(text)
DEFAULT_CHAT_FRAME:AddMessage(text)
end
lockprint("Usage:")
lockprint("Mod Ctrl = Dismiss Pet")
lockprint("Mod Alt Combat = Health Funnel")
lockprint("Mod Alt = Use Hearthstone (* hearthstone)")
lockprint("Mod Shift = Demon Armor / Unending Breath")
lockprint("Default Friendly Target = Fire Shield (**)")
lockprint("Default Aggro Target = Send pet (* start wand)")
lockprint("No mod and no valid target = Drink")
lockprint("No mod and no valid target if Drink active = Eat")
lockprint("--")
lockprint("* = Based on action button location")
lockprint("** = Requires Imp")
return
end
-- dismiss pet as called
if IsControlKeyDown() then
if HasPetUI() then
PetDismiss()
return
end
end
-- alt key, combat heals pet
if IsAltKeyDown() then
if UnitAffectingCombat("player") == 1 then
CastSpellByName("Health Funnel")
else
UseAction(hearthslot)
end
return
end
if IsShiftKeyDown() then
if CheckBuffRemain("Shadow", "RagingScream", "player") < 300 then
CastSpellByName("Demon Armor")
else
if UnitCanCooperate("player", "target") then
CastSpellByName("Unending Breath")
else
if CheckBuffRemain("Shadow", "DemonBreath", "player") < 120 then
CastSpellByName("Unending Breath", "player")
end
end
end
return
end
-- friendly target cast flame shield on them if pet is imp
if UnitCanCooperate("player", "target") then
local pettype = UnitCreatureFamily("pet")
if pettype == "Imp" then
CastSpellByName("Fire Shield")
end
return
end
if UnitCanAttack("player", "target") and wandactionbutton > 0 then
wandStart(wandactionbutton)
end
-- if have pet send attack / pull back. returns only on attack mode. default is passive
if HasPetUI() then
if PetAttackMACRO() then
return
end
end
-- check status of food and drink. activate as needed
local drinkexist = CheckBuffRemain("INV", "Drink", "player")
if drinkexist == 0 then
if UnitMana("player") < UnitManaMax("player") then
UseAction(drinkslot)
return
end
end
local foodexist = CheckBuffRemain("INV", "Fork&Knife", "player")
if foodexist == 0 then
if UnitHealth("player") < UnitHealthMax("player") then
UseAction(foodslot)
return
end
end
end
function PetAttackMACRO()
if UnitCanAttack("player", "target") then
PetAttack()
return true
end
PetPassiveMode()
return false
end