There's two ways you can accomplish what you are trying to do with two commands in one macro keypress. The first method is to chain them together with a /wait command in between, which will make them both execute every time you press the key.
|
Source code
|
1
2
3
|
/cast Soul Poisoned Fang
/wait 0.8
/cast Perception Extraction
|
The second method is to create a custom add-on with some additional functions that will help automate the logic flow when trying to conditionally use certain skills or spells. This takes a little more work initially, but makes your macro usage later a lot easier to manage. We'll start by creating a directory and two text files that will contain these additional functions.
Create the following directories in the Runes of Magic folder: /Interface/Addons/MyFunctions/
In this directory you will create two text files; MyFunctions.toc and MyFunctions.lua
MyFunctions.toc
|
Source code
|
1
2
3
|
# My functions to help with macro usage.
#
MyFunctions.lua
|
MyFunctions.lua
|
Source code
|
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
|
-- Base functions used to help with macro usage.
function ChkDebuff(tgt,buffname)
local counter=1
local currentbuff="none"
while currentbuff ~= nil do
currentbuff=UnitDebuff(tgt,counter)
if currentbuff == buffname then
return true
else
counter=counter+1
end
end
return false
end
function SkillUsable(SkillName)
x = 1
while(x <= 5)do
totalCount = GetNumSkill(x)
if(totalCount)then
y = 1
while(y <= totalCount) do
local name, _1, icon, _2, rank, _3, tp_to_upgrade, energy_type, usable = GetSkillDetail(x,y)
if string.lower(name) == string.lower(SkillName) and usable == true then
totalCD, remainingCD = GetSkillCooldown(x, y)
if(remainingCD <= 1)then
return true
end
end
y = y + 1
end
end
x = x + 1
end
return false
end
-- This one just shortens the command name to save space in the in-game macro editor.
function CSBN(skill)
CastSpellByName(skill)
end
|
And then in the in-game macro editor you can use the following. This will check first to see if the target has the Soul Poisoned Fang debuff and cast Perception Extraction if it does, and cast Soul Poisoned Fang if it does not.
Macro:
|
Source code
|
1
2
|
/script if ChkDebuff("target","Soul Poisoned Fang") and SkillUsable("Perception Extraction") then CSBN("Perception Extraction");
/script if not ChkDebuff("target","Soul Poisoned Fang") and SkillUsable("Soul Poisoned Fang") then CSBN("Soul Poisoned Fang");
|