Вов руководство по макросам

В этом кратком руководстве мы попытаемся рассказать, как создать макросы — от очень простых и популярных до самых сложных, с примерами и пояснениями на каждом этапе, используя все разрешенные нам сокращения для того, чтобы уложится в лимит 255 символов.:cut: Во-первых, что такое макрос? Макрос — это маленькая программа, написанная на скриптовом языке, предназначенная для решения следующих (к примеру) задач:

  • Каждый класс в WoW имеет гораздо больше заклинаний, чем может помещаться на панелях команд. Макросы позволяют объединять несколько умений в одну «кнопку» на панели команд, а сами умению будут использоваться с дополнительными модификаторами (клавишами Shift, Alt, Ctrl). Используя макросы, вы можете повесить до 24 заклинаний всего на 6 кнопок.
  • Макросы позволяют объединять несколько умений, активируя их нажатием одной кнопки, что может экономить время. Но данная возможность работает, только если не более чем одно из заклинаний имеет время каста или является мгновенным, но имеет гкд (GCD – общее время восстановления).
  • Также макросы могут выполнять множество других задач, например, рассчитывать эвойденс, если вы танк, или сообщать вам, когда в зоне вашей видимости появился затерянный во времени протодракон, пока вы летите по Грозовой Гряде. (Это достаточно сложные макросы и выходят за рамки нашей темы, но для любопытных они включены для примера в конце)

Содержание

  • Основы
  • Боевые команд
  • Модификаторы цели
  • Условия
  • Модификаторы комбинаций клавиш
  • Общие команды
  • Список идентификаторов слотов
  • Создание макроса
  • Шаблон рабочего макроса
  • Многострочные макросы
  • Макросы с модификатором цели
  • Большие макросы и скрипты
  • Краткое итого
  • Больше примеров макросов

Основы

  • Откройте игровое меню, нажав кнопку Esc или щелкнув по соответствующей иконке.
  • В меню выберите «Макросы», после чего вы увидите окно редактора макросов.
  • Для создания макроса нажмите «Создать» внизу окошка.
  • Выберите иконку для макроса. Всегда выбирайте красный знак вопроса , причины будут описаны позже.
  • Введите любое имя для макроса, но оно не может быть слишком длинным. Не называйте макрос так же, как сами умения, например вместо «Вспышка света» напишите вспышка_света или макрос_вспышка и т.п.
  • Кликните ОК, теперь вы можете ввести текст макроса в окне редактора. Скопируйте и вставьте туда один из перечисленных ниже примеров, чтобы посмотреть, как он работает.
  • Чтобы сохранить макрос, просто нажмите еще раз «Создать» или выберите в списке один из уже существующих макросов. Кнопки «сохранить» в редакторе, к сожалению нет.
  • Переместите макрос на панель команд, так же как и любой другой спелл. Теперь вы можете активировать его, просто кликнув по нему или нажав назначенную кнопку для данного слота панели команд (для назначения кнопок используйте игровое меню «Назначение клавиш»). Протестируйте работу макроса.

Все создаваемые вами макросы сохраняются на сервере Blizzard и привязаны к вашей учетной записи или персонажу, что означает, что вы можете получить к ним  доступ с разных компьютеров. На одной учетной записи может быть сохранено 120 макросов, плюс 18 макросов для каждого персонажа. Макросы учетной записи, как видно из названия, используются всеми вашими персонажами, в то время как макросы персонажей не видны другим персонажам в вашей учетной записи.

Боевые команд

Эти команды выполняют действия, которые в основном используются в макросах, ориентированных на бой.

  • /stopcasting — Немедленно останавливает ваше текущее заклинание или потоковое заклинание, если вы его используете.
  • /targetlasttarget — изменяет вашу цель на последнюю на которую вы целились.
  • /cast — произносит заклинание с введенным после него названия из вашей книги заклинаний. (например, /cast Fireball)

У вас также могут быть модификаторы для произнесения заклинаний, которые будут отображаться между командой /cast и названием вашего заклинания в квадратных скобках ([]). Например /cast [@focus] Kick. У вас может быть несколько модификаторов, связанных запятыми (,), которые должны быть истинными, чтобы они сработали или иметь разные группы модификаторов в разных скобках. Например

/cast [@focus,exists,nodead,harm]Fireball
Использовать огненный шар на вашу цель в фокусе, если она существует, если она не мертва и является врагом, в противном случае применение произойдет на вашу текущую цель.

Модификаторы цели

Добавление модификатора target к вашему макросу изменит вашу текущую цель на указанную, если его условие истинно. @ (читается как ‘at’) можно заменить на target = в каждой команде.

  • @player — нацеливается на игрока.
  • @target — Нацеливается на текущую цель игрока.
  • @mouseover — нацеливает заклинание на цель, над которой в данный момент находится мышь.
  • @cursor — использование заклинание по области, на место в котором в данный момент находиться курсор (доступно только для заклинаний с применением на область, например Массовое рассеивание или Снежная буря).
  • @focus — Нацеливается на цель которая у вас взята в фокус.
  • @targettarget — Нацеливается на цель цели. Например, при использовании цели на босса, она будет нацелена на танка или на того, кого босс нацелен в этот момент.
  • @boss1 — нацеливается на первого босса в списке. Обычно доступно только в подземельях и рейдах. Есть еще варианты, такие как boss2, boss3 и т. Д.
  • @arena1 — Нацеливается на первого человека в списке Арены. Это модификатор только для PvP, обычно доступный только во время боев на арене. Есть еще варианты, такие как arena2, arena3 и т. Д.
  • @pet — Нацеливаетесь в питомца игрока.

Условия

Условные выражения можно использовать, чтобы решить, какое действие следует выполнить. Вы можете добавить «no» перед ними, чтобы они вели себя прямо противоположным образом. Например, noharm верно для любой цели, которая не является врагом, но может включать например  нейтральных NPC.

  • pet — верно, если у игрока в данный момент нет питомца.
  • combat — верно, если вы в бою.
  • harm — верно, если целью для использования способности является враг.
  • help — верно, если целью для использования способности является союзник.
  • dead — верно, если цель для использования способности мертва.
  • exists — верно, если цель для использования способности существует.
  • channeling — верно, если вы в данный момент используете потоковое  заклинание.
  • button:number — (или btn) используется для проверки, с помощью какой кнопки мыши вы активировали макрос. [button:1] по умолчанию, левая кнопка, [button:2] правая, [кнопка:3] средняя. Для мышей с большим количеством кнопок количество кнопок соответствует шаблону для опции.
  • talent:Row(Строка)/Column(Колонка) — верно, если у вас выбран талант Row/Column. Например, [талант: 7/2] будет верным, если у вас выбранный средний  талант.
  • equipped:slot — (или надето) верно, если в слоте есть предмет. Например, [equipped:chest] будет верным, если на вас надета нагрудная броня.
  • spec:number — верно, если вы в настоящее время находитесь в специализации, заданной числом. Специализации отсортированы в алфавитном порядке и могут быть проверены в меню специализаций.
  • group — верно, если вы в данный момент находитесь в группе. Может быть перестроен в [group:party] или [group:raid].
  • indoors  — верно, если вы в настоящее время находитесь в локации, которая считается закрытой или помещении.
  • outdoors  — верно, если вы в настоящее время находитесь в локации, которая считается на открытом открытой, под открытым небом.
  • flyable — верно, если вы в данный момент можете летать.
  • mounted  — верно, если вы в настоящее время на средстве передвижения.
  • fly — верно, если вы в данный момент летите.
  • swimming — верно, если вы в данный момент плаваете.

Модификаторы комбинаций клавиш

  • mod:shift — верно, если комбинация клавиш была нажата при нажатой клавише SHIFT.
  • mod:alt — верно, если комбинация клавиш была нажата при нажатой клавише ALT.
  • mod:ctrl — верно, если комбинация клавиш была нажата при нажатой клавише CTRL.

Общие команды

Эти команды можно использовать как в боевых, так и в небоевых ситуациях.

  • /run — (или /script) Выполнить скрипт.
  • /use — использует элемент с именем, написанным после команды. Также может использоваться с числами, что заставит его использовать предмет, установленный в слоте за который отвечает это число.

например, /use Зелье длительной силы чтоб использовать зелье или /use 14, чтобы использовать второй аксессуар

Список идентификаторов слотов

1 — Голова 10 — Руки
2 — Шея 11 — Кольцо 1
3 — Плечо 12 — Кольцо 2
4 — Рубашка 13 — Аксессуар 1
5 — Грудь 14 — Аксессуар 2
6 — Пояс 15 — Плащ
7 — Ноги 16 — Основная рука
8 — Сапоги 17 — Левая рука
9 — Запястье 19 — Гербовая накидка

Создание макроса

Ваш первый макрос

Самый простой макрос

#showtooltip
/cast Вспышка Света

#showtooltip заменяет вопрос на иконку используемого нами умения. Красный знак вопроса всегда заменяется на ту иконку, которую задаёт макросу команда #showtooltip.

Вы можете использовать команду /use вместо /cast, чтобы сократить длину большого макроса.
Данный макрос выглядит и работает совершенно так же, как и заклинание «Вспышка Света» из книги заклинаний. Поместите его на панель команд и кликните, персонаж скастует вспышку (если конечно вы паладин).
Поскольку данный макрос не имеет никакого дополнительного функционала по сравнению с умением из книги заклинаний, нет смысла использовать его, это только пример.

Шаблон рабочего макроса

Теперь мы создадим более функциональный пример, для начала включающий в себя 4 модификатора. Такой макрос позволяет использовать несколько умений с одной кнопки на панели команд:

#showtooltip
/use [mod:ctrl] умение 4;[mod:alt] умение 3;[mod:shift] умение 2;[nomod] умение 1

или без [nomod] в конце макроса, что позволит сократить длину макроса (напоминаем, что для любого макроса максимум составляет 255 символов).

#showtooltip
/use [mod:ctrl] умение 4;[mod:alt] умение 3;[mod:shift] умение 2;умение 1

(есть случаи, когда наличие [nomod] необходимо, но в большинстве случаев нет разницы, какой из вариантов использовать)

Создайте макрос с 4 вашими умениями по вышеприведенному примеру, затем поместите его на панель. Вместо красного вопроса #showtooltip будет отображать иконку «умения 1», если же вы нажмете Ctrl, то она заменится на «Умение 4» до тех пор, пока Ctrl нажат. Аналогично будет происходить при нажатие Shift или Alt.
Всегда есть возможность ошибки при создании макроса, если вместо иконки одного из умений у вас отображается красный вопрос, значит, вы допустили ошибку.
Вот пример настоящего макроса, на примере умений паладина. Идея данного макроса может использоваться любым классом:

#showtooltip
/use [mod:ctrl] Стремительный зеленый грифон;[mod:alt] Стремительный белый рысак;[mod:shift] Свет небес;[nomod] Вспышка света

или без [nomod]

