Quoted from "neonsun;329392"
function Shotrose(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
i=i+1; Skill = { name = "Fire Rose Explosion", use = ChkBuff("target","Fire Rose III") }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
i=i+1; skill[i] = { name = "Fire Rose", use = (not friendly) }
MyCombat(Skill,arg1)
end
Quoted from "neonsun;329421"
function Warden(arg1)
local Skill = {}
local i = 0
local rage = UnitMana("Player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { name = "Tactical Attack", use = ChkBuff("target","Bleed") }
i=i+1; Skill[i] = { name = "Savage Whirlwind", use = (not friendly) }
i=i+1; Skill[i] = { name = "Charged Chop", use = (not friendly) }
i=i+1; Skill[i] = { name = "Slash", use = ((not friendly) and (rage>=50)) }
i=i+1; Skill[i] = { name = "Power of the Wood Spirit", use = (not friendly) }
MyCombat(Skill,arg1)
end
Quoted from "someonexh0;329067"
wierd part IT WORKS in pvp and in guild castle but not on mobs wth ?
Quoted from "anan1;328851"
Ah, sorry. What I meant was when I remove the dashes my entire code stops working.
(I did a direct copy and paste, sorry about the confusion!)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 |
function NaturesBuff()
local cnt = 1
local buff, icon, power = UnitBuffInfo("player",cnt)
while buff ~= nil do
if buff == "Nature's Power" then
return power
end
cnt = cnt + 1
buff, icon, power = UnitBuffInfo("player",cnt)
end
return 0
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 ScoutPriest(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = (not ChkBuff("player","Frost Arrow")) }
-- i=i+1; Skill[i] = { ['name'] = "Combo Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Autoshot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['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)) }
i=i+1; Skill[i] = { ['name'] = "Rising Tide", ['use'] = ((not friendly) and (focus <= 15)) }
-- i=i+1; Skill[i] = { ['name'] = "Piercing Arrow", ['use'] = (not friendly) }
-- i=i+1; Skill[i] = { ['name'] = "Snipe", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Regenerate", ['use'] = ((PctH("player") <= .90) and (not string.find(pbuffs,"Regenerate"))) }
i=i+1; Skill[i] = { ['name'] = "Urgent Heal", ['use'] = (PctH("player") <= .75) }
MyCombat(Skill,arg1)
end
|

Quoted from "Sixpax;329734"
Can you post your entire class function? I don't see any errors with those particular lines, but there are some assumptions in that limited context that I need to verify.
Quoted from "lesso;330392"
hi i don't really know the .lua language however i have been modifying scripts however urgent heal and regenerate only casts if i re-target myself it wont just change target by itself heres my function and yes cast self in the settings is enabled.
|
|
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 |
function CustomAction(action)
if CD(action) then
FocusUnit(12, "target")
TargetUnit("player")
CastSpellByName(action)
TargetUnit("focus12")
FocusUnit(12, "")
return true
else
return false
end
end
function ScoutPriest(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local phealth = PctH("player")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(#) -- # is your Autoshot action bar slot number
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pbuffs, "Frost Arrow")) }
-- i=i+1; Skill[i] = { name = "Combo Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Autoshot", use = ((not friendly) and (not ASon)) }
i=i+1; Skill[i] = { name = "Shot", 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)) }
i=i+1; Skill[i] = { name = "Rising Tide", use = ((not friendly) and (focus <= 15)) }
-- i=i+1; Skill[i] = { name = "Piercing Arrow", use = (not friendly) }
-- i=i+1; Skill[i] = { name = "Snipe", use = (not friendly) }
i=i+1; Skill[i] = { name = "Custom: Regenerate", use = ((phealth <= .90) and (not string.find(pbuffs,"Regenerate"))) }
i=i+1; Skill[i] = { name = "Custom: Urgent Heal", use = (phealth <= .75) }
MyCombat(Skill,arg1)
end
|
Quoted from "lesso;330392"
:edit: on a side note i intend to add blood arrow enable/disable when engaged and disengaged combat altho i haven't got anything to reference those sorts of operations yet.
i guess the goal is to get it to use blood arrow then use regenerate automaticly then disable blood arrow when outside of combat etc.
Quoted from "lesso;330392"
...i intend to add blood arrow enable/disable when engaged and disengaged combat altho i haven't got anything to reference those sorts of operations yet.
i guess the goal is to get it to use blood arrow then use regenerate automaticly then disable blood arrow when outside of combat etc.
|
|
Source code |
1 |
local combat = GetPlayerCombatState() |
|
|
Source code |
1 2 3 4 5 |
local combat = GetPlayerCombatState()
local pBuffs = BuffList("player")
i=i+1; Skill[i] = { name = "Custom: Stop Blood Arrow", use = ((not combat) and (string.find(pBuffs,"Blood Arrow"))) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = (not string.find(pBuffs,"Blood Arrow")) }
|
|
|
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 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 |
function CustomAction(action)
if CD(action) then
FocusUnit(12, "target")
TargetUnit("player")
CastSpellByName(action)
TargetUnit("focus12")
FocusUnit(12, "")
return true
else
return false
end
end
function ScoutPriest(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local phealth = PctH("player")
local thealth = PctH("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(0)
-- above ASon # is Autoshot's slot number currently slot 0 make sure autoshot is in that slot or change value to corresponding slot number
local combat = GetPlayerCombatState()
local pressshift = IsShiftKeyDown()
local Stop = CancelBuff()
--Ammo Check
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
--buffs
if (not combat) then
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pbuffs,"Frost Arrow")) }
i=i+1; Skill[i] = { name = "Custom: Magic Barrier", use = (not string.find(pbuffs,"Magic Barrier")) }
i=i+1; Skill[i] = { name = "Custom: Blessed Spring Water", use = (not string.find(pbuffs,"Blessed Spring Water")) }
end
--combat skills/preference
i=i+1; Skill[i] = { name = "Custom: Regenerate", use = ((phealth <= .85) and (not string.find(pbuffs,"Regenerate"))) }
i=i+1; Skill[i] = { name = "Custom: Urgent Heal", use = (phealth <= .65) }
i=i+1; Skill[i] = { name = "Custom: Holy Aura", use = (phealth <= .35) }
i=i+1; Skill[i] = { name = "Custom: Stop Blood Arrow", use = (((not combat) or (phealth <= .55)) and (string.find(pbuffs,"Blood Arrow"))) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((combat) and (phealth >= .95) and (not string.find(pbuffs, "Blood Arrow"))) }
-- i=i+1; Skill[i] = { name = "Combo Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Autoshot", use = ((not friendly) and (not ASon)) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = ((not friendly) and (focus >= 15)) }
i=i+1; Skill[i] = { name = "Rising Tide", use = ((not friendly) and (focus <= 15)) }
i=i+1; Skill[i] = { name = "Piercing Arrow", use = ((not friendly) and pressshift) }
i=i+1; Skill[i] = { name = "Snipe", use = ((not friendly) and (not combat)) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = ((not friendly) and (not combat)) }
MyCombat(Skill,arg1)
end
|