forked from bhhandley/CleveRoidMacros
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConsole.lua
More file actions
139 lines (96 loc) · 3.71 KB
/
Console.lua
File metadata and controls
139 lines (96 loc) · 3.71 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
--[[
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_FEEDPET1 = "/feedpet"
SlashCmdList.FEEDPET = function(msg) CleveRoids.FeedPet(msg); end
SLASH_PETPASSIVE1 = "/petpassive"
SlashCmdList.PETPASSIVE = function(msg) CleveRoids.DoSimpleAction(PetPassiveMode, msg); end
SLASH_PETDEFENSIVE1 = "/petdefensive"
SlashCmdList.PETDEFENSIVE = function(msg) CleveRoids.DoSimpleAction(PetDefensiveMode, msg); end
SLASH_PETAGGRESSIVE1 = "/petaggressive"
SlashCmdList.PETAGGRESSIVE = function(msg) CleveRoids.DoSimpleAction(PetAggressiveMode, msg); end
SLASH_PETFOLLOW1 = "/petfollow"
SlashCmdList.PETFOLLOW = function(msg) CleveRoids.DoSimpleAction(PetFollow, msg); end
SLASH_PETWAIT1 = "/petwait"
SlashCmdList.PETWAIT = function(msg) CleveRoids.DoSimpleAction(PetWait, 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)
tmsg = CleveRoids.Trim(msg)
if CleveRoids.DoTarget(tmsg) then
if UnitExists("target") then
return
end
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