#showtooltip
/use [mod:ctrl] Стремительный зеленый грифон;[mod:alt] Стремительный белый рысак;[mod:shift] Свет небес; Вспышка света

При использование макроса:

  • Ctrl + макрос, вы увидите иконку грифона, а персонаж по клику начнёт садиться на него.
  • Alt + макрос, отображается иконка Стремительного белого рысака и начнётся его призыв.
  • Shift + макрос, отображается иконка «света небес» и идёт его каст.
  • Макрос без модификаторов будет отображать иконку «вспышки света», а нажав его, вы скастуете «вспышку света».

С модификаторами, которые вам труднее всего нажимать, используйте не боевые или редко используемые умения. Для меня лично не очень удобны Ctrl и Shift, там я расположил маунтов. Нажать альт для меня проще, поэтому с ним я использую часто кастуемые заклинания, а без модификаторов самое частое. То есть, создавая макрос, используйте [nomod] для самых важных умений, удобный вам модификатор для менее важных, и остальные для не боевых или очень редких заклинаний.

Многострочные макросы

Можно создавать макросы, использующие одновременно несколько умений по одному нажатию, только если не более чем одно из заклинаний имеет время каста или является мгновенным, но имеет гкд.
Например, создадим макрос, Для мага на использования Возгорания и аксессуара Жетон падшего гладиатора

#showtooltip
/use Возгорание
/use Жетон падшего гладиатора

Теперь при использовании данного макроса будет использоватся Возгорание с включенным тринкетом. Если ваше заклинание имеет время каста то оно должно быть на последней строчке.
Еще один простой, но очень полезный пример макроса:

/target НикТанка
/assist

Данный макрос позволяет мгновенно выбрать и начать атаковать цель танка.
1я строчка выбирает в цель танка (вам придётся каждый раз вписывать имя текущего танка)
2я строчка выберет для вас текущую цель танка.

Однако всегда есть исключения, используйте этот макрос, только если вы бьёте цели без специального приоритета или меток.

Макросы с модификатором цели

Вы можете также создавать макросы с кастом заклинаний в определенную цель. Для примеров будем использовать умения паладина.

Базовый шаблон, кастует вспышку в текущую выбранную цель

#showtooltip
/use Вспышка света

модификатор [target=player] или сокращенно [@player] кастует в самого себя:

#showtooltip
/use [@player] Вспышка света

модификатор [target=focus] или [@focus] делает каст в запомненную цель:

#showtooltip
/use [@focus] Вспышка света

модификатор [target=mouseover] или [@mouseover], делает каст в цель, на которую вы наводите мышкой, к примеру, по фрейму игрока в пати:

#showtooltip
/use [@mouseover] Вспышка света

Теперь же объединим все эти макросы в один с использованием модификаторов:

#showtooltip
/use [mod:ctrl,@player] Вспышка света;[mod:alt,@focus] Вспышка света;[mod:shift,@mouseover] Вспышка света;[nomod] Вспышка света

Большие макросы и скрипты

Вот парочка примеров сложных макросов. Фактически это скрипты, а не макросы, и они являются более сложными, чем все предыдущие примеры. Если вы заинтересовались, то можете посетить сторонние ресурсы, начните с http://www.wowwiki.com/HOWTO:_Make_a_Macro

ДК:

/run ChatFrame1:AddMessage(format("Avoidance with Stoneskin Gargoyle: %.2f%%", GetDodgeChance() + GetParryChance() + 6 + 1/(0.0625 + 0.956/(floor(GetCombatRatingBonus(CR_DEFENSE_SKILL))*0.04))))

Друид:

/run ChatFrame1:AddMessage(format("Total avoidance: %.2f%%", GetDodgeChance() + 5 + 1/(0.0625 + 0.956/(GetCombatRating(CR_DEFENSE_SKILL)/4.91850*0.04))))

Паладин:

/run ChatFrame1:AddMessage(format("Total avoidance: %.2f%%", GetDodgeChance() + GetParryChance() + 5 + 1/(0.0625 + 0.956/(GetCombatRating(CR_DEFENSE_SKILL)/4.91850*0.04))))

Воин:

/run ChatFrame1:AddMessage(format("Total avoidance: %.2f%%", GetDodgeChance() + GetParryChance() + 5 + 1/(0.0625 + 0.956/(GetCombatRating(CR_DEFENSE_SKILL)/4.91850*0.04))))

Макрос для помощи в поиске затерянного во времени:

/tar Дирки
/tar Вирагоса
/tar Затерянный
/stopmacro [noexists]
/w СвойНик %t найден!
/run RaidNotice_AddMessage(RaidBossEmoteFrame,"Вот же он! Убей его!", ChatTypeInfo["RAID_WARNING"])
/script PlaySoundFile("Sound\\interface\\RaidWarning.wav")

Краткое итого

Создание макроса с модификаторами для разных умений:

#showtooltip
/use [mod:ctrl] умение4;[mod:alt] умение3;[mod:shift] умение2;[nomod] умение1

Используйте в многострочном макросе не более 1го умения, которое имеет гкд или время каста и только в конце макроса

#showtooltip
/use [mod:shift] без-ГКД умение1;[nomod] без-ГКД умение2
/use [mod:shift] без-ГКД умение3;[nomod] без-ГКД умение4
/use [mod:ctrl] умение4 с гкд;[mod:alt] умение3 с гкд;[mod:shift] умение2 с гкд;[nomod] умение1 с гкд

Скопируйте в строку #showtooltip условия из последней строки, для отображения иконок заклинаний

#showtooltip [mod:ctrl] умение4 с гкд;[mod:alt] умение3 с гкд;[mod:shift] умение2 с гкд;[nomod] умение1 с гкд
/use [mod:shift] без-ГКД умение1;[nomod] без-ГКД умение2
/use [mod:shift] без-ГКД умение3;[nomod] без-ГКД умение4
/use [mod:ctrl] умение4 с гкд;[mod:alt] умение3 с гкд;[mod:shift] умение2 с гкд;[nomod] умение1 с гкд

Больше примеров макросов

Применения вашу способность Прерывание в цель в вашем фокусе,а если в фокусе нет цели то они применится к цели в вашем таргете.

#showtooltip
/cast [@focus,exists][@target] Прерывание

Использует способность в место где находится ваш курсор. На примере Метаморфозы.

#showtooltip
/cast [@cursor] Метаморфоза

Использует способности на место где находится персонаж. На примере Метаморфозы.

#showtooltip
/cast [@player] Метаморфоза

Макрос для каста печатей по курсору/под ноги (на примере Печати немоты):

#showtooltip
/use [nomod,@cursor][mod:shift,@Player]Печать немоты; Печать немоты

Макрос для используемых талантов, чтобы не менять кнопку. На примере Опустошения Скверны и Взрывной души

#showtooltip
/cast [talent:6/1] Опустошение Скверны; [talent:6/3] Взрывная душа

Возрождение в бою, Оживление вне боя, одной кнопкой.

#showtooltip
/use [nocombat] Оживление
/stopmacro [nocombat]
/use Возрождение
/р Оживляется %t

Маусовер макрос для атакующих заклинаний.

#showtooltip Огненный шок
/cast [@mouseover,harm,exists][] Огненный шок

Озарение на себя без смены цели:

#showtooltip Озарение
/target player
/cast Озарение
/targetlasttarget

Маусовер макрос для лечащих заклинаний:

#showtooltip
/cast [@mouseover,noharm,exists] [@target,noharm,exists] [@player] Очищение духа

Этот макрос позволяет кинуть Огненный шок на соседнюю цель, не меняя вашей текущей:

#showtooltip
/targetenemy
/cast Огненный шок
/targetlasttarget

Перевел специально для
Demon Hunter Community
@Rodriguez#8726

Discord-сервер всех охотников на демонов:

Руководство по макросам

От Rodriguezz4060


Последний раз обновлено:
30.08.2020

История изменений
Обновление: 9.0.1

Содержание
Рейтинг:

Здравствуйте. В данном руководстве мы расскажем, что такое макросы в WoW, как их создавать и как использовать. Руководство является адаптацией статьи на портале Wowhead и рассчитано на начинающих игроков.

Руководство по макросам

Во-первых, что такое макрос? Макрос — это маленькая программа, ограниченная 255 символами, написанная на скриптовом языке, предназначенная для решения следующих (к примеру) задач:

  • Каждый класс в WoW имеет больше заклинаний, чем может помещаться на панелях команд. Макросы позволяют объединять несколько умений в одну «кнопку» на панели команд, а сами умения будут использоваться с дополнительными модификаторами (клавишами Shift, Alt, Ctrl). Используя макросы, вы можете назначить до 24 заклинаний всего на 6 кнопок.
  • Макросы позволяют объединять несколько умений, активируя их нажатием одной кнопки, что может экономить время. Но данная возможность работает, только если не более чем одно из заклинаний имеет гкд (GCD – общее время восстановления).
  • Также макросы могут выполнять множество других, более сложных и специфических задач. Примеры будут приведены ниже.

Структура руководства:

  1. Основы
  2. Ваш первый макрос
  3. Шаблон рабочего макроса
  4. Многострочные макросы
  5. Макросы с модификатором цели
  6. Макросы с условиями
  7. Другие используемые команды
  8. Больше полезных макросов
  9. Часто задаваемые вопросы

1. Основы

  1. Откройте игровое меню, нажав кнопку Esc или кликнув по соответствующей иконке.
  2. В меню выберите «Макросы», после чего вы увидите окно редактора макросов.
  3. Для создания макроса нажмите «Создать» внизу окошка.
  4. Выберите иконку для макроса. Вы можете выбрать любую иконку, но рекомендуем для начала выбирать красный знак вопроса

    748503802562347048.png

    , причины будут описаны ниже.

  5. Введите любое имя для макроса, но оно не может быть слишком длинным. Не называйте макрос так же, как сами умения, например вместо «Вспышка света» напишите вспышка или хил1 и т.п.
  6. Кликните ОК, теперь вы можете ввести текст макроса в окне редактора. Скопируйте и вставьте туда один из перечисленных ниже примеров, чтобы посмотреть, как он работает.
  7. Чтобы сохранить макрос, просто переместите его на панель команд, так же как и любое другое заклинание. Теперь вы можете активировать его, просто кликнув по нему или нажав назначенную кнопку для данного слота панели команд (для назначения кнопок используйте игровое меню «Назначение клавиш»). Протестируйте работу макроса.

На одной учетной записи может быть сохранено 36 макросов, плюс 18 макросов для каждого персонажа. Общие макросы, как видно из названия, используются всеми вашими персонажами, в то время как макросы персонажей не видны другим персонажам на вашей учетной записи.

Все создаваемые вами макросы хранятся на нашем сервере и привязаны к вашей учетной записи или персонажу, что означает, что вы можете получить к ним доступ с разных компьютеров. Так же информация о макросах хранится в двух файлах на вашем ПК:

WTF\Account\Ваш_аккаунт\macros-сache.txt
WTF\Account\Ваш_аккаунт\Название_сервера\Имя_персонажа\macros-cache.txt.

