-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathConsole.lua
More file actions
113 lines (82 loc) · 2.94 KB
/
Console.lua
File metadata and controls
113 lines (82 loc) · 2.94 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
--[[
Author: Dennis Werner Garske (DWG) / brian / Mewtiny
License: MIT License
]]
local _G = _G or getfenv(0)
local CleveRoids = _G.CleveRoids or {}
SLASH_PETATTACK1 = "/petattack"
SlashCmdList.PETATTACK = function(msg) CleveRoids.DoPetAttack(msg); end
SLASH_RELOAD1 = "/rl"
SlashCmdList.RELOAD = function() ReloadUI(); end
SLASH_USE1 = "/use"
SlashCmdList.USE = CleveRoids.DoUse
SLASH_EQUIP1 = "/equip"
SlashCmdList.EQUIP = CleveRoids.DoUse
-- take back supermacro and pfUI /equip
SlashCmdList.SMEQUIP = CleveRoids.DoUse
SlashCmdList.PFEQUIP = CleveRoids.DoUse
SLASH_EQUIPMH1 = "/equipmh"
SlashCmdList.EQUIPMH = CleveRoids.DoEquipMainhand
SLASH_EQUIPOH1 = "/equipoh"
SlashCmdList.EQUIPOH = CleveRoids.DoEquipOffhand
SLASH_UNSHIFT1 = "/unshift"
SlashCmdList.UNSHIFT = CleveRoids.DoUnshift
-- TODO make this conditional too
SLASH_CANCELAURA1 = "/cancelaura"
SLASH_CANCELAURA2 = "/unbuff"
SlashCmdList.CANCELAURA = CleveRoids.CancelAura
SLASH_STARTATTACK1 = "/startattack"
SlashCmdList.STARTATTACK = function(msg)
if not UnitExists("target") or UnitIsDead("target") then TargetNearestEnemy() end
if not CleveRoids.CurrentSpell.autoAttack and not CleveRoids.CurrentSpell.autoAttackLock and UnitExists("target") and UnitCanAttack("player","target") then
CleveRoids.CurrentSpell.autoAttackLock = true
-- time a reset in case an attack could not be started.
-- handled in CleveRoids.OnUpdate()
CleveRoids.autoAttackLockElapsed = GetTime()
AttackTarget()
end
end
SLASH_STOPATTACK1 = "/stopattack"
SlashCmdList.STOPATTACK = function(msg)
if CleveRoids.CurrentSpell.autoAttack and UnitExists("target") then
AttackTarget()
CleveRoids.CurrentSpell.autoAttack = false
end
end
SLASH_STOPCASTING1 = "/stopcasting"
SlashCmdList.STOPCASTING = SpellStopCasting
CleveRoids.Hooks.CAST_SlashCmd = SlashCmdList.CAST
CleveRoids.CAST_SlashCmd = function(msg)
-- get in there first, i.e do a PreHook
if CleveRoids.DoCast(msg) then
return
end
-- if there was nothing for us to handle pass it to the original
CleveRoids.Hooks.CAST_SlashCmd(msg)
end
SlashCmdList.CAST = CleveRoids.CAST_SlashCmd
CleveRoids.Hooks.TARGET_SlashCmd = SlashCmdList.TARGET
CleveRoids.TARGET_SlashCmd = function(msg)
msg = CleveRoids.Trim(msg)
if CleveRoids.DoTarget(msg) then
return
end
CleveRoids.Hooks.TARGET_SlashCmd(msg)
end
SlashCmdList.TARGET = CleveRoids.TARGET_SlashCmd
SLASH_CASTSEQUENCE1 = "/castsequence"
SlashCmdList.CASTSEQUENCE = function(msg)
msg = CleveRoids.Trim(msg)
local sequence = CleveRoids.GetSequence(msg)
if not sequence then return end
if not sequence.active then return end
CleveRoids.DoCastSequence(sequence)
end
SLASH_RUNMACRO1 = "/runmacro"
SlashCmdList.RUNMACRO = function(msg)
return CleveRoids.ExecuteMacroByName(CleveRoids.Trim(msg))
end
SLASH_RETARGET1 = "/retarget"
SlashCmdList.RETARGET = function(msg)
CleveRoids.DoRetarget()
end