-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtfresh.lua
More file actions
50 lines (37 loc) · 1.21 KB
/
Copy pathtfresh.lua
File metadata and controls
50 lines (37 loc) · 1.21 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
local FOLDER_NAME,tfresh=...;
if TFreshConfig == nil then
TFreshConfig = {slots = {13, 14, 15, 16}};
end
tfresh.config = tfresh.copy(TFreshConfig);
local sequencePrefix = "/castsequence";
local resetTag = " reset=";
local helpText = [[
(TFresh) Usage: /tfresh condition/s
Short-hand for no condition is 0.
Ex.: /tfresh 0 -> no reset condition.
/tfresh 8/combat -> reset at 8sec or combat end.
]];
SLASH_TFRESH1 = "/tfresh";
SlashCmdList["TFRESH"] = function(paramStr)
paramStr = string.lower(paramStr);
if not paramStr or paramStr:match("^%s*$") then -- no params given, act on defaults
print(helpText);
do return end;
end
local resetStr = tfresh.validateAndGetParams(paramStr);
if resetStr == nil then
do return end;
end
local spellList, tCount = tfresh.getSpells(tfresh.config.slots);
if tCount == 0 then
totemMacro = "";
else
local tStr = " "..(tCount > 1 and table.concat(spellList, ", ") or spellList[1]);
totemMacro = sequencePrefix..(resetStr ~= "" and resetTag..resetStr or "")..tStr;
end
if #totemMacro > 255 then
print("(TFresh) Macro too long.")
do return end;
end
tfresh.saveMacro(totemMacro);
end