2. Ваш первый макрос

Самый простой макрос:

#showtooltip
/cast Вспышка Света

#showtooltip заменяет вопрос на иконку используемого нами умения. При этом наведение курсора на макрос так же покажет внутриигровую подсказку, как при наведении на заклинание. Вы можете использовать команду #show, если хотите только заменить иконку, но не отображать подсказку. Если после #show или #showtooltip указать название любого известного заклинания, то иконка примет вид этого заклинания.

Вы можете использовать команду /use или /закл вместо /cast. Чтобы не писать название заклинания вручную и вставить его название в макрос, можете кликнуть по заклинанию из книги с зажатой клавишей Shift.

Данный макрос выглядит и работает совершенно так же, как и заклинание {spell:33:48785} из книги заклинаний. Поместите его на панель команд и кликните, персонаж скастует вспышку (если, конечно, вы паладин). Никакого дополнительного функционала по сравнению с умением из книги заклинаний он не имеет, нет смысла использовать его, это только пример.

Вы можете указать ранг заклинания в скобках после его названия, если есть такая необходимость. Так, например, маги часто используют макрос такого вида:

/cast Ледяная стрела(Уровень 1)

Если ранг не указан, автоматически будет использован наивысший ранг способности.

3. Шаблон рабочего макроса​

Теперь мы создадим более функциональный пример, для начала включающий в себя 4 модификатора. Такой макрос позволяет использовать несколько умений с одной кнопки на панели команд:

#show
/use [mod:ctrl] умение4;[mod:alt] умение3;[mod:shift] умение2;[nomod] умение1

или без [nomod] в конце макроса, что позволит сократить длину макроса (напоминаем, что для любого макроса максимум составляет 255 символов).

#show
/use [mod:ctrl] умение4;[mod:alt] умение3;[mod:shift] умение2;умение1

Создайте макрос с 4 вашими умениями по вышеприведенному примеру, затем поместите его на панель. Вместо красного вопроса #showtooltip будет отображать иконку «умения1», если же вы нажмете Ctrl, то она заменится на «Умение4» до тех пор, пока Ctrl нажат. Аналогично будет происходить при нажатие Shift или Alt.

Вот пример настоящего макроса, позволяющего сэкономить место на панели команд, на примере умений паладина. Идея данного макроса может использоваться любым классом:

#show
/use [mod:alt] Правосудие справедливости;[mod:shift] Правосудие света;Правосудие мудрости

При использование макроса:

  • Alt + макрос, отображается иконка и применение {spell:33:53407}
  • Shift + макрос, отображается иконка и применение {spell:33:20271}
  • Макрос без модификаторов будет отображать иконку и применять {spell:33:53408}

С модификаторами, которые вам труднее всего нажимать, используйте не боевые или редко используемые умения. То есть, создавая макрос, используйте [nomod] для самых важных умений, удобный вам модификатор для менее важных, и остальные для не боевых или очень редких заклинаний.

4. Многострочные макросы​

Можно создавать макросы, использующие одновременно несколько умений по одному нажатию, только если не более чем одно из заклинаний имеет гкд. Заклинания используются в порядке их написания. Поэтому если ваше заклинание имеет время каста, то оно должно быть на последней строчке в макросе.
Например, создадим макрос для мага на использование {spell:33:12043} (не имеет гкд) и {spell:33:12826} (имеет гкд), что позволит нам мгновенно превратить противника в зверушку:

#showtooltip
/use Величие разума
/use Превращение

Еще один простой, но очень полезный пример макроса:

Данный макрос позволяет мгновенно выбрать и начать атаковать цель танка.
1я строчка выбирает в цель танка (вам придётся каждый раз вписывать имя текущего танка)
2я строчка выберет для вас текущую цель танка.

5. Макросы с модификатором цели​

Вы можете также создавать макросы с кастом заклинаний в определенную цель. Для примеров будем использовать умения паладина.

Базовый шаблон, кастует вспышку в текущую выбранную цель:

#showtooltip
/use [@target] Вспышка света

модификатор [target=player] или сокращенно [@player] кастует в самого себя:

#showtooltip
/use [@player] Вспышка света

модификатор [target=focus] или [@focus] делает каст в запомненную цель:

#showtooltip
/use [@focus] Вспышка света

модификатор [target=mouseover] или [@mouseover], делает каст в цель, на которую вы наводите мышкой, к примеру, по фрейму игрока в пати:

#showtooltip
/use [@mouseover] Вспышка света

Теперь же объединим все эти макросы в один с использованием модификаторов:

#showtooltip
/use [mod:ctrl,@player] Вспышка света;[mod:alt,@focus] Вспышка света;[mod:shift,@mouseover] Вспышка света;[nomod] Вспышка света

С зажатым ctrl — каст в игрока, alt — в фокус, shift — в игрока под курсором мыши, без модификатора — в текущую цель.

Основные модификаторы цели:

  • @player — нацеливается на игрока;
  • @target — нацеливается на текущую цель игрока;
  • @mouseover — нацеливает заклинание на цель, над которой в данный момент находится курсор мыши;
  • @focus — нацеливается на ваш фокус;
  • @targettarget — нацеливается на цель цели. Например, при использовании цели на босса, она будет нацелена на танка или на того, кого босс нацелен в этот момент;
  • @bоss1 — нацеливается на первого босса в списке. Обычно доступно только в подземельях и рейдах. Доступны варианты boss1-4;
  • @arena1 — нацеливается на первого человека в списке Арены. Это модификатор для PvP, доступный только во время боев на арене. Доступны варианты arena1-5;
  • @party1 — нацеливается на первого участника вашей группы. Доступны варианты party1-4;
  • @raid1 — нацеливается на первого участника вашего рейда. Доступны варианты raid1-40;
  • @pet — нацеливается в питомца игрока.

Существуют комбинированные варианты:

  • @party1target — цель 1го члена вашей группы;
  • @focuspet — питомец вашего фокуса и т.д.

6. Макросы с условиями​

Условные выражения можно использовать, чтобы решить, какое действие следует выполнить. Записываются они так же в квадратных скобках [ ] и перечисляются через запятую. Вы можете добавить «no» перед ними, чтобы они вели себя прямо противоположным образом. Например, noharm верно для любой цели, которая не является врагом, но может включать например нейтральных NPC.

  • pet — верно, если у игрока в данный момент есть питомец;
  • combat — верно, если вы в бою;
  • harm — верно, если целью для использования способности является враг;
  • help — верно, если целью для использования способности является союзник;
  • dead — верно, если цель для использования способности мертва;
  • exists — верно, если цель для использования способности существует;
  • channeling — верно, если вы в данный момент используете потоковое заклинание;
  • button:number — (или btn) используется для проверки, с помощью какой кнопки мыши вы активировали макрос. [button:1] по умолчанию, левая кнопка, [button:2] правая, [кнопка:3] средняя. Для мышей с большим количеством кнопок количество кнопок соответствует шаблону для опции;
  • group — верно, если вы в данный момент находитесь в группе. Может быть перестроен в [group: party] или [group:raid];
  • indoors — верно, если вы в настоящее время находитесь в локации, которая считается закрытой или помещении;
  • outdoors — верно, если вы в настоящее время находитесь в локации, которая находится под открытым небом;
  • flyable — верно, если вы в данный момент можете летать;
  • mounted — верно, если вы в настоящее время на средстве передвижения.

Модификаторы клавиш:

  • mod:shift — верно, если комбинация клавиш была нажата при нажатой клавише SHIFT;
  • mod:alt — верно, если комбинация клавиш была нажата при нажатой клавише ALT;
  • mod:ctrl — верно, если комбинация клавиш была нажата при нажатой клавише CTRL.

Пример макроса для охотников с использованием условий. Призываем питомца, если его нет; воскрешаем, если он мертв; лечим, если он жив; прогоняем с зажатым Shift; даем ему сейв с зажатым Alt; лечим питомца в остальных случаях:

#showtooltip
/cast [nopet] Призыв питомца; [@pet, dead] Воскрешение питомца
/cast [mod:shift] Прогнать питомца;[mod:alt] Попятиться; Лечение питомца

7. Другие используемые команды​

  • /run — (или /script) Выполнить скрипт;
  • /use — использует элемент с именем, написанным после команды. Также может использоваться с числами, что заставит его использовать предмет, установленный в слоте, за который отвечает это число;

cf69dcd9a2a87b58 (1).png

  • /stopcasting — остановит чтение текущего заклинания;
  • /startattack — начать атаковать цель;
  • /stopattack — остановить автоатаки;
  • /petattack — отдать питомцу приказ атаковать;
  • /petpassive — перевести питомца в пассивный режим;
  • /petaggressive — перевести питомца в агрессивный режим;
  • /petdefensive — перевести питомца в защитный режим;
  • /petfollow — приказ питомцу следовать за вами;
  • /petstay — приказ питомцу стоять на месте;
  • /castsequence — позволяет создать цикл заклинаний;

Простой пример использования выглядит так:

#showtolltip
/castsequence Выброс лавы,Молния,Молния,Молния,Молния

При первом нажатии макроса будет использован Выброс лавы, а следующими 4 будут Молнии. Макрос будет повторять всё по кругу, если команды были удачно выполнены.

Если необходимо добавить условие остановки цикла, сделать это можно через опцию reset=X , где Х:
число в секундах — будет значить, что если вы не использовали макрос за Х секнуд, то последовательность заклинаний сбросится и начнется с начала.
target — последовательность сбросится если вы сменили цель.
combat — сбросится если изменилось состояние боя
alt/shift/ctrl — сбросится если вы нажали, alt, shift, ctrl соответственно.
Пример использования для бафа жрецов перед боем:

/castsequence reset=10 Молитва стойкости, Молитва духа, Молитва защиты от темной магии, Внутренний огонь, Объятия вампира

  • /castrandom — будет воспроизводить случайную способность или предмет, из заданного списка. Перечислять способности нужно через запятую;
  • /stopmacro — остановить работу макроса;
  • /cancelaura — этак команда снимет с вас заданный баф. Пример PVP макроса для дк, чтобы не попасть в {spell:57:11444} или {spell:57:10326}

#showtolltip
/cancelaura [mod:shift] Перерождение
/cast Перерождение

  • /cancelform название формы — выход из формы друида, облика тьмы и прочих форм;
  • /target имя — берем в цель нпс или игрока с заданным именем или первыми буквами из него;
  • /focus берем свою цель в фокус;
  • /cleartarget и /clearfocus — очищаем свою цель или фокус, соответственно;
  • /assist имя — берем в цель цель указанного игрока. Либо цель нашей цели, если не указываем имя;
  • /targetlasttarget — берем в цель вашу предыдущую цель;
  • /equip название_предмета — наденет на вас заданный предмет;
  • /dismount — слезаем с маунта;
  • /friend ник_игрока — добавляем игрока в список друзей. Можно использовать по цели;
  • /follow ник_игрока — начать следовать за игроком;
  • /ignore ник_игрока — добавляем игрока в черный список;
  • /inspect — осмотреть цель, работает только на игроков;
  • /trade — начинаем обмен;
  • /leavevehicle — покидаем транспортное средство (танки на ОЛО, Береге древних и т.д.).

