-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMikeAddon_Main.lua
290 lines (282 loc) · 11.8 KB
/
MikeAddon_Main.lua
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
--[[
Mike's WoW Addon
Version: 1.0.4
Application Main CLI UI
License:
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program(see LICENSE); if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
]]
local version = "1.0.4"
-- slash command
SLASH_MIKE1, SLASH_MIKE2 = '/mike', '/mi'
-- slash command menu
function SlashCmdList.MIKE(msg, editbox)
local m = mSplit(msg)
if m[1] == "net" then
mNetStats()
elseif m[1] == "mem" then
mMemUsage()
elseif m[1] == "fps" then
mFramerate()
elseif m[1] == "pos" then
mPrintPosition()
elseif m[1] == "window" then
mWindowSwitch()
elseif m[1] == "winmax" then
mWindowMaximizeSwitch()
elseif m[1] == "timer" then
mPrintElapsedTime()
elseif m[1] == "treset" then
mResetTimer()
elseif m[1] == "ireset" then
mPrint("Your instances has been reset")
ResetInstances()
elseif m[1] == "tsave" then
mSaveTarget()
elseif m[1] == "tcustom" then
mSetTarget(mGetSubArgs(m, 2));
elseif m[1] == "trestore" then
mRestoreTarget()
elseif m[1] == "rl" then
mReloadUI()
elseif m[1] == "qshare" then
mShareQuestObjectives()
elseif m[1] == "qss" then
mShareSelectedQuestObjectives()
elseif m[1] == "psell" then
mPoorSell()
elseif m[1] == "pdestroy" then
mPoorDestroy()
elseif m[1] == "strip" then
mGetNaked()
elseif m[1] == "equip" then
mEquipItems(mSplit(mGetSubArgs(m, 2), ", "))
elseif m[1] == "wequip" then
local w = mSplit(mGetSubArgs(m, 2), ", ")
mEquipHandWeapons({w[1], w[2]})
elseif m[1] == "print" then
mPrint(mGetSubArgs(m))
elseif m[1] == "fortitude" then
mMassBuff("Power Word: Fortitude", "Fort")
elseif m[1] == "castsequence" then
if string.find(m[2], "reset") or tonumber(m[2]) then
mCastSequence(m[2], mSplit(mGetSubArgs(m, 3), ", "))
else
mCastSequence("", mSplit(mGetSubArgs(m), ", "))
end
elseif m[1] == "castrandom" then
local spells = mSplit(mGetSubArgs(m), ", ")
mCastRandom(spells)
elseif m[1] == "stance" then
local stances = mSplit(mGetSubArgs(m), ", ")
mStanceSwitch(stances)
elseif m[1] == "stancerandom" then
if m[2] then
mStanceRandom(mSplit(mGetSubArgs(m), ", "))
else
mStanceRandom()
end
elseif m[1] == "heal" then
local sn = mGetSubArgs(m, 3)
mMassHeal(sn, tonumber(m[2]))
elseif m[1] == "lspell" then
local spells = mSplit(mGetSubArgs(m, 3), ", ")
mLifeSpell(tonumber(m[2]), spells[1], spells[2])
elseif m[1] == "bcast" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mCastIfBuffed(x[1], x[2], x[3]);
elseif m[1] == "dcast" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mCastIfDebuffed(x[1], x[2], x[3]);
elseif m[1] == "bccast" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mCastIfBuffCount(x[1], x[2], tonumber(x[3]), x[4], x[5])
elseif m[1] == "dccast" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mCastIfDebuffCount(x[1], x[2], tonumber(x[3]), x[4], x[5])
elseif m[1] == "ccast" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mClassCast(x[1], x[2])
elseif m[1] == "lvlcast" then
local spells = mSplit(mGetSubArgs(m, 3), ", ")
mLevelCast(tonumber(m[2]), spells[1], spells[2])
elseif m[1] == "rcast" then
local spell = mGetSubArgs(m, 3)
mRankCast(tonumber(m[2]), spell)
elseif m[1] == "manacast" then
local spells = mSplit(mGetSubArgs(m, 3), ", ")
mManaCast(tonumber(m[2]), spells[1], spells[2])
elseif m[1] == "mpcast" then
local spells = mSplit(mGetSubArgs(m, 3), ", ")
mManaPercentCast(tonumber(m[2]), spells[1], spells[2])
elseif m[1] == "pcast" then
local n = m[2]
mPartyMemberCast(n, mGetSubArgs(m, 3))
elseif m[1] == "wpain" then
mCastIfDebuffed("Pain", "Shadow Word: Pain", "Shoot")
elseif m[1] == "apain" then
mMassDebuff("Shadow Word: Pain", "Pain")
elseif m[1] == "sunder" then
mMassDebuff("Sunder Armor", "Sunder")
elseif m[1] == "tattack" then
mTargetAttack()
elseif m[1] == "tcast" then
mTargetEnemyCast(mGetSubArgs(m))
elseif m[1] == "ftcast" then
mTargetFriendCast(mGetSubArgs(m))
elseif m[1] == "pbuff" then
if UnitName("target") then
mPrintBuff("target")
else
mPrintBuff("player")
end
elseif m[1] == "pdebuff" then
if UnitName("target") then
mPrintDebuff("target")
else
mPrintDebuff("player")
end
elseif m[1] == "mbuff" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mMassBuff(x[1], x[2])
elseif m[1] == "mdebuff" then
local x = mSplit(mGetSubArgs(m, 2), ", ")
mMassDebuff(x[1], x[2])
elseif m[1] == "auc" then
mIncrementalAuctionSearch()
elseif m[1] == "aucpost" then
mIncrementalAuctionPost()
elseif m[1] == "aucreset" then
mResetSearchIndex()
elseif m[1] == "op" then
if m[2] == "on" then
mEnableOverpower()
elseif m[2] == "off" then
mDisableOverpower()
else
mPrintOverpowerStatus()
end
elseif m[1] == "ad" then
if m[2] == "on" then
mEnableAutoDismount()
elseif m[2] == "off" then
mDisableAutoDismount()
elseif m[2] == "mount" then
mSetPlayerMount(m[3])
else
mPrintAutoDismountStatus()
end
elseif m[1] == "fishing" then
if m[2] == "on" then
mEnableFishing()
elseif m[2] == "off" then
mDisableFishing()
elseif m[2] == "stats" then
mFishStats()
elseif m[2] == "reset" then
mFishReset()
else
mPrintFishingStatus()
end
elseif m[1] == "tw" then
if m[2] == "on" then
mEnableTrackerWarning()
elseif m[2] == "off" then
mDisableTrackerWarning()
else
mPrintTrackerWarningStatus()
end
elseif m[1] == "tstats" then
mPrintUnitStats("target")
else
mPrint("Mike's Addon v" .. version, 1, 1, 0)
mPrint("Usage: /mike <arguments> OR /mi <arguments>")
mPrint("[ ] are for optional (not mandatory) arguments");
mPrint("System informations", 1, 1, 0)
mPrint("/mi net: print net stats")
mPrint("/mi fps: print framerate")
mPrint("/mi mem: print addons memory usage")
mPrint("/mi pos: print player position")
mPrint("/mi tstats: print target stats")
mPrint("Timer function", 1, 1, 0)
mPrint("/mi timer: get elapsed time from ui load or timer reset")
mPrint("/mi treset: reset timer")
mPrint("Target save & restore functions:", 1, 1, 0)
mPrint("/mi tsave: save current target name")
mPrint("/mi trestore: target unit with saved name")
mPrint("/mi tcustom <name>: set custom target to restore");
mPrint("Auction House", 1, 1, 0)
mPrint("/mi auc: search next container item in auction house")
mPrint("/mi aucpost: post next container item in auction house post slot")
mPrint("/mi aucreset: reset current item to bag 0 slot 1")
mPrint("System functions", 1, 1, 0)
mPrint("/mi window: Switch between fullscreen and windowed mode")
mPrint("/mi winmax: Switch maximize window mode on/off")
mPrint("/mi ireset: reset instances")
mPrint("/mi rl: reload user interface")
mPrint("Quest objective party sharing", 1, 1, 0)
mPrint("/mi qshare: share objectives of common quests in party")
mPrint("/mi qss: share objectives for the quest that is selected (highlighted) in the quest log")
mPrint("Poor items management", 1, 1, 0)
mPrint("/mi psell: sell poor quality items")
mPrint("/mi pdestroy: destroy without confirm all poor quality items")
mPrint("Equipping function", 1, 1, 0)
mPrint("/mi equip <item1>[, <item2>, ..., <itemN>]: equips items")
mPrint("/mi wequip <w1>[, <w2>]: equip w1 on main hand and w2 on offhand")
mPrint("/mi strip: put your equip in the inventory")
mPrint("Overpower", 1, 1, 0)
mPrint("/mi op: get overpower script status")
mPrint("/mi op <on/off>: enable/disable overpower script and reload UI")
mPrint("Auto dismount", 1, 1, 0)
mPrint("/mi ad: get autodismount script status")
mPrint("/mi ad <on/off>: enable/disable script and reload UI")
mPrint("/mi ad mount <mountBuff>: set the mountBuff to cancel for dismount")
mPrint("Fishing", 1, 1, 0)
mPrint("/mi fishing: get fishing script status")
mPrint("/mi fishing <on/off>: enable/disable fishing script and reload UI")
mPrint("/mi fishing stats: show fishing stats")
mPrint("/mi fishing reset: reset fishing stats")
mPrint("Tracker warning", 1, 1, 0)
mPrint("/mi tw: get tracker warning script status")
mPrint("/mi tw <on/off>: enable/disable tracker warning script and reload UI")
mPrint("Macro framework", 1, 1, 0)
mPrint("/mi tcast <spell>: target nearest enemy unit and cast a spell")
mPrint("/mi ftcast <spell>: target nearest friendly unit and cast a spell")
mPrint("/mi castsequence [reset=<sec>/combat/target] <s1>, <s2>[, <s3>, ..., <sN>]: cast spell in sequence")
mPrint("/mi castrandom <s1>, <s2>[, <s3>, ..., <sN>]: cast a random spell from the list");
mPrint("/mi stance <s1>, <s2>[, <s3>, ..., <sN>]: cast stance that follow active in the list (or first if last is active or there is no active)")
mPrint("/mi stancerandom [<s1>, ..., <sN>]: switch to a random unactive stance from list o from all the players one if none is provided")
mPrint("/mi heal <percent> <spellname>: cast an healing spell on nearest player with hp% < percent")
mPrint("/mi lspell <percent> <s1>[, <s2>]: cast s1 if target %hp is < percent, else s2")
mPrint("/mi pbuff: print buff icon names (needed for pbuff) of your target (or you)")
mPrint("/mi pdebuff: print debuff icon names (needed for pdebuff) of your target (or you)")
mPrint("/mi mbuff <spell>, <buff_icon_name>: buff nearest unbuffed friendly player")
mPrint("/mi mdebuff <spell>, <buff_icon_name>: debuff nearest unbuffed enemy unit")
mPrint("/mi bcast <buff_icon_name>, <s1>[, <s2>]: cast on target s1 if not buffed, else s2");
mPrint("/mi dcast <debuff_icon_name>, <s1>[, <s2>]: cast on target s1 if not debuffed, else s2");
mPrint("/mi bccast <buff_icon_name>, <op>, <count>, <s1>, [, <s2>]: cast on target s1 if has a value of buff stacks </<=/>/>=/==/!=/ of count, else s2")
mPrint("/mi dccast <debuff_icon_name>, <op>, <count>, <s1>, [, <s2>]: cast on target s1 if has a value of debuff stacks </>/<=/>=/!=/== of count, else s2")
mPrint("/mi ccast <class1>[ <class2> ... <classN>], <spell>: cast <spell> on target if its class match");
mPrint("/mi lvlcast <min_lvl> <s1>[, <s2>]: cast spell if target lvl is major/equal <min_lvl>, else s2");
mPrint("/mi rcast <max_spell_rank> <spell>: check target lvl and cast appropriate rank of the spell");
mPrint("/mi manacast <min_mana> <s1>[, <s2>]: cast s1 if your mana is at least <min_mana>, else s2");
mPrint("/mi mpcast <mana_percent> <s1>[, <s2>]: cast s1 if your mana% is at least <percent>, else s2");
mPrint("/mi pcast <n> <spell>: cast spell party member number n")
mPrint("Premade macro functions", 1, 1, 0)
mPrint("/mi tattack: target nearest enemy (like TAB) and auto-attack")
mPrint("/mi sunder: cast 'Sunder Armor' on nearest enemy not debuffed")
mPrint("/mi fortitude: cast 'Power Word: Fortitude' on nearest unbuffed friendly player")
mPrint("/mi wpain: cast 'Shadow Word: Pain' if not debuffed, else wand 'Shoot'")
mPrint("/mi apain: cast 'Shadow Word: Pain' on nearest enemy not debuffed")
mPrint("Documentation: https://michelesr.github.io/mike-wow-addon/doc/build/html/main.html", 1, 1, 0);
end
end