Quoted from "neonsun;461373"
i m planning to dyice a auto poting dyice just for my phyrius pots.
anyone know if phyrius pots can be used by name , or do they need to be sloted to actionbas and used from there ( like set skills).
i play using a gaming mouse and i plan to put the auto poter on 1 of the keys .
the idea would be to have only 1 macro for poting on my action bars which will use the appropriate pot depending on the parameters i ahave set up .
ex : if Hp <80% and and MP<20% -->use xx or zzz
if only hp <70% use xxx
Anything special i need to know about this topic before i try coding for it ?
|
|
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 |
function WarriorKnightAtk(arg1,arg2)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player","target"))
local tDead = UnitIsDeadOrGhost("target")
local rage = UnitMana("player")
local mana = UnitSkill("player")
local health = PctH("player")
local thealth = PctH("target")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
if (tDead) then
TargetUnit("")
return
end
i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not pbuffs['Enhanced Armor']) }
i=i+1; Skill[i] = { name = "Blocking Stance", use = (not pbuffs['Blocking Stance']) }
i=i+1; Skill[i] = { name = "Item: Housekeeper Special Unimaginable Salad", use = ((not pbuffs['Unimaginable Salad']) and (GetCountInBagByName("Housekeeper Special Unimaginable Salad") ~= 0)) }
i=i+1; Skill[i] = { name = "Berserk", use = ((not friendly) and (thealth > 0.75) and (rage >=30) and (not pbuffs['Berserk'])) }
i=i+1; Skill[i] = { name = "Survival Instinct", use = (health < 0.50) }
i=i+1; Skill[i] = { name = "Aggressiveness", use = ((not friendly) and (rage <= 20)) }
i=i+1; Skill[i] = { name = "Enraged", use = ((not friendly) and (rage <= 30)) }
--i=i+1; Skill[i] = { name = "Open Flank", use = ((not friendly) and (rage >= 10) and (tbuffs['Vulnerable'])) }
--i=i+1; Skill[i] = { name = "Probing Attack", use = ((not friendly) and (rage >= 20) and (tbuffs[500081])) }
i=i+1; Skill[i] = { name = "Tactical Attack", use = ((not friendly) and (rage >= 15) and (tbuffs[500081])) }
i=i+1; Skill[i] = { name = "Action: 13 (Sword of Imprisonment)", use = ((not friendly) and (rage >= 20) and (tbuffs[500081])) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage >= 25)) }
i=i+1; Skill[i] = { name = "Disarmament", use = ((not friendly))}
MyCombat(Skill,arg1)
end
|

