-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMacros.lua
More file actions
executable file
·210 lines (201 loc) · 4.22 KB
/
Macros.lua
File metadata and controls
executable file
·210 lines (201 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
--[[--------------------------------------------------------------------
PhanxUI
Hardcoded personal UI setup.
Copyright 2007-2018 Phanx <addons@phanx.net>
All rights reserved. Permission is granted to reuse code from
this addon in other projects, as long as my name is not used.
----------------------------------------------------------------------]]
local macros = {
ALL = {
Hearth = [[
#showtooltip
/use Hearthstone
]],
Pet = [[
/petattack [nomod]
/petfollow [mod:shift]
/petmoveto [mod:ctrl]
]],
SilverDragon = [[
/cleartarget
/click SilverDragonMacroButton
/stopmacro [noexists] [dead]
/run PlaySound("FriendJoinGame") UIErrorsFrame:AddMessage("Found " .. UnitName("target"))
]],
},
DRUID = {
Bear = [[
#showtooltip Bear Form
/dismount
/cancelform
/cast Bear Form
]],
Cat = [[
#showtooltip Cat Form
/dismount
/cancelform
/cast Cat Form
]],
Cure = [[
#showtooltip
/stopmacro [form]
/cast [harm] Soothe; [dead, combat] Rebirth; [dead] [mod:shift] Revive; [help,nomod:alt,nobtn:2] [@player] Remove Corruption
]],
Fin1 = [[
#showtooltip
/cast [mod] [btn:2] Ferocious Bite; Rip
]],
Fin2 = [[
#showtooltip
/cast [mod] [btn:2] Maim; Savage Roar
]],
Finish = [[
#showtooltip
/cast [mod:alt] [btn:3] Savage Roar; [mod:ctrl] Maim; [mod:shift] [btn:2] Ferocious Bite; Rip
]],
Flight = [[
#showtooltip Flight Form
/stopmacro [combat]
/dismount
/cancelform
/cast Flight Form
]],
Heal = [[
#showtooltip
/cast [help,nomod:alt] [@player] Healing Touch
]],
Power = [[
#showtooltip
/cast [form:1] Enrage; [form:2] Tiger's Fury
]],
Q = [[
#showtooltip
/cast [form:1] Growl; [form:2] Prowl
]],
Swipe = [[
#showtooltip
/stopmacro [noform:1/2]
/cast [mod:alt] [btn:2] Thrash; Swipe
]],
Travel = [[
#showtooltip Travel Form
/stopmacro [indoors]
/dismount
/cancelform
/cast Travel Form
]],
},
SHAMAN = {
Cure = [[
#showtooltip
/cast [mod:alt, @player] [btn:2, @player] Cleanse Spirit; [harm] Purge; [dead] [mod:shift] Ancestral Spirit; Cleanse Spirit
]],
Hex = [[
#showtooltip Hex
/stopmacro [@focus, help] [help]
/clearfocus [mod:alt]
/focus [@focus, noexists]
/cast [@focus, exists] [@target, exists] Hex
]],
Home = [[
#showtooltip
/castsequence [nocombat] reset=900 Astral Recall, Hearthstone
/cast [combat] Hearthstone
]],
Interrupt = [[
#showtooltip
/stopmacro [noharm]
/stopcasting
/cast Wind Shear
]],
},
SHAMAN_2 = {
["1"] = [[
#showtooltip
/cast [mod:shift] Frostbrand; Flametongue
]],
["2"] = [[
#showtooltip
/cast [mod:shift] Lightning Bolt; Rockbiter
]],
["3"] = [[
#showtooltip
/cast [mod:shift] Crash Lightning; Lava Lash
]],
["4"] = [[
#showtooltip
/cast [mod:shift, mod:alt, @player] [mod:shift, btn:2, @player] [mod:shift] Healing Surge; Stormstrike
]],
},
WARLOCK = {
Demon = [[
#showtooltip
/cast [pet:Imp,@player] [] Command Demon
]],
Health = [[
#showtooltip
/cast [mod] Create Healthstone
/use [nomod] Healthstone
]],
Sac = [[
#showtooltip
/cast Sacrificial Pact
/run PetDismiss()
]],
Teleport = [[
#showtooltip
/cast [mod:shift] Demonic Circle: Summon
/stopmacro [mod:shift]
/stopcasting
/cast Demonic Circle: Teleport
]],
},
WARLOCK_KANRETHAD = {
Breath = [[
#showtooltip
/cast [@player] Fel Flame Breath
]],
Charge = [[
#showtooltip
/target Kanrethad
/petattack
/cast Charge
]],
Doom = [[
#showtooltip
/target Doom Lord
/cast Banish
]],
Heal = [[
#showtooltip
/cast Demonic Siphon
]],
},
}
local f = CreateFrame("Frame")
local function LoadMacros(macros, global)
if type(macros) ~= "table" then
return
end
for name, body in pairs(macros) do
local index = GetMacroIndexByName(name) or 0
if index == 0 then
print("Restoring macro:", name)
CreateMacro(name, "INV_MISC_QuestionMark", body, not global)
end
end
end
function f.LoadMacros()
if InCombatLockdown() then
return f:RegisterEvent("PLAYER_REGEN_ENABLED")
end
LoadMacros(macros.ALL, true)
local _, class = UnitClass("player")
LoadMacros(macros[class])
local spec = GetSpecialization() or 0
LoadMacros(macros[class .. "_" .. spec])
end
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent", function(f, event, ...)
f.LoadMacros()
end)