Команды для взаимодействия в группе или рейде:

  • /invite ник_игрока — приглашаем игрока в группу. Работает и по цели;
  • /uninvite или /kick — исключаем игрока из группы;
  • /promote — назначаем лидером группы;
  • /readycheck — проверка готовности рейда;
  • /group — групповое распределение добычи;
  • /master ник_игрока — назначаем ответственного за добычу;
  • /needbeforegreed — приоритет по нужности;
  • /ffa — каждый сам за себя;
  • /roundrobin — тип добычи «по очереди».

Команды для взаимодействия в гильдии:

  • /guildinvite ник_игрока — приглашаем игрока в гильдию;
  • /gkick ник_игрока — исключаем из гильдии;
  • /gleader ник_игрока — передаем лидера гильдии;
  • /guildquit — выходим из гильдии.

Команды для чата:

  • текст — отправить сообщение с заданным текстом в чат /сказать;
  • /пб — аналогично для чата Поля боя;
  • /гр — чат группы
  • /р — чат рейда;
  • /ор — чат объявлений рейду;
  • /г — чат гильдии
  • /э — эмоции
  • /к — крик
  • /run ChatFrame_OpenChat(«») ChatFrame1.editBox.language = «орочий» — открытие чата для ввода сообщения на заданном языке. Меняем орочий на тот язык, что нужен вам;
  • /run ChatFrame1.editBox.language = «орочий» — меняет язык, на котором будут отправляться ваши следующие сообщения. Не активирует строку ввода в чате.

8. Больше полезных макросов​

Сообщение со ссылкой на предмет в чате:

/run local _,x = GetItemInfo(43102); SendChatMessage(«Куплю много «..x..», цену в ПМ» , «channel», nil , 4);

где 43102 — id предмета из базы данных, 4 — номер канала

Проверка длительности глобальной перезарядки. Вместо порчи подойдет любое мгновенное заклинание:

/cast Порча
/run print(format(«Cooldown: %g»,select(2,GetSpellCooldown(«Порча»))))

Установка рейдовой метки на текущую цель:

/script SetRaidTarget(«target»,1);

Где 1 — звезда, 2 — круг и т.д.

Установка рейдовой метки на землю. Убираем при повторном нажатии:

/click CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton
/click DropDownList1Button8

Меняем последнюю цифру, чтобы поменять метку.

Покупка заданного предмета стопками по несколько штук:

/script local function buy (n,q) for i=1,100 do if n==GetMerchantItemInfo(i) then BuyMerchantItem(i,q) end end end buy («Ледяной шар«,10)

Меняем название предмета и число после него.

Открытие и закрытие окна аддона recount или details:

/recount toggle
/details toggle

Макрос для выдачи gp по цели, если используется аддон EPGP:

Макрос для проверки скорости движения вашей цели:

/script x=GetUnitSpeed(«target») DEFAULT_CHAT_FRAME:AddMessage(format(«Speed: %d yds/sec, %.1f kph, %.1f mph, %d%% normal run speed»,x,x*3600/1093.6133,x*45/22,x/7*100))

Скрытие текста ошибок в верхней части экрана (заклинание не готово и т.п.):

/script UIErrorsFrame:Hide()

Макрос позволяет убрать боковые текстуры орлов на стандартных панелях:

/run MainMenuBarLeftEndCap:Hide();MainMenuBarRightEndCap:Hide()

Скрываем названия макросов на нижних панелях:

/run for i = 1, 12 do _G[«ActionButton»..i..»Name»]:Hide() end
/run for i = 1, 12 do _G[«MultiBarBottomLeftButton»..i..»Name»]:Hide() end
/run for i = 1, 12 do _G[«MultiBarBottomRightButton»..i..»Name»]:Hide() end

Отображение вашей текущей локации и координат в чате:

/run px,py=GetPlayerMapPosition(«player»); DEFAULT_CHAT_FRAME:AddMessage(format(«You are at: %s (%0.1f, %0.1f)»,GetZoneText(),px*100,py*100));

Запрет автоповорота камеры при использовании потоковых заклинаний:

/script SetCVar(«cameraSmoothTrackingStyle», 0)

Включаем запись комбатлога, сохраняться он будет в текстовый файл WoWCombatLog в папке Logs. Повторный клик выключит запись:

Перезагрузка интерфейса:

Открыть/закрыть окно с информацией о фрейме под курсором мыши:

Запустить внутриигровой таймер:

/run Stopwatch_StartCountdown(0, 0, 0); Stopwatch_Play()

Запустить таймер с обратным отсчетом:

/run Stopwatch_StartCountdown(0, 0, 60); Stopwatch_Play()

Макрос для выхода из группы, если стандартный метод недоступен из-за ошибки интерфейса:

Выход из тела:

Принять воскрешение:

/script AcceptResurrect()

Снятие и надевание предмета по нажатию:

/run PickupInventoryItem(18)PutItemInBackpack()
/equipslot 18 Фал’инраш, Защитник Кель’Таласа

Применение заклинания без возможности сбить самому себе чтение потокового заклинания:

#showtooltip Похищение души
/cast [nochanneling] Похищение души

Спам кнопки аое заклинания, без потери области наведения:

#showtooltip
/cast !Движение Хаоса

Отправляем питомца атаковать цель под курсором мыши, например, чтобы разбить вражеский тотем:

Сбитие каста по фокусу; по цели, если нет фокуса; только по цели, если зажат Shift:

#show Антимагия
/stopcasting
/cast [mod:shift,@target][@focus,harm,exists][@target,harm,exists][nomod] Антимагия

Макросы для воинов со сменой стоек пишутся по следующему принципу. На примере {spell:33:47465}, которое может использоваться только в Боевой и Оборонительной стойке:

#showtooltip Кровопускание
/cast [nostance:1/2] Боевая стойка
/cast [stance:1/2] Кровопускание

Где 1, 2 и 3 — номера стоек.

Переодеваем комплекты экипировки. Так же применяется для надевания предмета в случаях, когда таких предметов у персонажа 2 или больше:

где Комплект1 название заранее сохраненного комплекта экипировки с необходимым предметом.

Раздел будет пополняться. Вы можете предложить свой макрос через форумную систему жалоб (кнопка под сообщением). В сообщении предоставьте сам макрос и опишите задачи, которые он решает.

9. Часто задаваемые вопросы​

1. В моем макросе больше 255 символов, я не смогу его использовать?
— Сможете, но только с дополнительными модификациями. Самые популярные из них Bindpad и SuperDuperMacro.

2. Мне не хватает ячеек под макросы, можно сделать больше?
— К сожалению, нельзя. Но не исключаем такой возможности в будущем.

3. Я хочу использовать аое способность мгновенно, не прицеливаясь курсором мыши. Я что-то читал про команду @Cursоr.
— Такой макрос написать нельзя. Команда @Cursоr появилась в более поздних версиях игры.

4. Я хочу чтобы заклинание из макроса использовалось только тогда, когда на мне есть определенный баф (дебаф на цели, заклинание на перезарядке, персонаж в движении, персонаж в контроле).
— Макросы с подобными проверками заблокированы сервером. Работать они не будут.

5. Пытаюсь макросом взять в цель вражеский {spell:33:8143} на арене, но «/target тотем трепета» не срабатывает.
— Взять в цель тотемы таким образом нельзя, иначе это было бы не справедливо по отношению к шаманам.

Mukhabbat

    Orfan

Отправлено 12 Май 2014 — 23:29

*
Популярное сообщение!

:excl:

макрос1.png

faq-40x40.jpg

Помощь по разделу:

obnovlenie_windows_sm 40х40.png

Обновления макросов:

макро созд.png

макро класс1.png

макро доп.png

  • 163

post-457423-0-67960900-1420150439.png

d8815a0687cc0cc0a821b044990c528e.png

  • Наверх

Начать играть на Isengard?

Присоединяйтесь к нашему сообществу!

Играйте на самом работоспособном и стабильном русскоязычном WoW сервере без доната игровых ценностей!

lensh

    You face Jaraxxus!

Отправлено 12 Май 2014 — 23:31

Спс, познавательно.
Мискликнул оценкой с телефона( Почему нельзя как раньше менять оценку?

  • 0

  • Наверх

— History —

    -> Спасибо за Ваш отзыв! <-

Отправлено 12 Май 2014 — 23:36

Кул, завтра будет что почитать

  • 0

  • Наверх

yellow name

Отправлено 12 Май 2014 — 23:37

как по мне слегка крупноватый шрифт,но интересно будет почитать.

  • 0

cc75bc28b17033c5af61eac17932b7a4.png

  • Наверх

S1m1Lar

Отправлено 12 Май 2014 — 23:39

Да ты сумасшедший! Но мне нравятся твои творения, черт возьми  ;)

  • 0

  • Наверх

Mukhabbat

    Orfan

Отправлено 12 Май 2014 — 23:47

как по мне слегка крупноватый шрифт,но интересно будет почитать.

По мне, в самый раз. Ведь крупным шрифтом только заголовки тем, а статьи вполне читабельны.

  • 0

post-457423-0-67960900-1420150439.png

d8815a0687cc0cc0a821b044990c528e.png

  • Наверх

1van4eg

Отправлено 12 Май 2014 — 23:58

автор молоток, жирный + , хотя возможно мне это и не пригодится

  • 0

  • Наверх

tresnigk

Отправлено 13 Май 2014 — 00:07

по класу не открывает макросы !

  • 2

29dbea317486365d564eb83723f69fea.png

  • Наверх

wampirr

Отправлено 13 Май 2014 — 00:08

кликнул на шару 1 раз

попал сюда:

Пример №1:

/targetexect Вася

если что то

/targetexAct

с твоим /targetexect влагалище

можно девственником остаться

меньше копипаста, там ошибка 100 раз повторяется

  • -1

  • Наверх

sUppamodel

Отправлено 13 Май 2014 — 00:09

по класу не открывает макросы !

Прочитай внимательно помощь по разделу

  • 1

  • Наверх

Mukhabbat

    Orfan

Отправлено 13 Май 2014 — 00:10

кликнул на шару 1 раз

попал сюда:

Пример №1:

/targetexect Вася

если что то

/targetexAct

с твоим /targetexect влагалище

можно девственником остаться

меньше копипаста, там ошибка 100 раз повторяется

исправлю сейчас.

  • 1

post-457423-0-67960900-1420150439.png

d8815a0687cc0cc0a821b044990c528e.png

  • Наверх

wampirr

Отправлено 13 Май 2014 — 00:11

а так-то ты поработал на ок =) грац и спс от лица тех кому нид

ума не приложу зачем тебе этот геморой

  • 0

  • Наверх

Mukhabbat

    Orfan

Отправлено 13 Май 2014 — 00:17

а так-то ты поработал на ок =) грац и спс от лица тех кому нид

