Quoted from "lesso;330812"
for the stop blood arrow declaration do i simply define the variable as followsor do i have to declare it differently this is the whole script
![]()
Source code
1 local Stop = CancelBuff()
|
|
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 |
function CustomAction(action)
if (action == "Stop Blood Arrow") then
local i = 1
local buff = UnitBuff("player", 1)
while (buff ~= nil) do
if (buff == "Blood Arrow") then
CancelPlayerBuff(i)
return false
else
i = i + 1
buff = UnitBuff("player", i)
end
end
elseif CD(action) then
FocusUnit(12, "target")
TargetUnit("player")
CastSpellByName(action)
TargetUnit("focus12")
FocusUnit(12, "")
return true
end
return false
end
|
Quoted from "spamely;332451"
however. when i comes down to holy light domain i have not been able to add it to a macro as it does not produce a buff to get a timer from and does not have a cooldown.
Quoted from "blurterblurter;332504"
I am trying to use
UnitMaxHealth("target") > 50000
and it doesnt seem to be working. Anyone else had luck with this function?
OK I see whats happening, its giving me percentile just like UnitHealth("target") does, is there a way to get the actual max Hit Points?
Looked through Ikarus code, seems they refer to a db...
Quoted from "blurterblurter;333204"
ah ok, thats the db then that pbinfo and ikarus use, I was using UnitSex("target") but theres a lot of elites in game I kill that dont require same treatmnt so would rather use UnitMaxHealth("target").
|
|
Source code |
1 |
UnitSex("target") >= 2
|
|
|
Source code |
1 |
UnitSex("target") > 2
|
|
|
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 |
function CustomAction(action)
if (action == "Stop Blood Arrow") then
local i = 1
local buff = UnitBuff("player", 1)
while (buff ~= nil) do
if (buff == "Blood Arrow") then
CancelPlayerBuff(i)
return false
else
i = i + 1
buff = UnitBuff("player", i)
end
end
elseif CD(action) then
FocusUnit(12, "target")
TargetUnit("player")
CastSpellByName(action)
TargetUnit("focus12")
FocusUnit(12, "")
return true
end
return false
end
function ScoutMage(arg1)
local Skill = {}
local i = 0
local focus = UnitSkill("player")
local mana = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local thealth = PctH("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(4) -- # is your Autoshot action bar slot number
-- Ammo Check
if (ammo == false) then
local HaveAmmo = false
local arrows = ""
for i=1,360 do
local x,y,name = GetBagItemInfo(i)
if (string.find(name," Arrow")) then
HaveAmmo = true
arrows = name
end
end
if (HaveAmmo == true) then
i=i+1; Skill[i] = { name = "Item: "..arrows, use = (not ammo) } --Equip arrows if have
elseif ((g_cnt%100) == 0) then
SendChatMessage("Make some arrows!","SAY") -- Right click rune bow
end
g_cnt = g_cnt + 1
end
-- Buffs
i=i+1; Skill[i] = { name = "Frost Arrow", use = ((not combat) and (not string.find(pbuffs,"Frost Arrow"))) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((combat) and (not string.find(pbuffs,"Blood Arrow"))) }
i=i+1; Skill[i] = { name = "Custom: Stop Blood Arrow", use = (((not combat) or (phealth <= .55)) and (string.find(pbuffs,"Blood Arrow"))) }
-- Combat
i=i+1; Skill[i] = { name = "Action: 29", use = (phealth < .75) } -- use healing pot
i=i+1; Skill[i] = { name = "Action: 30", use = (mana < .75) } -- use mana pot
i=i+1; Skill[i] = { name = "Snipe", use = ((not friendly) and (thealth == 1)) } -- use only if mob at 100%
i=i+1; Skill[i] = { name = "Lightning", use = ((not friendly) and (not string.find(tbuffs,"Lightning"))) }
i=i+1; Skill[i] = { name = "Autoshot", use = ((not friendly) and (not ASon)) }
i=i+1; Skill[i] = { name = "Fireball", use = (not friendly) }
i=i+1; Skill[i] = { name = "Combo Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Piercing Arrow", use = (not friendly) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = ((not friendly) and (focus >= 15)) }
MyCombat(Skill,arg1)
end
end
|
|
|
Source code |
1 2 3 |
DIYCE.lua custom.lua ScoutMage.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 |
function CustomAction(action)
if (action == "Stop Blood Arrow") then
local i = 1
local buff = UnitBuff("player", 1)
while (buff ~= nil) do
if (buff == "Blood Arrow") then
CancelPlayerBuff(i)
return false
else
i = i + 1
buff = UnitBuff("player", i)
end
end
elseif CD(action) then
if IsShiftKeyDown() then Msg("- "..action) end
g_lastaction = action
FocusUnit(12, "target")
TargetUnit("player")
CastSpellByName(action)
TargetUnit("focus12")
FocusUnit(12, "")
return true
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 44 45 46 47 48 49 50 |
function ScoutMage(arg1)
local Skill = {}
local i = 0
local focus = UnitSkill("player")
local mana = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local thealth = PctH("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(4) -- # is your Autoshot action bar slot number
-- Ammo Check
if (ammo == false) then
local HaveAmmo = false
local arrows = ""
for i=1,360 do
local x,y,name = GetBagItemInfo(i)
if (string.find(name," Thorn")) then
HaveAmmo = true
arrows = name
end
end
if (HaveAmmo == true) then
i=i+1; Skill[i] = { name = "Item: "..arrows, use = (not ammo) } --Equip arrows if have
elseif ((g_cnt%100) == 0) then
SendChatMessage("Make some arrows!","SAY") -- Right click rune bow
end
g_cnt = g_cnt + 1
end
-- Buffs
i=i+1; Skill[i] = { name = "Frost Arrow", use = ((not combat) and (not string.find(pbuffs,"Frost Arrow"))) }
-- i=i+1; Skill[i] = { name = "Blood Arrow", use = ((combat) and (not string.find(pbuffs,"Blood Arrow"))) }
-- i=i+1; Skill[i] = { name = "Custom: Stop Blood Arrow", use = (((not combat) or (phealth <= .55)) and (string.find(pbuffs,"Blood Arrow"))) }
-- Combat
-- i=i+1; Skill[i] = { name = "Action: 29", use = (phealth < .75) } -- use healing pot
-- i=i+1; Skill[i] = { name = "Action: 30", use = (mana < .75) } -- use mana pot
i=i+1; Skill[i] = { name = "Snipe", use = ((not friendly) and (thealth == 1)) } -- use only if mob at 100%
i=i+1; Skill[i] = { name = "Lightning", use = ((not friendly) and (not string.find(tbuffs,"Lightning"))) }
i=i+1; Skill[i] = { name = "Autoshot", use = ((not friendly) and (not ASon)) }
i=i+1; Skill[i] = { name = "Fireball", use = (not friendly) }
i=i+1; Skill[i] = { name = "Combo Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Piercing Arrow", use = (not friendly) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = ((not friendly) and (focus >= 15)) }
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 |
--Scout Priest
function ScoutPriest(arg1,arg2)
local Skill = {}
local i = 0
local focus = UnitMana("player") --works cz focus is constant.
local enemy = UnitCanAttack("player","target")
local health = PctH("player")
local thealth = PctH("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(20) --actionslot where autoshot is.
local melee = GetActionUsable(19)
local combat = GetPlayerCombatState()
local pressshift = IsShiftKeyDown()
local Stop = CancelBuff() --not sure how to use this. keeping it though.
local tspell,ttime,telapsed = UnitCastingTime("target")
local interrupt = ((tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5))
local tDead = UnitIsDeadOrGhost("target")
--Ammo Check --not really using this, i take care of my own arrows but keeping the snippet for possible future use.
if (ammo == false) then
local HaveAmmo = false
local arrows = ""
for i=1,60 do
local x,y,name = GetBagItemInfo(i)
if (string.find(name," Arrow")) then
HaveAmmo = true
arrows = name
end
end
if (HaveAmmo == true) then
i=i+1; Skill[i] = { name = "Item: "..arrows, use = (not ammo) } --Equip arrows if have
elseif ((g_cnt%100) == 0) then
SendChatMessage("I'm out of ammo!","SAY")
end
g_cnt = g_cnt + 1
end
--health
if (health <1) then
i=i+1; Skill[i] = { name = "Holy Aura", use = ((health < .25) and (not string.find(pbuffs,"Holy Aura"))) }
i=i+1; Skill[i] = { name = "Regenerate", use = ((health < .75) and (not string.find(pbuffs,"Regenerate"))) }
i=i+1; Skill[i] = { name = "Urgent Heal", use = (health < .50) }
i=i+1; Skill[i] = { name = "Action: 40 (HoT Pot)", use = (health < .45) }
i=i+1; Skill[i] = { name = "Action: 39 (HP Pot)", use = (health < .35) }
end
-- off heal
if (not enemy) then
i=i+1; Skill[i] = { name = "Regenerate", use = ((thealth < .75) and (not string.find(tbuffs,"Regenerate"))) }
i=i+1; Skill[i] = { name = "Urgent Heal", use = (thealth < .5) }
i=i+1; Skill[i] = { name = "Urgent Heal", use = ((UnitMaxMana("target") > 200) and (PctM("target") < .3)) }
end
--combat
if (enemy) then
--melee (range 50 or less)
if (melee) then
i=i+1; Skill[i] = { name = "Throat Attack", use = (interrupt and (focus >= 15) and (arg2 =="boss")) }--conditional may be replaced with a "do not interrupt list later"
i=i+1; Skill[i] = { name = "Joint Blow", use = (arg2 =="kite") } --hopefully you wont be melee when kiting
i=i+1; Skill[i] = { name = "Wrist Attack", use = (arg2 =="boss") }
end
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pbuffs,"Frost Arrow")) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((health > .95) and (not string.find(pbuffs,"Blood Arrow"))) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((health < .55) and (string.find(pbuffs,"Blood Arrow"))) }
i=i+1; Skill[i] = { name = "Snipe", use = ((not combat) and (arg2 == "boss")) } --moving snipe opener to boss rotation allows to waste less time when pulling trash or farming easy kills.
i=i+1; Skill[i] = { name = "Shot", use = true }
-- i=i+1; Skill[i] = { name = "Combo Shot", use = (not melee) } -- gets interrupeted in melee.
i=i+1; Skill[i] = { name = "Wind Arrows", use = ((arg2 =="kite") and (focus > 20) and (not string.find(tbuffs,"Frost Slowdown"))) }-- prioritized over other shots in kiting rotation
i=i+1; Skill[i] = { name = "Autoshot", use = ((not ASon)) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((focus >= 20)) }
if (arg2 =="boss") then --to be used only when it is safe for these "AoE" shots go off.
i=i+1; Skill[i] = { name = "Piercing Arrow", use = true }
i=i+1; Skill[i] = { name = "Reflected Shot", use = true }
end
i=i+1; Skill[i] = { name = "Wind Arrows", use = (focus > 20) }
i=i+1; Skill[i] = { name = "Snipe", use = (not melee) } --change conditional after lvl 25 elite.
end
--off combat
if (not combat) then
i=i+1; Skill[i] = { name = "Blood Arrow", use = (string.find(pbuffs,"Blood Arrow")) }
i=i+1; Skill[i] = { name = "Magic Barrier", use = (not string.find(pbuffs,"Magic Barrier")) }
i=i+1; Skill[i] = { name = "Attack", use = tDead } --this does not seem to be working.
end
MyCombat(Skill,arg1)
end
|
Quoted from "spamely;334493"
i want to be able to check for the target's target, (this would be the tank while am dpsing, and the poor soul who got aggro when am catching adds)
this would mean that an offheal would happen seamlesly, ot when am catching adds if i do not get to them in time, that regen goes on the player in time.
as i see it, i assume id need to put my target in focus 1, targets target in focus two, switch to focus two if health is low, cast regen and then switch to focus 1. alternatively i could cast on focus 2 without switching targets, but the code might find the check for friendly returns that am target an enemy.
|
|
Source code |
1 2 |
local ttfriendly = (not UnitCanAttack("player", "targettarget"))
local tthealth = PctH("targettarget")
|
|
|
Source code |
1 2 |
i=i+1; Skill[i] = { name = "Custom: Regenerate", use = (ttfriendly and (tthealth <= 0.5) and (not string.find(BuffList("targettarget"), "Regenerate"))) }
i=i+1; Skill[i] = { name = "Custom: Urgent Heal", use = (ttfriendly and (tthealth <= 0.33)) }
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
function CustomAction(action)
if CD(action) then
FocusUnit(12, "target")
TargetUnit("targettarget")
CastSpellByName(action)
TargetUnit("focus12")
FocusUnit(12, "")
return true
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 |
function RoguePriestPVE(arg1,arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local health = PctH("player")
i=i+1; Skill[i] = { ['name'] = "Holy Aura", ['use'] = (PctH("player") <= .30) }
i=i+1; Skill[i] = { ['name'] = "Premeditation", ['use'] = ((not string.find(pbuffs,"Premeditation")) and (not combat)) }
i=i+1; Skill[i] = { ['name'] = "Sneak Attack", ['use'] = ((not friendly) and (energy >=20) and (arg2=="behind")) }
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 >=35) and (string.find(tbuffs,"Bleed"))) }
i=i+1; Skill[i] = { ['name'] = "Blind Spot", ['use'] = ((not friendly) and (energy >=25) and (arg2=="behind")) }
i=i+1; Skill[i] = { ['name'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35) and (not string.find(tbuffs,"Sneak Attack Bleed")) }
MyCombat(Skill,arg1)
end
|
Quoted from "Sixpax;335586"
Give this a try...
Add these lines to the variable declarations at the top of your function:
Add these lines for the healing of the target's target:
![]()
Source code
1 2local ttfriendly = (not UnitCanAttack("player", "targettarget")) local tthealth = PctH("targettarget")
And finally, add this function to perform the heal (make sure you have the latest DIYCE code):
![]()
Source code
1 2i=i+1; Skill[i] = { name = "Custom: Regenerate", use = (ttfriendly and (tthealth <= 0.5) and (not string.find(BuffList("targettarget"), "Regenerate"))) } i=i+1; Skill[i] = { name = "Custom: Urgent Heal", use = (ttfriendly and (tthealth <= 0.33)) }
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11function CustomAction(action) if CD(action) then FocusUnit(12, "target") TargetUnit("targettarget") CastSpellByName(action) TargetUnit("focus12") FocusUnit(12, "") return true end return false end
Quoted from "spamely;335877"
THIS IS BRILLIANT!!!! how ever after initial testing, i found that in an instance setting, having heals fire off on their own is RISKY.
regardless, i will reuse to code for a druid i have on the works, who will probably make VERY good use of it.
|
|
Source code |
1 |
/run ScoutPriest("", "noheal")
|
Quoted from "mrmisterwaa;335603"
Let me know if I am doing anything wrong.
Quoted from "mrmisterwaa;335603"
(Point for consideration - Sneak Attack can be used in Combat, EC: 20)
Another thing, I want the Shadowstab to make sure that even before it wants to hit that the Sneak Attack Bleed effect is not there (Sneak Attack has a 25 second Bleed, so I don't need to waste my Energy on it) - Unless of course there are no other Rogues on the party as one of their bleeds overrides mine. (bug?)
Quoted from "mrmisterwaa;335603"
I have slowly been going over most of the pages to figure out what I wanted to do with my macro and help me reduce the amount of buttons on my action bar.
Might require some help.