|
|
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 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 |
-- DIYCE Original Author: Sixpax
-- DIYCE: GhostWolf Modified version 1.0
local g_skill = {}
local g_lastaction = ""
function Msg(outstr,a1,a2,a3)
DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end
function ReadSkills()
g_skill = {}
local skillname,slot
Msg("- DIYCE Reading Class Skills")
for page = 1,4 do
slot = 1
skillname = GetSkillDetail(page,slot)
repeat
local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)
if skillusable then
g_skill[skillname] = { ['page'] = page, ['slot'] = slot }
end
slot = slot + 1
skillname = GetSkillDetail(page,slot)
until skillname == nil
end
end
ReadSkills() -- Read skills into g_skill table at login
function PctH(tgt)
return (UnitHealth(tgt)/UnitMaxHealth(tgt))
end
function PctM(tgt)
return (UnitMana(tgt)/UnitMaxMana(tgt))
end
function PctS(tgt)
return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end
function CancelBuff(buffname)
local i = 1
local buff = UnitBuff("player",i)
while buff ~= nil do
if buff == buffname then
CancelPlayerBuff(i)
return true
end
i = i + 1
buff = UnitBuff("player",i)
end
return false
end
function BuffList(tgt)
local list = {}
local buffcmd = UnitBuff
local infocmd = UnitBuffLeftTime
if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
infocmd = UnitDebuffLeftTime
end
-- There is a max of 100 buffs/debuffs per unit apparently
for i = 1,100 do
local buff, _, stackSize = buffcmd(tgt, i)
local timeRemaining = infocmd(tgt,i)
if buff then
list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining }
else
break
end
end
return list
end
function CD(skillname)
local firstskill = GetSkillDetail(2,1)
if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then
ReadSkills()
end
if g_skill[skillname] ~= nil then
local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
return cd <= 0.4
elseif skillname == nil then
return false
else
Msg("Skill not available: "..skillname)
return false
end
end
function MyCombat(Skill, arg1)
local spell_name = UnitCastingTime("player")
local talktome = ((arg1 == "v1") or (arg1 == "v2"))
local action,actioncd,actiondef,actioncnt
if spell_name ~= nil then
if (arg1 == "v2") then Msg("- ['..spell_name..']", 0, 1, 1) end
return true
end
for x,tbl in ipairs(Skill) do
if Skill[x].use then
if string.find(Skill[x].name, "Action:") then
action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3")))
_1,actioncd = GetActionCooldown(action)
actiondef,_1,actioncnt = GetActionInfo(action)
if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then
if talktome then Msg("- "..Skill[x].name) end
UseAction(action)
return true
end
elseif string.find(Skill[x].name, "Custom:") then
action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3")
if CustomAction(action) then
return true
end
elseif string.find(Skill[x].name, "Item:") then
action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
if talktome then Msg("- "..Skill[x].name) end
UseItemByName(action)
return true
elseif CD(Skill[x].name) then
if talktome then Msg("- "..Skill[x].name) end
CastSpellByName(Skill[x].name)
return true
end
end
end
if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end
return false
end
function CustomAction(action)
if CD(action) then
if IsShiftKeyDown() then Msg("- "..action) end
g_lastaction = action
CastSpellByName(action)
return true
else
return false
end
end
|
Quoted from "anan1;462559"
What am I doing wrong?
|
|
Source code |
1 |
Msg("Test")
|
Quoted from "Zaodon;462603"
As the very first line, add this:
If that doesn't print, then your entire code isn't loading at all, which means you need to check your windows Folder name, LUA file name, and TOC file name, and TOC file contents to be sure the LUA is in the TOC file.
![]()
Source code
1Msg("Test")
Quoted from "anan1;462616"
I have tried adding similar code yesterday at the beginning and ending of both the DIYCE/MyFunctions code. I’m pretty sure it is loading. (At least the code is printing 4x. two files, beginning/end. I have no idea if it is running correctly.)
The thing is, it is not cycling through any of my skills.
Quoted from "neonsun;461366"
whats is the actual difference between :
and
![]()
Source code
1i=i+1; Skill[i] = { name = "Savage Whirlwind", use = (not friendly) }
how will it change my code execution.
![]()
Source code
1i=i+1; Skill[i] = { name = "Savage Whirlwind", use = ((not friendly) and CD("Savage Whirlwind"))
i got 0 programming knoweldge, but i thought that for a skill to be used it needed to have cool downed, and that dyice took care of it on its own .
i dont understand whats the gain of adding cd(skill) as a condition to use that same skill
please explain![]()
PS : ty peryl will be making necessary changes and getting back to u in this thread or by pm
i reworked my code |
|
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 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 |
-- DIY Combat Engine version 1.4
g_skill = {}
function Msg(outstr,a1,a2,a3)
DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3)
end
function ReadSkills()
g_skill = {}
local skillname,slot
Msg("- Reading Class Skills")
for page = 1,4 do
slot = 1
skillname = GetSkillDetail(page,slot)
repeat
local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot)
if skillusable then
g_skill[skillname] = { ['page'] = page, ['slot'] = slot }
end
slot = slot + 1
skillname = GetSkillDetail(page,slot)
until skillname == nil
end
end
ReadSkills() -- Read skills into g_skill table at login
function PctH(tgt)
return (UnitHealth(tgt)/UnitMaxHealth(tgt))
end
function PctM(tgt)
return (UnitMana(tgt)/UnitMaxMana(tgt))
end
function PctS(tgt)
return (UnitSkill(tgt)/UnitMaxSkill(tgt))
end
function CancelBuff(buffname)
local i = 1
local buff = UnitBuff("player",i)
while buff ~= nil do
if buff == buffname then
CancelPlayerBuff(i)
return true
end
i = i + 1
buff = UnitBuff("player",i)
end
return false
end
function BuffTimeLeft(tgt, buffname)
local cnt = 1
local buffcmd, bufftimecmd, buff
if UnitCanAttack("player", tgt) then
buffcmd = UnitDebuff
bufftimecmd = UnitDebuffLeftTime
else
buffcmd = UnitBuff
bufftimecmd = UnitBuffLeftTime
end
buff = buffcmd(tgt, cnt)
while buff ~= nil do
if string.find(buff, buffname) then
return bufftimecmd(tgt, cnt)
end
cnt = cnt + 1
buff = buffcmd(tgt, cnt)
end
return 0
end
function BuffList(tgt)
local list = {}
local buffcmd = UnitBuff
local infocmd = UnitBuffLeftTime
if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
infocmd = UnitDebuffLeftTime
end
-- There is a max of 100 buffs/debuffs per unit apparently
for i = 1,100 do
local buff, _, stackSize, ID = buffcmd(tgt, i)
local timeRemaining = infocmd(tgt,i)
if buff then
-- Ad to list by name
list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining, id = ID }
-- We also list by ID in case two different buffs/debuffs have the same name.
list[ID] = {stack = stackSize, time = timeRemaining, name = buff:gsub("(%()(.)(%))", "%2") }
else
break
end
end
return list
end
function CD(skillname)
local firstskill = GetSkillDetail(2,1)
if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then
ReadSkills()
end
if g_skill[skillname] ~= nil then
local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot)
return cd==0
elseif skillname == nil then
return false
else
Msg("Skill not available: "..skillname)
return false
end
end
function MyCombat(Skill, arg1)
local spell_name = UnitCastingTime("player")
local talktome = ((arg1 == "v1") or (arg1 == "v2"))
local action,actioncd,actiondef,actioncnt
if spell_name ~= nil then
if (arg1 == "v2") then Msg("- ['..spell_name..']", 0, 1, 1) end
return true
end
for x,tbl in ipairs(Skill) do
if Skill[x].use then
if string.find(Skill[x].name, "Action:") then
action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3")))
_1,actioncd = GetActionCooldown(action)
actiondef,_1,actioncnt = GetActionInfo(action)
if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then
if talktome then Msg("- "..Skill[x].name) end
UseAction(action)
return true
end
elseif string.find(Skill[x].name, "Custom:") then
action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3")
if CustomAction(action) then
return true
end
elseif string.find(Skill[x].name, "Item:") then
action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3")
if talktome then Msg("- "..Skill[x].name) end
UseItemByName(action)
return true
elseif CD(Skill[x].name) then
if talktome then Msg("- "..Skill[x].name) end
CastSpellByName(Skill[x].name)
return true
end
end
end
if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end
return false
end
|
|
|
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 |
function Wcomb(arg1)
local Skill = {}
local i = 0
--vital signs
local plife = PctH("player")
local power = UnitMana("player")
local pMana = PctS("player")
local pbuff = BuffList("player")
--mob status
local friendly = (not UnitCanAttack("player","target"))
local boss = (UnitSex("target")>2)
local tbuff = BuffList("target")
--Health monitor
i=i+1; Skill[i] = { name = "Survival Instinct", use = ((plife <= .40) and (boss)) }
--Rage monitor
--Buffs
i=i+1; Skill[i] = { name = "Battle Creed", use = [B](not pbuff['Battle Creed'])[/B] }
i=i+1; Skill[i] = { name = "Briar Shield", use = [B](not pbuff['Briar Shield'][/B]) }
--combat
i=i+1; Skill[i] = { name = "Savage Whirlwind", use = (not friendly) }
i=i+1; Skill[i] = { name = "Tactical Attack", use = (tbuff[500081] and (power >= 16)) }
i=i+1; Skill[i] = { name = "Attack Weakener", use = ((not friendly) and tbuff['Vulnerable']) }
i=i+1; Skill[i] = { name = "Open Flank", use = ((not friendly) and tbuff['Vulnerable'] and (power >=11)) }
i=i+1; Skill[i] = { name = "Probing Attack", use = ((not friendly) and (power >= 21) and tbuff[500081]) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (power >= 27)) }
i=i+1; Skill[i] = { name = "Enraged", use = ((power < 25) and (boss)) }
i=i+1; Skill[i] = { name = "Power of the Wood Spirit", use = (not friendly) }
MyCombat(Skill,arg1)
end
|
Quoted from "neonsun;462728"
correct me if i m wrong hangman but ntbuffs automates drinking the pot ,right ?
i want to automate pot choice only
Quoted from "neonsun;462740"
following peryl 's advicei reworked my code
this is my dyice now :
my new code :
![]()
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 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-- DIY Combat Engine version 1.4 g_skill = {} function Msg(outstr,a1,a2,a3) DEFAULT_CHAT_FRAME:AddMessage(tostring(outstr),a1,a2,a3) end function ReadSkills() g_skill = {} local skillname,slot Msg("- Reading Class Skills") for page = 1,4 do slot = 1 skillname = GetSkillDetail(page,slot) repeat local a1,a2,a3,a4,a5,a6,a7,a8,skillusable = GetSkillDetail(page,slot) if skillusable then g_skill[skillname] = { ['page'] = page, ['slot'] = slot } end slot = slot + 1 skillname = GetSkillDetail(page,slot) until skillname == nil end end ReadSkills() -- Read skills into g_skill table at login function PctH(tgt) return (UnitHealth(tgt)/UnitMaxHealth(tgt)) end function PctM(tgt) return (UnitMana(tgt)/UnitMaxMana(tgt)) end function PctS(tgt) return (UnitSkill(tgt)/UnitMaxSkill(tgt)) end function CancelBuff(buffname) local i = 1 local buff = UnitBuff("player",i) while buff ~= nil do if buff == buffname then CancelPlayerBuff(i) return true end i = i + 1 buff = UnitBuff("player",i) end return false end function BuffTimeLeft(tgt, buffname) local cnt = 1 local buffcmd, bufftimecmd, buff if UnitCanAttack("player", tgt) then buffcmd = UnitDebuff bufftimecmd = UnitDebuffLeftTime else buffcmd = UnitBuff bufftimecmd = UnitBuffLeftTime end buff = buffcmd(tgt, cnt) while buff ~= nil do if string.find(buff, buffname) then return bufftimecmd(tgt, cnt) end cnt = cnt + 1 buff = buffcmd(tgt, cnt) end return 0 end function BuffList(tgt) local list = {} local buffcmd = UnitBuff local infocmd = UnitBuffLeftTime if UnitCanAttack("player",tgt) then buffcmd = UnitDebuff infocmd = UnitDebuffLeftTime end -- There is a max of 100 buffs/debuffs per unit apparently for i = 1,100 do local buff, _, stackSize, ID = buffcmd(tgt, i) local timeRemaining = infocmd(tgt,i) if buff then -- Ad to list by name list[buff:gsub('(%()(.)(%))', '%2')] = { stack = stackSize, time = timeRemaining, id = ID } -- We also list by ID in case two different buffs/debuffs have the same name. list[ID] = {stack = stackSize, time = timeRemaining, name = buff:gsub("(%()(.)(%))", "%2") } else break end end return list end function CD(skillname) local firstskill = GetSkillDetail(2,1) if (g_skill[firstskill] == nil) or (g_skill[firstskill].page ~= 2) then ReadSkills() end if g_skill[skillname] ~= nil then local tt,cd = GetSkillCooldown(g_skill[skillname].page,g_skill[skillname].slot) return cd==0 elseif skillname == nil then return false else Msg("Skill not available: "..skillname) return false end end function MyCombat(Skill, arg1) local spell_name = UnitCastingTime("player") local talktome = ((arg1 == "v1") or (arg1 == "v2")) local action,actioncd,actiondef,actioncnt if spell_name ~= nil then if (arg1 == "v2") then Msg("- ['..spell_name..']", 0, 1, 1) end return true end for x,tbl in ipairs(Skill) do if Skill[x].use then if string.find(Skill[x].name, "Action:") then action = tonumber((string.gsub(Skill[x].name, "(Action:)( *)(%d+)(.*)", "%3"))) _1,actioncd = GetActionCooldown(action) actiondef,_1,actioncnt = GetActionInfo(action) if GetActionUsable(action) and (actioncd == 0) and (actiondef ~= nil) and (actioncnt > 0) then if talktome then Msg("- "..Skill[x].name) end UseAction(action) return true end elseif string.find(Skill[x].name, "Custom:") then action = string.gsub(Skill[x].name, "(Custom:)( *)(.*)", "%3") if CustomAction(action) then return true end elseif string.find(Skill[x].name, "Item:") then action = string.gsub(Skill[x].name, "(Item:)( *)(.*)", "%3") if talktome then Msg("- "..Skill[x].name) end UseItemByName(action) return true elseif CD(Skill[x].name) then if talktome then Msg("- "..Skill[x].name) end CastSpellByName(Skill[x].name) return true end end end if (arg1 == "v2") then Msg("- [IDLE]", 0, 1, 1) end return false end
Problem now is nothing happens ! , no error messages nothing.
![]()
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 43function Wcomb(arg1) local Skill = {} local i = 0 --vital signs local plife = PctH("player") local power = UnitMana("player") local pMana = PctS("player") local pbuff = BuffList("player") --mob status local friendly = (not UnitCanAttack("player","target")) local boss = (UnitSex("target")>2) local tbuff = BuffList("target") --Health monitor i=i+1; Skill[i] = { name = "Survival Instinct", use = ((plife <= .40) and (boss)) } --Rage monitor --Buffs i=i+1; Skill[i] = { name = "Battle Creed", use = [B](not pbuff['Battle Creed'])[/B] } i=i+1; Skill[i] = { name = "Briar Shield", use = [B](not pbuff['Briar Shield'][/B]) } --combat i=i+1; Skill[i] = { name = "Savage Whirlwind", use = (not friendly) } i=i+1; Skill[i] = { name = "Tactical Attack", use = (tbuff[500081] and (power >= 16)) } i=i+1; Skill[i] = { name = "Attack Weakener", use = ((not friendly) and tbuff['Vulnerable']) } i=i+1; Skill[i] = { name = "Open Flank", use = ((not friendly) and tbuff['Vulnerable'] and (power >=11)) } i=i+1; Skill[i] = { name = "Probing Attack", use = ((not friendly) and (power >= 21) and tbuff[500081]) } i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (power >= 27)) } i=i+1; Skill[i] = { name = "Enraged", use = ((power < 25) and (boss)) } i=i+1; Skill[i] = { name = "Power of the Wood Spirit", use = (not friendly) } MyCombat(Skill,arg1) end
i usually check if my code is working by trying to self buff with briar shield ... at this point nothing works
any info would be most welcomed , what is this noob doing wrong ?
to note my old dyice and my function are working , dyice.toc file has the correct files it in , i took out the files edited them in another folder , and just exchanged the new codes for the old coded files.
>>>> EDIT : after a good night sleep and a 2nd look at the code , i found the mistake myself . correction is in bold in my dyice function.
Quoted from "almut;463023"
How do I use Spanish words pronounced in the code?
I just do not accept the names of the attacks that have some emphasis on the name.
Sorry, Google Translator. :p:p:p
Thanks
|
|
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 44 45 |
function RogueScout(arg1)
local Skill = {}
local i = 0
--Player Status
local energy = UnitMana("player")
local mana = UnitSkill("player")
local focus = UnitSkill("player")
local phealth = PctH("player")
local pbuffs = BuffList("player")
local combat = GetPlayerCombatState()
local behind = (not UnitIsUnit("player", "targettarget"))
local premed = (pbuffs == string.find(pbuffs, "Premeditation"))
local melee = GetActionUsable(10)
--Target Status
local friendly = (not UnitCanAttack("player", "target"))
local tspell,ttime,telapsed = UnitCastingTime("target")
local tbuffs = BuffList("target")
local boss = ((UnitSex("target"))>=2)
--Buffs & Potions
i=i+1; Skill[i] = { name = "Action: 41", use = (phealth < .03 and (boss)) } -- Swap Macro
i=i+1; Skill[i] = { name = "Action: 42", use = (phealth < .25 and (boss)) } -- Phirius Potion
i=i+1; Skill[i] = { name = "Action: 45", use = (energy < 15 and (boss)) } -- Energy Potion
i=i+1; Skill[i] = { name = "Combat Master", use = ((not combat and not string.find(pbuffs, "Combat Master"))) }
i=i+1; Skill[i] = { name = "Action: 62", use = ((not combat and not string.find(pbuffs, "Yawaka's Blessing"))) }
i=i+1; Skill[i] = { name = "Poison", use = ((not combat and not string.find(pbuffs, "Poisonous"))) }
i=i+1; Skill[i] = { name = "Action: 69", use = ((not combat and not string.find(pbuffs, "Unbridled Enthusiasm"))) } -- Speed Potion
if(melee) then --At Melee
i=i+1; Skill[i] = { name = "Wound Attack", use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Bleed") and string.find(tbuffs, "Grievous Wound")) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((not friendly) and (energy >= 25) and string.find(tbuffs, "Bleed") and not string.find(tbuffs, "Grievous Wound")) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and (energy >= 20) and not string.find(tbuffs, "Bleed")) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and (string.find(pbuffs, "Energy Thief") or (premed)) and (behind)) }
i=i+1; Skill[i] = { name = "Wrist Attack", use = ((not friendly) and (boss) and (focus >=50)) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and not string.find(tbuffs, "Vampire Arrows")) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
else -- At Ranged
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and not string.find(tbuffs, "Vampire Arrows")) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
end
MyCombat(Skill,arg1)
end
|
Quoted from "mrmisterwaa;465608"
Any potential fixes/suggestions/improvements/optimisations would be greatly appreciated.
I wanted to add throat attack to work so it would cancel only specific skills.
I do Shadow Prison on many different conditions, I do not want to leave it up to the macro. Unless I could integrate how long it was since my last energy increase in combat, I doubt I will add shadow prison to my DIYCE macro.
The if else isn't working properly, so any help on fixing it so it can detect rangedvsmelee.
Also, would it be possible to add a potion cd check?
And Thank you!
![]()
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 44 45function RogueScout(arg1) local Skill = {} local i = 0 --Player Status local energy = UnitMana("player") local mana = UnitSkill("player") local focus = UnitSkill("player") local phealth = PctH("player") local pbuffs = BuffList("player") local combat = GetPlayerCombatState() local behind = (not UnitIsUnit("player", "targettarget")) local premed = (pbuffs == string.find(pbuffs, "Premeditation")) local melee = GetActionUsable(10) --Target Status local friendly = (not UnitCanAttack("player", "target")) local tspell,ttime,telapsed = UnitCastingTime("target") local tbuffs = BuffList("target") local boss = ((UnitSex("target"))>=2) --Buffs & Potions i=i+1; Skill[i] = { name = "Action: 41", use = (phealth < .03 and (boss)) } -- Swap Macro i=i+1; Skill[i] = { name = "Action: 42", use = (phealth < .25 and (boss)) } -- Phirius Potion i=i+1; Skill[i] = { name = "Action: 45", use = (energy < 15 and (boss)) } -- Energy Potion i=i+1; Skill[i] = { name = "Combat Master", use = ((not combat and not string.find(pbuffs, "Combat Master"))) } i=i+1; Skill[i] = { name = "Action: 62", use = ((not combat and not string.find(pbuffs, "Yawaka's Blessing"))) } i=i+1; Skill[i] = { name = "Poison", use = ((not combat and not string.find(pbuffs, "Poisonous"))) } i=i+1; Skill[i] = { name = "Action: 69", use = ((not combat and not string.find(pbuffs, "Unbridled Enthusiasm"))) } -- Speed Potion if(melee) then --At Melee i=i+1; Skill[i] = { name = "Wound Attack", use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Bleed") and string.find(tbuffs, "Grievous Wound")) } i=i+1; Skill[i] = { name = "Low Blow", use = ((not friendly) and (energy >= 25) and string.find(tbuffs, "Bleed") and not string.find(tbuffs, "Grievous Wound")) } i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and (energy >= 20) and not string.find(tbuffs, "Bleed")) } i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and (string.find(pbuffs, "Energy Thief") or (premed)) and (behind)) } i=i+1; Skill[i] = { name = "Wrist Attack", use = ((not friendly) and (boss) and (focus >=50)) } i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and not string.find(tbuffs, "Vampire Arrows")) } i=i+1; Skill[i] = { name = "Shot", use = (not friendly) } else -- At Ranged i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and not string.find(tbuffs, "Vampire Arrows")) } i=i+1; Skill[i] = { name = "Shot", use = (not friendly) } end MyCombat(Skill,arg1) end
Quoted from "Sixpax;237562"
Definitely. What I would suggest if you want to specify which spells to interrupt is defining a list of them as a string (using a delimiter like "/") and then checking the spell being cast against that.
So in your class function you'd have:
![]()
Source code
1 2 3 4local interrupt_list = "/Fireball/Thunderstorm/Spell of Doom/" local tspell,ttime,telapsed = UnitCastingTime("target") i=i+1; Skill[i] = { ['name'] = "Throat Attack", ['use'] = ((not friendly) and string.find(interrupt_list,tspell)) }
Quoted from "Deltaninethc;465847"
I found this in this very same thread:
Quoted from "mrmisterwaa;465924"
It's kind of difficult to search this entire thread, I put throat into search in thread and I look at the first page and couldn't find anything.
I saw someone post something about potion cooldowns on the EU server but it wasn't close to complete. :\