ума не приложу зачем тебе этот геморой

Как уже говорил недавно, это как хобби и опыт в веб дизайне, правда мизерный, но все же, мнения игроков присутствуют главное. Да и мне нравится заниматься разбором игровых статей. 

  • 0

post-457423-0-67960900-1420150439.png

d8815a0687cc0cc0a821b044990c528e.png

  • Наверх

Kitekat

Отправлено 13 Май 2014 — 01:22

:blink: темя для гуглобаненных, это еще хуже собрания всех говногайдов.

  • -10

  • Наверх

Mukhabbat

    Orfan

Отправлено 13 Май 2014 — 01:31

:blink: темя для гуглобаненных, это еще хуже собрания всех говногайдов.

Можно было просто промолчать… Немного неприятно слышать подобное. Данная тема собирает в себе все лучшее + все классовые макросы собраны вместе. А еще и обсудить можно это все. Так что, я думаю ты далеко не прав….  :bye:

  • 1

post-457423-0-67960900-1420150439.png

d8815a0687cc0cc0a821b044990c528e.png

  • Наверх

Killer347

Отправлено 13 Май 2014 — 03:06

я один не вижу скрытый текст?(под сполером)

  • 0

  • Наверх

Kitekat

Отправлено 13 Май 2014 — 03:25

Можно было просто промолчать… Немного неприятно слышать подобное. Данная тема собирает в себе все лучшее + все классовые макросы собраны вместе. А еще и обсудить можно это все. Так что, я думаю ты далеко не прав….  :bye:

Я думаю что тема макросов так избита, что тебя надо банить за репофарм

  • -15

  • Наверх

Ve1eran

Отправлено 13 Май 2014 — 03:29

Можно было просто промолчать… Немного неприятно слышать подобное. Данная тема собирает в себе все лучшее + все классовые макросы собраны вместе. А еще и обсудить можно это все. Так что, я думаю ты далеко не прав….  :bye:

просто признайся что ты лайкодрочер. 

  • -6

f7c9eafe48875648b932e5ba8f9fddbf.png986e3ff9b34fa256746722ba4c2966bf.png

  • Наверх

Mukhabbat

    Orfan

Отправлено 13 Май 2014 — 03:38

Можете не лайкать, я вас не прошу. Я не ради каких то циферок я трачу свое время. Причину статей я уже объяснил выше. К тому же на форуме нету тем про макросы…

Я думаю что тема макросов так избита, что тебя надо банить за репофарм

думать не для тебя

я один не вижу скрытый текст?(под сполером)

прочти помощь по разделу. Классовые макросы будут дополняться со временем.

  • 0

post-457423-0-67960900-1420150439.png

d8815a0687cc0cc0a821b044990c528e.png

  • Наверх

Ve1eran

Отправлено 13 Май 2014 — 03:40

Вообще то тема есть, только она немного не оформленна.  

А такие темы как твои , я бы удалял , потому что они уменьшают и так атрофированный мозг воверов. 

Пару кликов в гугле , и эта же инфа . Только нужно пошевелить парой извилин

Как отписались выше, инфа для гуглозабаненых.

  • -11

f7c9eafe48875648b932e5ba8f9fddbf.png986e3ff9b34fa256746722ba4c2966bf.png

  • Наверх

Macros
General guides

Macros Beginners Guide
Making a macro
Macro conditionals
Macro commands
Category:Macros

Useful macros by class

Useful macros for death knights
Useful macros for demon hunters
Useful macros for druids
Useful macros for hunters
Useful macros for mages
Useful macros for monks
Useful macros for paladins
Useful macros for priests
Useful macros for rogues
Useful macros for shamans
Useful macros for warlocks
Useful macros for warriors

A macro is a list of slash commands. Common slash commands include the following:

  • /say (/s)
  • /whisper (/w, /talk, /t)
  • /reply (/r)
  • /emote (/e, /em, /me)
  • /dance

With macros, these commands can be used from action buttons, and many of them can be used at once. Each unique command goes on its own line and is written exactly as it would be typed it in the chat box. For instance, a macro that makes the player yell «Everybody, dance now!» and burst into dance would be written thus.

/y Everybody, dance now!
/dance

A mostly complete list of slash commands is available at Macro API. Wowpedia is a great source of additional information for macros, especially scripts using the /run command (which will be covered later).

Note: Macros run all the commands at once. This means that when you click the button, the macro runs each command from start to finish before returning control to the game. This has two important effects. First, if you write a macro that takes a long time to execute (like /run for i=1, 100000000 do end), the game will freeze for as long as it takes to run the macro.

Second, and arguably more important, there is no way to wait in a macro without freezing the game. This fact will become much more apparent when we start dealing with the /cast command and its ilk. Some addons can provide a way to issue a command at a later time, but they can only be used for «benign» functions like chatting, emotes, and issuing commands to other addons (though equipping weapons in combat is allowed).

First, open up the macro window. You can do this either by opening the main menu and selecting Macros, or by typing /macro (/m) in the chat box. At the top of the window, you’ll see two tabs: General Macros and Yourname Specific Macros. General macros are stored on an account-by-account basis and are shared by all your characters. Character specific macros are, well, I think you can figure this one out yourself. :P Immediately under the tabs is a grid of 18 boxes where the macros are displayed. Under those, there is a single box which displays your currently-selected macro with a Change Name/Icon button next to it. Below that is the edit box where you actually type the macro. Finally, at the bottom you have a number of self-explanatory buttons.

To create a macro, click the New button at the bottom of the window. This brings up another small window off to the side where you choose the icon and type a name for the macro. If you choose the question mark icon (Inv misc questionmark), WoW will automatically pick an icon for your macro based on what spells or items are listed in the macro. Once you have chosen an icon and a name, click the Okay button.

A few notes: You can control what icon is shown in place of the question mark with the #show command. Although you can name two macros the same, it is better to avoid this since some functions of addons or even certain macro commands reference macros by name. You can also add custom icons to the list (see the Part III).

Now you will notice that the macro icon you chose has been added to the 18 boxes mentioned earlier (as much of the name as will fit is also displayed on the icon). The newly created macro will also be selected so now it’s time to start writing your macro. Click in the edit box of the macro window to start typing.

Note: Macros have a 255 character limit. Rumor has it that this is because they store macros on the servers (since patch 3.0.2).

When you are done typing your macro, click the Save button, drag the macro’s icon from the grid and place it on an action button. The macro will also be automatically saved when you first try to use it or when you close the macros window. Click the button, and there you have it!

Casting spells[]

During the normal course of play, you aren’t likely to type many slash commands that are generally useful for macros. Sure, the occasional emote macro can make for some interesting role playing, but c’mon… There’s got to be more to it than that…

There is. Enter /cast, the most common command you will see in macros. The /cast command allows you to cast any spell from your (or your pet’s) spell book by name. The simplest case is a command like:

/cast Shadow Word: Pain

This macro will cast Shadow Word: Pain on your target. It behaves exactly as if you had dragged SW:P onto that spot on your action bar. The action bar code recognizes the spell and will show cooldown and range feedback on the icon. In fact, if you choose the question mark icon I mentioned earlier, the action bar will even show the icon for SW:P.

«Ho, hum,» you might be thinking… Why not just put the spell on your bar? Well, that’s where combining multiple commands comes in handy, and this is exactly what makes macros so useful. What if you’re a mage and you want to let your party know that you’re about to sheep something? Well, simply put the cast and /p message in a macro:

/cast Polymorph
/p Sheeping %t! You spank it, you tank it!

Note: Since the macro is executed all at once, the /p command will be issued when you start the cast, and will not care either way whether you have a valid target or whether Polymorph is on cooldown. This also means you can put the two commands in either order and it will have the same effect.

There are also addons that handles this, such as Raeli’s Spell Announcer.

Notes about spell names[]

The /cast command is pretty picky when it comes to your spell name. In order for it to successfully cast a spell you must use correct spelling, punctuation, spacing, etc. The best way to guarantee you enter the right name is to open your spell book while writing the macro, place your cursor in the macro where the spell should be, and shift-click the spell in your spell book. This will enter the exact name of the spell, including any modifiers like Druid forms for the Mangle ability.

Using items and trinkets[]

Simple answer: the same way you cast a spell. The command for using an item is (you guessed it) /use. Like /cast, its simplest form takes the name of the item you want to use:

/use Green Mechanostrider

There are also a couple other forms of the /use command:

/use <inventory slot>[]

This form of use allows you to use an item in the specified slot. See also InventorySlotId for lists of the slot numbers. Example:

/use 13

Uses whatever is in your top trinket slot.

/use <bag> <slot>[]

You can also use an item in a specific bag location. Lets say you always keep the food you want to feed your pet in the first slot of your backpack. You can easily write a macro to feed your pet as follows:

/cast Feed Pet
/use 0 1

Bags are numbered 0-4 from right to left (0 is always the backpack) and the slots are numbered starting at 1 going left to right, top to bottom (like reading):

1  2  3  4
5  6  7  8
...

or

      1  2
3  4  5  6
7  8  9  10
...

Trading risk of confusion for completeness, I’ll let you know that /cast and /use function exactly the same way. /cast can use items and /use can cast spells. This isn’t very useful for simple macros like you’ve seen so far. However, when you start dealing with macro options and sequences you’ll be happy to know that you can intermingle items and spells in the same command.

Multiple actions with one click[]

In general, you cannot cast more than one spell with a single click of a macro. Most spells and some items trigger the global cooldown (GCD) which keeps you from taking too many actions at once. Even if a spell fails to cast, if it would trigger the GCD, it prevents subsequent /casts in the macro from running. This was not the case prior to patch 2.0 which is why you may still come across macros like the following:

/cast Overpower
/cast Execute
/cast Mortal Strike
/cast Sunder Armor

Macros like this do not work anymore. As soon as Overpower fails to cast, the game will block all the other spells from casting as well, even though the GCD is not actually triggered.

There is a bit of good news, though. Certain spells can actually be cast at the same time in a single macro. Any spell that is instant and does not trigger the GCD can be followed by another cast. The spell’s tooltip will tell you if it’s instant, but you have to use the spell (or check a database site such as wowhead.com) to know if it triggers the GCD.

Prior to patch 2.3 it was necessary to place a /stopcasting command after the instant, non-GCD spells (but not items). The game engine assumed that after the first /cast is attempted, a spell is now in progress. /stopcasting removes this assumption and prevents the «Another action is in progress» error. Since the spell is instant, /stopcasting does not actually cancel the cast. Example:

/cast Furious Howl
/stopcasting
/cast Blood Fury
/stopcasting
/cast Call of the Wild

Note that since patch 2.3, this is no longer necessary. The above macro can be shortened to:

/cast Furious Howl
/cast Blood Fury
/cast Call of the Wild

Targeting[]

Targeting is another common task in macros. This is accomplished either by using dedicated targeting slash commands which actually change your target or by using the [@unit] macro option on commands that accept them. When you use the macro option, you are actually casting the spell or using the item directly on the unit without changing targets. Macro options will be covered in great detail in Part II. For now, I’ll show you how to use the targeting commands.

The most basic targeting command (unsurprisingly) is /target. Its use is as simple as

/target Cogwheel

/target does a closest match which means if you do /target Cog and someone named Cogwheel is standing near you (and no one named Cog is) it will target them. This is a plus or a minus depending on your situation. Unfortunately, it will also target irrelevant units. This makes macros like the following much less useful than they might first appear.

/target Blackwing Mage
/cast Bane of Agony

If no Blackwing Mages are around, this might target someone in your raid who happens to have the letters B and L in their name. While they’re safe from the wrath of your curse, it’s still a bit disconcerting. Another problem is that it may target something 100 yards behind you that you don’t really care about. (Patch 2.3 added the /targetexact command to eliminate part of the problem.)

In addition to specifying the name of someone you would like to target, you can also provide a unit ID. Unit IDs are a way to identify a particular character, mob, NPC, etc. For instance, your current target can always be accessed by the «target» unit ID (obviously not the most useful for the command we’re discussing at the moment :P). You yourself are accessed by the «player» ID, and if you have a pet it would be referenced by «pet.» You can also append «target» to the end of any valid unit ID to arrive at that unit’s target. There is a joke about Kevin Bacon involving a macro like:

/target targettargettargettargettargettarget

UnitId has a full list of allowed IDs.

Other targeting commands[]

Here is a brief overview of the other targeting commands:

/assist[]

By itself, assist targets your target’s target (e.g. if you are targeting me, and I’m targeting Iriel, /assist would make you target Iriel). You can also provide a name or unit to /assist and you will assist the specified entity:

/assist Cogwheel 

There is an interface option which will automatically start you attacking if you end up with a hostile target.

/cleartarget[]

Leaves you with no target.

/targetexact[]

Targets a unit with the exact name listed. If the name is spelled wrong or that unit is not near you, your target will not be changed.

/targetlasttarget, /targetlastfriend, /targetlastenemy[]

As the names suggest, these commands will target your previous target, your last targeted friend, or your last targeted enemy. If you previously had no target, this command will do nothing.

/targetenemy, /targetfriend[]

These commands cycle through the specified type of unit. /targetenemy is like pressing TAB, and /targetfriend is like pressing CTRL-TAB. You can also add a parameter of 1 which reverses the direction of the cycle (/targetenemy 1 is like pressing SHIFT-TAB).

Note: You can only use these commands once per macro.

/targetenemy
/targetenemy 1
/targetfriend
/targetfriend 1

/targetenemyplayer, /targetfriendplayer[]

These commands cycle through player-controlled units. They behave just like /targetfriend and /targetenemy except they will only target other players, ignoring computer-controlled units like NPC mobs, pets, minions, creations, etc. They are useful for PvP. As with /targetenemy, a 1 may be added to reverse the direction.

/targetenemyplayer
/targetenemyplayer 1
/targetfriendplayer
/targetfriendplayer 1

Note: You can only use these commands once per macro.

/targetparty, /targetraid[]

Cycles through your nearest party or raid members. Like /targetenemy, you can add a 1 to reverse the direction.

/targetparty
/targetparty 1
/targetraid
/targetraid 1

Pet control[]

As mentioned in the spell casting section, you can use /cast to cast your pet’s abilities by name. In fact, Blizzard had to change the name of the Mage elemental’s Frost Nova to Freeze because there was no way to use it in a macro. But as everyone with a pet is aware, that’s nowhere near the end of the line for pet control. Luckily the Burning Crusade patches brought us a host of new pet commands:

/petattack[]

Sends your pet to attack your target. You can also specify a name or unit ID and your pet will attack that instead.

/petfollow[]

Causes your pet to follow you, cancelling its attack if necessary.

/petstay[]

Causes your pet to hold at its current location until given another command.

/petmoveto[]

Brings up a targeting reticule. Click on the ground at a location and your pet will move there.

/petpassive, /petdefensive[]

Sets the reaction mode of your pet just like the buttons on your pet bar.

/petautocaston, /petautocastoff, /petautocasttoggle[]

These commands manipulate the auto-cast of a given pet spell. The first will always turn auto-cast on, and the second will turn it off. Example:

/petautocaston Torment
/petautocastoff Suffering  

Recently, a new command has been added which will toggle a pet’s auto-cast spells, petautocasttoggle. Example:

/petautocasttoggle Fire Breath

This will turn the auto-cast on if it is currently off, or off if it is current on, which can entirely replace the former command depending on the planned use.

Controlling button feedback and the question mark icon (Inv misc questionmark) with #show[]

By default, WoW uses the first spell or item that appears in a macro to show cooldown, range, and availability feedback on the button, and to pick which icon to display when you use the question mark icon. Take our multi-spell macro from earlier as an example:

/use Talisman of Ephemeral Power
/cast Arcane Power
/cast Presence of Mind
/cast Pyroblast

With this macro, WoW chooses Arcane Power for the feedback. However, this is probably not what you really want. The main point of this spell is to cast Pyroblast. The first few lines merely exist as support spells to make the Pyroblast more effective. You can make the button behave as if Pyroblast were the first spell by adding the following line to the top of the macro:

#show Pyroblast

If you used the question mark icon for the macro, the button will even have the icon of Pyroblast without any extra effort on your part. The parameter to #show (in this case Pyroblast) works the same way as the /cast and /use commands. You can use a spell name, item name, item id (item:12345), inventory slot, or bag and slot numbers.

Similar to #show is #showtooltip. Normally when you mouse over a macro on an action bar, your tooltip displays the name of the macro. This is not incredibly useful most of the time (especially if you use an addon like TheoryCraft to give you detailed spell information in tooltips). However, the #showtooltip command allows you to specify a spell to use in the tooltip the same way as #show. If you use #showtooltip, you do not need to use #show.

If you’re happy with the spell that WoW is choosing for the feedback, you can use #showtooltip without a spell to save space in your macro. WoW will still use whichever spell it was choosing before, but it will now show the tooltip info for that spell/item.

You cannot use #show and #showtooltip in the same macro, the second one will be ignored.

Please Note: unlike slash commands, #show and #showtooltip must be written in lower case letters.

Conditionals for #show(tooltip)[]

The #showtooltip and #show commands will also accept the conditionals found further below. Here’s a simple example:

#showtooltip [modifier:shift] Conjure Food; Conjure Water

This line at the top of the macro will show icon and tooltip corresponding to the Conjure Water spell, unless shift is held down, in which case Conjure Food will be used instead, regardless of what else the macro is doing and which spells it is using.

Other slash commands[]

Now that you have a solid foundation I’d like to briefly cover some of the other slash commands at your disposal. Some of these commands may seem a bit pointless at first glance, but when you combine them with the macro options from Part II, they can perform some neat tricks.

Equipping items[]

There are three commands for equipping items: /equip, /equipslot, and /equipset. /equip simply takes an item name and will equip it to the default slot as if you had right-clicked it in one of your bags (i.e., a one-handed weapon will be equipped to your main hand). /equipslot takes an inventory slot ID and an item name, and equips the item to the specified slot. Note that when using /equipslot, you must respecify the slot for each set of conditionals. If you use the Blizzard equipment manager and save an equipment set, you can use the /equipset command to use it. Examples:

Equip a weapon to default slot:

/equip Honed Voidaxe

Equip a trinket to the lower trinket slot:

/equipslot 14 Carrot on a Stick

Save two equipment sets. One called Tank that has a sword and shield equipped, one called DPS that has a two handed weapon equipped. Use this macro to switch between the two:

/equipset [equipped:Shields] DPS; Tank

If you have a shield on, it’ll equip your saved DPS set, otherwise it’ll equip your saved Tank set.

Swap between your offhand and a shield:

/equipslot [equipped:Shields] 17 Merciless Gladiator's Cleaver; 17 Crest of the Sha'tar

Note: If you are trying to equip two of the same weapon simultaneously into different slots, your macro will not work properly.

Note: Addons are allowed to use the equipping functions directly, even during combat.

Sequencing spells and items[]

Many times you will find yourself casting a series of spells or use certain items in the same order on pretty much any mob you fight. To make this job a bit easier, we have the /castsequence command. /castsequence takes a list of spells and/or items separated by commas. These follow the same rules as /cast and /use. This means you can interchange spell names, item names, item IDs, inventory slots, and bag slot combinations. Each time you run the macro, it activates the current spell/item. If the spell or item is used successfully, the sequence will move to the next entry. You must repeatedly activate the macro to use all the spells in the sequence. Once you use the last entry in the list, it will reset to the beginning. Example:

/castsequence Immolate, Corruption, Bane of Agony, Siphon Life

This might be something you would use for a Warlock’s opening attack. Note, however, that if Immolate fails to cast for some reason (out of mana, not in range, silenced, etc.), the sequence will remain at that point. Because of this, you cannot use a /castsequence to make a spammable macro like:

/castsequence Overpower, Execute, Mortal Strike

Before the spell list (but always after the conditionals), you can also specify reset conditions to start the sequence over before it reaches the end. The basic syntax for reset conditions is:

reset=n/target/combat/shift/alt/ctrl

Where n is the number of seconds of inactivity after which the macro should be reset. In other words, if more than n seconds pass without the macro being called, then the next time you call it the sequence will start from the first spell. Note that this is not the time since the first spell in the sequence was cast, but rather the time since the macro was last called (to cast any of the spells in the sequence). This is a very important distinction because it means you cannot use a reset timer to account for cooldown.

As to the other conditions, «target» resets the sequence when you change targets; «combat» when you leave combat; «shift», «alt», and «ctrl» when you activate the macro with one of those keys depressed. You can specify any number of these conditions separated by slashes as shown.

Example:

/castsequence reset=10/shift Spell 1, Other Spell, Some Item

To make a macro cycle through two different ‘sets’ of spells that should be used together, where each set can not be used at the same time (i.e trinkets with shared cooldowns) it is possible to use multiple instances of /castsequence to achieve this effect.

Example:

/castsequence Berserking, Icy Veins
/castsequence Trinket 1, Trinket 2

On the first button push this macro will cast Beserking and Trinket 1, on the second it will cast Icy Veins and Trinket 2.

If you used the question mark icon, WoW will automatically update the icon to the current element of the sequence. If you have other /casts or /uses (or complex conditionals) before the /castsequence, though, WoW will sometimes not be able to figure out which icon to use. In this case, you can specify the icon using #showtooltip as described above

Random spells and items[]

One of the most common requests on this forum is for a macro to use a random mount. This is extremely trivial thanks to the addition of /castrandom and /userandom. Like /castsequence, /castrandom and /userandom takes a list of spells and/or items separated by commas and picks one at random when you run the command. Example:

/castrandom Swift Green Mechanostrider, Black Battlestrider, Summon Dreadsteed 

Attacking[]

Change your target to unit and start auto-attacking.

/startattack Cogwheel

Stop auto-attacking.

/stopattack

Action bar manipulation[]

There are two commands that allow you to change action bar pages: /changeactionbar and /swapactionbar. /changeactionbar takes a single number and will always switch to that page. One use of this is for hunters to emulate stances by having a pair of macros like:

/cast Aspect of the Hawk
/changeactionbar 1

and

/cast Aspect of the Monkey
/changeactionbar 2

/swapactionbar takes two page numbers and will swap between them each time it runs. If you’re on a page other than one of the two specified, it will be change to the first of the two.

/swapactionbar 1 2

Removing buffs[]

The /cancelaura command allows you to remove unwanted buffs. For example, a Death Knight without the Horn of Winter minor glyph cannot cast Horn of Winter if a glyphed version of the buff is already on them (from another Death Knight). The following macro solves this problem:

/cancelaura Horn of Winter
/cast Horn of Winter

Leaving a form[]

With the exception of Warriors, any class with stances (Druids, Priests with Spell shadow shadowform [Shadowform], Rogues with Ability stealth [Stealth], etc.) can use /cancelform to leave their current form. Example:

/cancelform
/use Super Healing Potion

In patch 2.3, /cancelform will be recognized instantly for Druids. Until then and for everyone else, you may have to click the button twice.

Stopping a cast[]

/stopcasting was touched on briefly in other contexts but its main use, as you might guess, is used to stop another spell cast that’s in progress. This is useful for making «panic buttons» that interrupt whatever you’re doing at the moment in favor of something more important. On a Warlock, for instance, the following macro can be used:

/stopcasting
/cast Shadowburn

Halting a macro early[]

/stopmacro is one of those commands that doesn’t really come into its own unless you use it with macro options. Its main use is to implement «fall-through» logic to prevent you from continuing a macro if certain conditions are true. See «Using focus» at the end of part II for an example.

Dismounting[]

/dismount

Basically self-explanatory.

Saving a target for later action[]

The /focus command allows you to save a target to come back to later. For example, say your raid leader assigns you a target to sheep. First, select that mob, and type /focus. Now you can use a macro like the following to cast sheep on your focus:

/cast [@focus] Polymorph

Note that this is not the most efficient use of the focus feature. See «Using Focus» towards the end of Part II for a much more in-depth look at this mechanic.

Simulating button clicks[]

The /click command takes the name of a button and acts like you clicked the button with your mouse. By default, it behaves like a left-click, but you can specify other mouse buttons in the command. There are a few ways to determine the name of the frame you’re interested in:

  • You can use an addon. Some addons, including MoveAnything, give you a way to see the name of the frame underneath your mouse.
  • You can look through the UI code for the frame. This is really only applicable to people who are comfortable with addon programming.
  • You can bind the following macro by a key and then run it while your mouse over the frame in question:
/run local f = GetMouseFocus(); if f then DEFAULT_CHAT_FRAME:AddMessage(f:GetName()) end

/click can be used for many different purposes. You can chain together multiple macros by /click’ing buttons with other macros on them. For example, you might have a really long macro that doesn’t fit into 255 characters. Put as much of it as you can in one macro and end it with the following line:

/click MultiBarRightButton1

The rest of the code would go into a new macro that you would then place on MultiBarRightButton1 (the first button of the right-hand vertical extra action bar).

You can also do things that normally wouldn’t be available to macros. For instance, turning on auto-cast for a pet spell can’t be done by Lua scripts and there isn’t a secure command for it (until the next patch, at least). However, you can write a macro to pretend that you right-clicked on one of your pet bar buttons:

/click PetActionButton5 RightButton

This command will act like you right-clicked the 5th pet button from the left. The extra button parameter can also be LeftButton (the default), MiddleButton, Button4, or Button5.

On top of these uses, there are some more complex examples of /click branching towards the end of Part II.

Action bar button names[]

As shown above, MultiBarRightButton1 refers to the first button of the right-hand vertical extra action bar. MultiBarRightButton2 refers to the second button, and so on. Names for buttons on each of the standard action bars are as follows, replacing the # with an appropriate number:

ActionButton#                Main Bar*
BonusActionButton#           Dynamic bar that switches actions based on Druid Forms, Warrior Stances, and Rogue Stealth*
MultiBarBottomLeftButton#    Bottom Left Bar
MultiBarBottomRightButton#   Bottom Right Bar
MultiBarRightButton#         Right Bar
MultiBarLeftButton#          Right Bar 2 (to the left of "Right Bar")
PetActionButton#             Pet Bar
ShapeshiftButton#            Druid Forms, Paladin Auras, Warrior Stances, Death Knight Presences, Rogue Stealth

* The BonusActionBarFrame frame replaces the ActionBarFrame frame for all Druids, Warriors, and Rogues and /click ActionButton# and /click BonusActionButton# do the same thing for these classes.

Advanced Scripting[]

What scripts can’t do[]

Scripts are very powerful tools that can make complex decisions based on a number of criteria. Because of this power, Blizzard has limited the types of things we’re allowed to do with them in order to keep macros and addons from taking actions that should be controlled by the player. I’m starting this section with what you can’t do because I don’t want you to get your hopes up. While scripts do remain useful for quite a few purposes, you cannot use them to cast spells, use items, change your action bar page or affect your target in any way. You are limited to using the «secure» commands already shown for those tasks.

Scripting[]

The WoW UI is controlled by code written with the Lua scripting language. You can take advantage of this scripting system in a macro with the /run command (equivalent to /script—I use /run to save a few characters). The whole script must be on one line, though you can have multiple /run commands in a single macro.

A full treatment of Lua and programming in general is well beyond the scope of this document. However, if you have some programming experience, you should head over to Lua.org to learn the basics of Lua and if you don’t have any programming experience, you may want to check out LearnToProgram to get a foundation of the concepts used in scripts.

Blizzard provides many functions (called the API) which the Lua scripts can use to control the UI. You can view the API and other features of the UI system over at Interface Customization (if you spend any considerable time with scripts and/or addons, Wowpedia will be indispensable). I can’t possibly cover all the details of the UI environment, so I will simply present you with one of my favorite scripts as an example. See the previously linked references and the Mod Author Resources sticky for more information.

The following macro (on which I based my CCWarn addon) will whisper everyone in your raid to change their targets if they have the same target as you. This is to help keep them from breaking the sheep that this macro casts as well.

/cast Polymorph
/run for i=1,GetNumRaidMembers()-1 do local u,t="raid"..i,"target"if UnitIsUnit(u..t,t)then SendChatMessage("Change targets! Trying to sheep...","WHISPER",nil,UnitName(u))end end

There are two reasons that it looks as obfuscated as that. First, there is the 255 character limit (though there is a workaround in Part III); you often need to take certain shortcuts in order to get a script to fit in a macro. Second, you have to keep the entire script on one line. Under more ideal circumstances, that code would look more like:

for i = 1, GetNumRaidMembers() - 1 do
    local unit = "raid"..i
    if UnitIsUnit(unit.."target", "target") then
        SendChatMessage("Change targets! Trying to sheep...", "WHISPER", nil, UnitName(unit))
    end
end

Macro conditions[]

Macro conditions are a way to control actions based on various pieces of information. To dive right into an example, the following macro will cast Renew on a friendly target and Shadow Word: Pain on a hostile one.

/cast [help] Renew; [harm] Shadow Word: Pain

When you run this macro, the [help] condition is checked. This determines whether your target is someone you can cast beneficial spells on. If the [help] is true, it then casts Renew and the macro moves to the next line. Otherwise (either you have no target, or you can’t cast a helpful spell on your target), it falls through to the next clause. Now it checks for the [harm] condition. [harm] is just like [help] but for offensive spells. If true, it casts Shadow Word: Pain. If it isn’t true (no target or you can’t harm your target) then it does nothing because there are no more clauses.

Note: I could have left the [harm] check out and it would have functioned in much the same way. However, if you have no target or your target can be neither helped nor harmed, you would receive an error message or, depending on the spell, the target selector cursor.

The macro will now search for the selected target. If the target is [help] than it will use it’s helpful spell. If the target is [harm] than it will use it’s harmful spell. But nothing will happen when you haven’t selected any target. Not even when you have «Selfcast» enabled in the interface options. but with the following macro it will use selfcast when nothing is selected.

#showtooltip
/cast [help] Healing Touch; [harm] Wrath; [@player] Healing Touch

Commands that accept conditions[]

Only the «secure» commands respond to macro conditions. In fact, the secure commands are the reason macro conditions were created in the first place. Insecure commands like chatting, emotes, etc. can be scripted using Lua and the /run command. Furthermore, Blizzard didn’t want to confuse people who use semicolons in their chat messages. If /say could use macro conditions, the following would always just say «Hello»:

/say Hello; I'm a n00b

The following is a list of all the secure commands currently available in WoW:

  • #show *
  • #showtooltip *
  • /assist
  • /cancelaura
  • /cancelform
  • /cast
  • /castrandom
  • /castsequence
  • /changeactionbar
  • /clearfocus
  • /cleartarget
  • /click
  • /dismount
  • /equip +
  • /equipslot +
  • /equipset +
  • /focus
  • /petassist
  • /petattack
  • /petautocastoff
  • /petautocaston
  • /petdefensive
  • /petfollow
  • /petpassive
  • /petstay
  • /startattack
  • /stopattack
  • /stopcasting
  • /stopmacro
  • /swapactionbar
  • /target
  • /targetexact
  • /targetenemy
  • /targetfriend
  • /targetfriendplayer
  • /targetenemyplayer
  • /targetlasttarget
  • /targetlastfriend
  • /targetlastenemy
  • /targetparty
  • /targetraid
  • /use
  • /usetalents +
  • /userandom

* #show and #showtooltip are not technically secure commands, but they operate with macro conditions just like /use and /cast.

+ /equip, /equipslot, /equipset and /usetalents are not technically secure since their functionality is available to addons and macro scripts.

If you would like a way to use macro options for insecure commands, there are addons that provide such capability. My addon, MacroTalk, adds a number of /opt___ commands for each chat command and a generic /opt command that lets you use options to choose other full (insecure) slash commands. I believe the newest SuperMacro provides this functionality as well. Macro Broker provides this as well through a new command, /eval.

Syntax overview[]

There can be an awful lot of confusion around how macro options work, so I will take this early opportunity to break down the general concepts behind them. I will be providing some real-world examples using actual options. Don’t worry too much if you don’t understand what they mean. All options will be covered in detail later on.

General options syntax[]

All slash commands basically work the same way. You have a command, and a set of parameters. The parameters depend on the command, and some commands don’t take any. Here are a few examples:

/cast Smite
\___/ \___/
  |     |
  |  parameters
  |
command


/petattack
\________/ V
    |      |
    |  parameters (empty)
    |
command


/castsequence reset=target Immolate, Corruption, Curse of Agony, Siphon Life
\___________/ \____________________________________________________________/
      |                                    |
   command                            parameters

Macro options allow you to choose a set of parameters based on a number of criteria. At the highest level, you have a set of criteria/parameter groups separated by semicolons. The semicolons can be seen as an «else» or an «else if.» The criteria consist of zero or more sets of conditions. Each condition set is enclosed with square brackets. Here is an illustration of this basic syntax.

/command [conditions] [more conditions] parameters; [conditions] parameters ...

As you saw in the basic examples above, the command is evaluated from left to right. As soon as it finds a set of conditions that are true, it runs the command with the corresponding parameters. If there are no conditions in a clause, it will always be true. In fact, you can imagine a single-spell /cast command as a macro option with one clause that has no conditions. When the command does not have any conditions that are true, it will not execute at all.

Condition syntax[]

Each set of conditions is a simple comma-separated list. They can appear in any order, though [@unit] is always taken into account first, before any of the conditionals. Think of the comma as an «and.» A condition like [help, nodead, @focus] means «My focus is friendly AND not dead.»

Notice: Conditions are case-sensitive. If you use [Help] instead of [help], the macro will generate an error. However, this does not necessarily include the condition’s parameters (described below). Still, it’s usually better to consistently capitalize as things appear. Write spells and items just like you see in their tooltips. Follow the examples in this guide precisely.

Conditions themselves have a few building blocks. First off, as you just saw with «nodead», you can put «no» in front of a condition to mean the opposite. Notice that [nohelp] does not mean the same thing as [harm]. [harm] and [help] both return true only if there is a target to begin with. Furthermore, there are some targets that can neither be helped nor harmed (unflagged players of the other faction, non-combat pets, escort quests, etc.).

Some conditions also take their own sets of parameters. For example, [stance] by itself means «In any stance» (useful for every class with stances except Warriors since they are always in a stance). However, you can also specify one or more particular stances to check. The set of parameters begins with a colon (:) and each parameter is separated with a slash (/) that means «or.» Here’s a generic illustration of the syntax of a single condition where everything inside angle brackets (<>) is optional.

[<no>condition<:parameter</parameter</parameter<...>>>>]

Here’s a simple example that uses Shield Bash in Defensive or Battle Stance, but switches into Defensive Stance if you’re in Berserker:

/cast [stance:1/2] Shield Bash; Defensive Stance

This can be simplified to pseudo-code English as «IF currently in stance 1 OR in stance 2 then use Shield Bash ELSE switch to Defensive Stance.

Note: «no» applies to the whole condition and all of its parameters. This means that [nostance:1/2] would mean «anything but stances 1 or 2»

Complete EBNF syntax[]

For those who are familiar with EBNF notation, the entire macro option syntax can be represented as follows:

command = "/", command-verb, [ {command-object, ";" } command-object] ]
command-verb = ? any secure command word ?
command-object = { condition } parameters
parameters = ? anything which may be passed to the command word ?
condition = "[" condition-phrase { "," condition-phrase } "]"
condition-phrase = ([ "no" ], option-word, [ ":" option-argument { "/" option-argument } ]
                   | "@", target)
option-argument = ? any one-word option, such as 'shift, 'ctrl', 'target', '1', '2' ?
target = ? a target pattern ?

Empty parameters[]

One source of confusion comes in dealing with parameterless commands. A very common error when writing macros is to add an extra semicolon to the end, but this creates some unexpected bugs. Take the following macro:

/petattack [@focus, harm];

To the uninitiated, that looks like it’ll send your pet after your focus if it’s harmful, and do nothing otherwise. However, let’s look at a breakdown of this macro:

/petattack [@focus, harm]  ;
\________/ \____________/ V V V
    |               |     | | |
 command         options  | | parameters (empty)
                          | |
                          | options (empty)
                          |
                          parameters (empty)

See that extra blank set of options and parameters? Remember that a blank set of options always evaluates to true, so that second empty parameter gets passed to /petattack if the first conditions are false.

Empty conditions[]

Sometimes you may want a command to cast on a particular target under certain circumstances but behave like normal if those conditions aren’t true. In this case you will want to use an empty set of conditions which will always evaluate to true. The following macro will cast Flash of Light on the unit under your mouse. If you have no mouseover or it’s hostile, the macro will behave like a plain /cast Flash of Light, casting on your target and respecting self-cast key and auto-self-cast interface option.

/cast [@mouseover, help] [ ] Flash of Light

[target=] or [@] versus unit parameters[]

Some commands accept units directly as their parameters. For example, /target party1 will target your first party member. The command /target [@party1] while a bit more verbose has the equivalent behavior. However, in most cases the designers don’t want us to be able to test conditions on one unit and then act on another, so you must use one or the other. E.g., a macro like the following will not work as expected:

/target [@focus, dead] party1

WoW will ignore party1 because you set a unit with the [@] targeting option. There are some specific exceptions to this rule. A few commands have «key units» that are fundamental to the command. If you use that unit in your [@] option, WoW will allow you to specify another unit or will use the default unit for the command if you don’t specify one. That last bit needs a concrete example:

/focus [@focus, dead] [@focus, noharm] target

In this case, the key unit is focus. Since we are using [@focus], WoW will send «focus» to the /focus command. We could also have left off the «target» at the end since the /focus command defaults to your target. Below is a list of all commands with key units, and their default units if any. To reiterate for clarity, the key unit is a unit you can use in [@] option that will allow you to send another unit to the command. The Default Unit is the unit that will be sent to the command if you don’t provide one.

 Command      | Key Unit  | Default Unit
 ------------- ----------- -------------
 /target      | target    |
 /focus       | focus     | target
 /startattack | target    | target
 /petattack   | pettarget | target

Conditionals[]

Main article: Macro conditionals

Toggleable abilities[]

As of patch 2.3.2, the cast command toggles abilities on and off. From the official patchnotes:

/cast will toggle spells again unless the name is prefixed with an exclamation mark, e.g. /castsequence Steady Shot, !Auto Shot

Examples of such toggleable abilities are Stealth, Shoot or Mass Dispel (the green targeting circle). If you want to spam such a macro without toggling the ability immediately off, prefix its name with an exclamation mark.

/cast !Stealth
/cast !Mass Dispel
/cast !Shoot

Macro option applications[]

Many of the commands introduced in Part I don’t really come into their own until you add macro options to the mix. You’ve seen a few simple examples recently, but there’s still a bit more to cover. The next couple sections will tie up these loose ends and hopefully give you some inspiration to start you on your way.

Using Focus[]

Focus is a unit ID like target, player, or raidpet1target. It allows you to reference a mob, player, or NPC you specify. The simplest usage of focus is with key bindings. There are two focus-related functions in the bindings menu: Focus Target, and Target Focus. Focus Target sets your focus to whatever you are currently targeting (it will clear your focus if you have nothing targeted). Once you have a focus set, you can use it as a unit ID for any other command. Target Focus will, as you might guess, target the entity you have focused. However, these bindings don’t really take full advantage of focus. In order to get the most bang for your buck, you will need to use macros with macro options.

One of the most common uses is to set a crowd control target. A mage can select a mob to sheep and set it as their focus. Now they can change targets for DPS and use the following macro whenever they need to re-sheep.

/cast [@focus] Polymorph

Or maybe a healer could set their focus to the main tank. Using the game’s focus unitframe, they would then have a frame devoted to their main tank that they could easily use for healing.

In addition to the key bindings, there are also the /focus and /clearfocus slash commands. Without any parameters, /focus works exactly like the key binding, setting your current target as your focus. You can also specify any valid unit ID (see Targeting above) or name as a parameter to /focus:

/focus party3target

Here is an example of more advanced focusing:

/focus [@focus, noharm] [@focus, dead] [modifier]
/stopmacro [@focus, noexists]
/cast [@focus] Polymorph

The first line sets your focus to your current target (or clears your focus if you don’t have a target) in one of the following situations:

  • You don’t have a harmful focus (either it’s friendly or doesn’t exist)
  • Your current focus is dead
  • You are holding down a modifier key (in case you want to change your focus after you already have a valid one)

The second line keeps the macro from proceeding if you don’t have a focus. Finally, it casts Polymorph on your focus. This gives you a one-button solution for your crowd control with focus. You may notice that we could have used an exists condition in the /cast command instead of a separate /stopmacro command. However, /stopmacro affords us a bit more flexibility by stoping any other commands we may add to the macro later (like a warning in /p).

It’s possible to swap your target and your focus, giving you in effect two targets you can toggle between:

/cleartarget [@target, dead]
/clearfocus [@focus, dead]
/target focus
/cleartarget [@focus, noexists]
/targetlasttarget
/focus target
/targetlasttarget

The first two lines clear the target and/or focus if they are dead (if you really want to keep track of multiple dead targets, e.g. to resurrect or loot them, then delete those lines). The fourth is needed because /target focus doesn’t clear your target if you have no current focus (without it, the fifth line would then retrieve your previous target).

Macro Branching with /click[]

Say you want a button that chooses between three different spells based on shift, ctrl, or no modifier and two different targets depending on left or right click. This can be done all in one like the following:

/cast [mod:shift, button:2, @player] [mod:shift, @party1] Greater Heal; [mod:ctrl, button:2, @player] [mod:ctrl, @party1] Flash Heal; [nomod, button:2, @player] [nomod, @party1] Renew

That’s quite an unwieldy bit of script there. We can split it onto multiple lines for clarity and remove some redundancies to save room but it’s still a bit of a beast:

/cast [mod:shift, button:1, @party1] [mod:shift, @player] Greater Heal
/cast [mod:ctrl, button:1, @party1] [mod:ctrl, @player] Flash Heal
/cast [button:1, @party1] [@player] Renew 

However, by using one master macro to choose the target based on mouse button and two macros to choose the spells based on modifier key, we can make it much easier to follow. For the sake of these examples, macros 2 and 3 are on MultiBarLeftButton2 and MultiBarLeftButton3, respectively.

Macro 1:

/click [button:1] MultiBarLeftButton2; MultiBarLeftButton3

Macro 2:

/cast [mod:shift, @party1] Greater Heal; [mod:ctrl, @party1] Flash Heal; [@party1] Renew

Macro 3:

/cast [mod:shift, @player] Greater Heal; [mod:ctrl, @player] Flash Heal; [@player] Renew

Custom icons[]

If you would like to use custom icons for your macros, you can place them in your World of Warcraft\Interface\Icons folder (creating this folder if it doesn’t exist). The files must follow the same guidelines for UI textures. Namely, they must be either BLP files or 24-bit/32-bit alpha uncompressed TGA files. Their dimensions must be powers of two up to 512 (e.g. 32×32, 512×128). Note: any images that aren’t square will look squished on your action bar.

Keeping macros on multiple computers[]

As of Patch 3.0.2, macros are now kept ‘server-side’, so there is «…no longer a need to reconfigure them when logging in using another computer.»

External links[]

  • Fitzcairn’s Macro Explain-o-matic

Понравилась статья? Поделить с друзьями:
  • Мануал yamaha yz250f 2009 на русском
  • Мидокалм инъекции инструкция по применению таблетки
  • Руководство царского села
  • Ооо миг ктз руководство
  • Капли полидекса для уха инструкция по применению