I may try to get it to work anyway just as a thought exercise. Checking against zone name and instance difficulty might have some esoteric use in the future.|
|
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 |
local silenceList = {
['Annihilation'] = true,
['King Bug Shock'] = true,
['Mana Rift'] = true,
['Dream of Gold'] = true,
['Flame'] = true,
['Flame Spell'] = true,
['Wave Bomb'] = true,
['Silence'] = true,
['Recover'] = true,
['Restore Life'] = true,
['Heal'] = true,
['Curing Shot'] = true,
['Dark Healing'] = true,
['Leaves of Fire'] = true,
['Urgent Heal'] = true,
}
function KillSequence(arg1, arg2, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--arg2 = Use for multiple buttons for cooldowns and other stuff
--healthpot = # of actionbar slot for health potions
--manapot = # of actionbar slot for mana potions
--foodslot = # of actionbar slot for food (add more args for more foodslots if needed)
local Skill = {}
local Skill2 = {}
local i = 0
-- Player and target status.
local combat = GetPlayerCombatState()
local enemy = UnitCanAttack("player","target")
local EnergyBar1 = UnitMana("player")
local EnergyBar2 = UnitSkill("player")
local pctEB1 = PctM("player")
local pctEB2 = PctS("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local tDead = UnitIsDeadOrGhost("target")
local behind = (not UnitIsUnit("player", "targettarget"))
local melee = GetActionUsable(2) -- # is your melee range spell slot number
local phealth = PctH("player")
local thealth = PctH("target")
local LockedOn = UnitExists("target")
local boss = UnitSex("target") > 2
local elite = UnitSex("target") == 2
local party = GetNumPartyMembers() >= 2
--Determine Class-Combo
mainClass, subClass = UnitClassToken( "player" )
--Silence Logic
local tSpell,tTime,tElapsed = UnitCastingTime("target")
local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1)
--Potion Checks
healthpot = healthpot or 0
manapot = manapot or 0
--Equipment and Pet Protection
if phealth <= .03 then
SwapEquipmentItem() --Note: Remove the first double dash to re-enable equipment protection.
for i=1,6 do
if (IsPetSummoned(i) == true) then
ReturnPet(i);
end
end
end
if (LockedOn and (UnitLevel("target") < 2)) then
TargetUnit("")
TargetNearestEnemy()
return
end
--Begin Player Skill Sequences
--Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT,
--Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR
-- Class: Rogue/Scout
if mainClass == "THIEF" and subClass == "RANGER" then
--arg2: 0 = Buffs, 1 = Melee, 2 = Ranged, 3 = Cooldowns & Potions, 4 = Longer Cooldowns
if (arg2 == "0") then
Skill = {
{ name = "Combat Master", use = ((not pbuffs['Combat Master'])) },
{ name = "Action: 62 (Yawaka's Blessing)", use = ((not pbuffs['Yawaka's Blessing'])) },
{ name = "Action: 69 (Unbridled Enthusiam)", use = ((not pbuffs['Unbridled Enthusiasm'])) }, -- Speed Potion
}
elseif (arg2 == "3") then
Skill = {
{ name = "Informer", use = ((not pbuffs['Informer'])) },
{ name = "Action: 64 (Unknown Choice)", use = ((EnergyBar1 > 20)) },
{ name = "Action: 65 (Caviar Sandwich)", use = ((not pbuffs['Caviar Sandwich'])) },
}
elseif (arg2 == "4") then
Skill = {
{ name = "Action: 46 (Energy Potion)", use = ((EnergyBar1) <= 15 and (boss)) },
{ name = "Action: 30 (Strong Stimulant)", use = ((boss) and (not pbuffs['Fervent Attack'])) },
{ name = "Action: 34 (Extinction Potion)", use = ((boss) and (not pbuffs['Extinction Potion'])) },
{ name = "Energy Thief", use = ((EnergyBar1 < 50) and (boss) and (not tDead)) },
{ name = "Assassins Rage", use = ((boss) and (not tDead)) },
{ name = "Fervent Attack", use = ((boss) and (not tDead) and (not pbuffs['Strong Stimulant'])) },
}
end
if ((enemy) and (arg2 == "1")) then
Skill2 = {
{ name = "Wound Attack", use = ((EnergyBar1 >= 35) and (tbuffs[500654] and tbuffs[500704])) },
{ name = "Blind Spot", use = (((EnergyBar1 >= 25) and boss and behind) and (pbuffs['Energy Thief'] or pbuffs['Premeditation'])) },
{ name = "Shadowstab", use = ((EnergyBar1 >= 20) and (not tbuffs[500654])) },
{ name = "Low Blow", use = ((EnergyBar1 >= 25) and (tbuffs[500654]) and ((not tbuffs[500704]) or pbuffs['Energy Thief'])) },
{ name = "Throat Attack", use = ((EnergyBar2 >= 50) and (boss or elite) and silenceThis) },
{ name = "Vampire Arrows", use = (EnergyBar2 >= 20) },
{ name = "Wrist Attack", use = ((EnergyBar2 >= 50) and (boss)) },
{ name = "Shot", use = ((EnergyBar1 < 20 )) },
}
elseif (arg2 == "2") then
Skill2 = {
{ name = "Vampire Arrows", use = (EnergyBar2 >= 20) },
{ name = "Shot", use = (not melee) },
}
end
--ADD MORE CLASS COMBOS HERE.
--USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS.
--THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS.
--DO NOT POST BELOW THE FOLLOWING "END" STATEMENT!
end
--End Player Skill Sequences
if (not MyCombat(Skill, arg1)) then
MyCombat(Skill2, arg1)
end
--Select Next Enemy
--[[
if (tDead) then
TargetUnit('')
TargetNearestEnemy()
return
elseif (not LockedOn) or (not enemy) then
TargetNearestEnemy()
return
end
--]]
end
|
Quoted
Updates made to OP, and new .zip file uploaded with fixes.
Quoted from "1Rausch1;481153"
Ok little different error this time
interface\Addons\DIYSCE\CustomFunctions.lua [string '?']:146:'<eof>' expected near 'end'
this happens when loading DIYSCE using
![]()
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 150local silenceList = { ['Annihilation'] = true, ['King Bug Shock'] = true, ['Mana Rift'] = true, ['Dream of Gold'] = true, ['Flame'] = true, ['Flame Spell'] = true, ['Wave Bomb'] = true, ['Silence'] = true, ['Recover'] = true, ['Restore Life'] = true, ['Heal'] = true, ['Curing Shot'] = true, ['Dark Healing'] = true, ['Leaves of Fire'] = true, ['Urgent Heal'] = true, } function KillSequence(arg1, arg2, healthpot, manapot, foodslot) --arg1 = "v1" or "v2" for debugging --arg2 = Use for multiple buttons for cooldowns and other stuff --healthpot = # of actionbar slot for health potions --manapot = # of actionbar slot for mana potions --foodslot = # of actionbar slot for food (add more args for more foodslots if needed) local Skill = {} local Skill2 = {} local i = 0 -- Player and target status. local combat = GetPlayerCombatState() local enemy = UnitCanAttack("player","target") local EnergyBar1 = UnitMana("player") local EnergyBar2 = UnitSkill("player") local pctEB1 = PctM("player") local pctEB2 = PctS("player") local tbuffs = BuffList("target") local pbuffs = BuffList("player") local tDead = UnitIsDeadOrGhost("target") local behind = (not UnitIsUnit("player", "targettarget")) local melee = GetActionUsable(2) -- # is your melee range spell slot number local phealth = PctH("player") local thealth = PctH("target") local LockedOn = UnitExists("target") local boss = UnitSex("target") > 2 local elite = UnitSex("target") == 2 local party = GetNumPartyMembers() >= 2 --Determine Class-Combo mainClass, subClass = UnitClassToken( "player" ) --Silence Logic local tSpell,tTime,tElapsed = UnitCastingTime("target") local silenceThis = tSpell and silenceList[tSpell] and ((tTime - tElapsed) > 0.1) --Potion Checks healthpot = healthpot or 0 manapot = manapot or 0 --Equipment and Pet Protection if phealth <= .03 then SwapEquipmentItem() --Note: Remove the first double dash to re-enable equipment protection. for i=1,6 do if (IsPetSummoned(i) == true) then ReturnPet(i); end end end if (LockedOn and (UnitLevel("target") < 2)) then TargetUnit("") TargetNearestEnemy() return end --Begin Player Skill Sequences --Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT, --Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR -- Class: Rogue/Scout if mainClass == "THIEF" and subClass == "RANGER" then --arg2: 0 = Buffs, 1 = Melee, 2 = Ranged, 3 = Cooldowns & Potions, 4 = Longer Cooldowns if (arg2 == "0") then Skill = { { name = "Combat Master", use = ((not pbuffs['Combat Master'])) }, { name = "Action: 62 (Yawaka's Blessing)", use = ((not pbuffs['Yawaka's Blessing'])) }, { name = "Action: 69 (Unbridled Enthusiam)", use = ((not pbuffs['Unbridled Enthusiasm'])) }, -- Speed Potion } elseif (arg2 == "3") then Skill = { { name = "Informer", use = ((not pbuffs['Informer'])) }, { name = "Action: 64 (Unknown Choice)", use = ((EnergyBar1 > 20)) }, { name = "Action: 65 (Caviar Sandwich)", use = ((not pbuffs['Caviar Sandwich'])) }, } elseif (arg2 == "4") then Skill = { { name = "Action: 46 (Energy Potion)", use = ((EnergyBar1) <= 15 and (boss)) }, { name = "Action: 30 (Strong Stimulant)", use = ((boss) and (not pbuffs['Fervent Attack'])) }, { name = "Action: 34 (Extinction Potion)", use = ((boss) and (not pbuffs['Extinction Potion'])) }, { name = "Energy Thief", use = ((EnergyBar1 < 50) and (boss) and (not tDead)) }, { name = "Assassins Rage", use = ((boss) and (not tDead)) }, { name = "Fervent Attack", use = ((boss) and (not tDead) and (not pbuffs['Strong Stimulant'])) }, } end if ((enemy) and (arg2 == "1")) then Skill2 = { { name = "Wound Attack", use = ((EnergyBar1 >= 35) and (tbuffs[500654] and tbuffs[500704])) }, { name = "Blind Spot", use = (((EnergyBar1 >= 25) and boss and behind) and (pbuffs['Energy Thief'] or pbuffs['Premeditation'])) }, { name = "Shadowstab", use = ((EnergyBar1 >= 20) and (not tbuffs[500654])) }, { name = "Low Blow", use = ((EnergyBar1 >= 25) and (tbuffs[500654]) and ((not tbuffs[500704]) or pbuffs['Energy Thief'])) }, { name = "Throat Attack", use = ((EnergyBar2 >= 50) and (boss or elite) and silenceThis) }, { name = "Vampire Arrows", use = (EnergyBar2 >= 20) }, { name = "Wrist Attack", use = ((EnergyBar2 >= 50) and (boss)) }, { name = "Shot", use = ((EnergyBar1 < 20 )) }, } elseif (arg2 == "2") then Skill2 = { { name = "Vampire Arrows", use = (EnergyBar2 >= 20) }, { name = "Shot", use = (not melee) }, } end --ADD MORE CLASS COMBOS HERE. --USE AN "ELSEIF" TO CONTINUE WITH MORE CLASS COMBOS. --THE NEXT "END" STATEMENT IS THE END OF THE CLASS COMBOS STATEMENTS. --DO NOT POST BELOW THE FOLLOWING "END" STATEMENT! end --End Player Skill Sequences if (not MyCombat(Skill, arg1)) then MyCombat(Skill2, arg1) end --Select Next Enemy --[[ if (tDead) then TargetUnit('') TargetNearestEnemy() return elseif (not LockedOn) or (not enemy) then TargetNearestEnemy() return end --]] end
Quoted from "lordmohg;481156"
@Ghostwolf
Just curious as to whether i am using the most current Vs. of 2.0 with fixes or not, would you mind changing the -- DIY Combat Engine version 2.0 with 2.1 2.11 2.2 ... etc. to denote minor changes or moderate changes to the base .lua? So we are all on the same page?
|
|
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 |
-- Class: Knight/Priest
-- DIYCE 2.0
elseif mainClass == "KNIGHT" and subClass == "AUGUR" then
--Potions and Buffs
Skill = {
{ name = "Action: "..healthpot, use = (phealth <= .40) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .40)) }, -- only mana pot if decent health
{ name = "Magic Barrier", use = (pctEB1 >= .05 and (not pbuffs['Magic Barrier'])) },
{ name = "Holy Seal", use = (pctEB1 >= .05 and (not pbuffs['Holy Seal'])) },
{ name = "Enhanced Armor", use = (pctEB1 >= .05 and (not pbuffs['Enhanced Armor'])) },
{ name = "Blessed Spring Water", use = (pctEB1 >= .05 and (not pbuffs['Blessed Spring Water'])) },
-- Heals
{ name = "Holy Shield", use = (phealth <= .20) },
{ name = "Holy Illumination", use = (combat and (phealth <= .75) and (not pbuffs['Holy Illumination'])) },
{ name = "Holy Aura", use = (phealth <= .30) },
{ name = "Resolution", use = (combat and (phealth <= .65)) },
{ name = "Urgent Heal", use = (phealth <= .65) },
{ name = "Regenerate", use = ((phealth <= .90) and (not pbuffs['Regenerate'])) },
}
-- Combat
if enemy then
Skill2 = {
{ name = "Shield of Valor", use = ((phealth <= .8) and shield) },
{ name = "Shield of Discipline", use = (silenceThis and shield) },
{ name = "Shield of Atonement", use = (combat and shield and (not tbuffs['Restrained'])) },
{ name = "Rising Tide", use = (not melee and (thealth >= .99)) }, -- To Pull with
{ name = "Mana Return", use = (tbuffs['Holy Seals 3']) and (pctEB1 <= .70) },
{ name = "Threaten", use = (tbuffs['Holy Seals 3']) and (not tbuffs['Threaten']) },
{ name = "Hatred Strike", use = (combat and party) },-- Agro Multiplier if in party only
{ name = "Disarmament", use = ((UnitLevel("target") >= (UnitLevel("player") - 10)) and (boss or elite) and ((not tbuffs['Disarmament IV']) or (tbuffs['Disarmament IV'].time <= 3))) }, -- stack to 4
{ name = "Whirlwind Shield", use = (shield and pctEB1 >= .2 ) },
{ name = "Charge", use = (combat and (tspell ~= nil)) or (not melee and not tbuffs['Charge']) }, -- charge spellcasters
{ name = "Holy Light's Fury", use = (pctEB1 >= .2 ) and not tbuffs['Holy Light's Fury'] }, -- Knight/Priest 15 Elite
{ name = "Holy Smite", use = (pctEB1 >= .2 ) and tbuffs['Holy Light's Fury'] }, -- Knight/Priest 20 Elite
{ name = "Holy Strike", use = (pctEB1 >= .2 ) and not tbuffs['Light Seal III'] },
{ name = "Punishment", use = (tbuffs['Light Seal III']) },
}
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 |
-- Class: Priest/Knight
-- DIYCE 2.0
elseif mainClass == "AUGUR" and subClass == "KNIGHT" then
local PetExists = UnitExists("playerpet")
local petname = UnitName("playerpet")
local pethealth = PctH("playerpet")
local petbuffs = BuffList("playerpet")
local petAttackActive = false
-- Pet Summon
Skill = {
{ name = "Light Fairy", use = ((not PetExists) and (not combat)) },
{ name = "Pet Skill: 6 (Devotion Halo)", use = ((PetExists) and (not petbuffs['Devotion Halo'])) } ,
{ name = "Pet Skill: 7 (Conceal)", use = ((PetExists) and (not petbuffs['Conceal'])) },
--Potions and Buffs
Skill = {
{ name = "Action: "..healthpot, use = (phealth <= .40) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .40)) }, -- only mana pot if decent health
{ name = "Magic Barrier", use = ((pctEB1 >= .05) and (not pbuffs['Magic Barrier'])) },
{ name = "Enhanced Armor", use = ((pctEB1 >= .05) and (not pbuffs['Enhanced Armor'])) },
{ name = "Blessed Spring Water", use = ((pctEB1 >= .05) and (not pbuffs['Blessed Spring Water'])) },
{ name = "Holy Power", use = (combat and (pctEB1 <= .80) and (not pbuffs['Holy Power'])) },
{ name = "Wave Armor", use = (combat and not pbuffs['Wave Armor']) },
{ name = "Soul Bond", use = (not pbuffs['Soul Bond']) },
{ name = "Grace of Life", use = (not pbuffs['Enhanced Grace of Life']) },
{ name = "Amplified Attack", use = (not pbuffs['Amplified Attack']) },
-- Self Heals
{ name = "Regenerate", use = ((phealth <= .85) and (not pbuffs['Regenerate'])) },
{ name = "Urgent Heal", use = (phealth <= .55) },
{ name = "Heal", use = (phealth <= .40) },
{ name = "Holy Aura", use = (phealth <= .30) },
{ name = "Soul Source", use = (phealth <= .25) },
-- Target Heals
{ name = "Regenerate", use = (friendly and (thealth <= .80) and (not tbuffs['Regenerate'])) },
{ name = "Urgent Heal", use = (friendly and (thealth <= .55)) },
{ name = "Heal", use = (friendly and (thealth <= .40)) },
}
-- Combat
if enemy then
Skill2 = {
{ name = "Bone Chill", use = (not tbuffs['Bone Chill']) },
{ name = "Rising Tide", use = true },
}
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 |
-- Class: Druid/MAGE
-- DIYCE 2.0
elseif mainClass == "DRUID" and subClass == "MAGE" then
-- Silence
Skill = {
{ name = "Silence", use = (silenceThis) },
-- Potions
{ name = "Action: "..healthpot, use = (phealth <= .40) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .40)) }, -- only mana pot if decent health
-- Heals
{ name = "Mother Earth's Protection", use = (phealth <= .30) },
{ name = "Recover", use = (phealth <= .40) },
{ name = "Curing Seed", use = (phealth <= .50) },
{ name = "Restore Life", use = ((phealth <= .60) and (pbuffs['Nature's Power'].stack <=2))}, -- use this ahead of Recover if low on Natures Power
{ name = "Recover", use = ((phealth <= .60) and (not pbuffs['Recover'])) },
{ name = "Antidote", use = (pbuffs['Poisoned']) },
{ name = "Purify", use = (pbuffs['Curse']) },
{ name = "Blossoming Life", use = ((phealth <= .80) and (not pbuffs['Blossoming Life'])) },
{ name = "Blossoming Life", use = ((phealth <= .90) and not combat) },
-- Buffs
{ name = "Savage Blessing", use = (not pbuffs['Savage Blessing']) },
{ name = "Concentration Prayer", use = (not pbuffs['Concentration Prayer']) },
{ name = "Fire Ward", use = (not pbuffs['Fire Ward']) },
{ name = "Intensification", use = (enemy and not pbuffs['Intensification']) },
}
-- Ranged Attack
if enemy then
Skill2 = {
{ name = "Binding Silence", use = (tspell ~= nil and ttime >= 1 and (ttime - telapsed) > 0.5 and pctEB1 >= .05) },
{ name = "Briar Entwinement", use = (not tbuffs['Briar Entwinement'] or BuffTimeLeft("target", "Briar Entwinement") <=2) },
{ name = "Fireball", use = (combat) },
{ name = "Earth Pulse", use = (combat) },
{ name = "Weakening Seed", use = ((boss or elite) and (not tbuffs['Weakening Seed']) and (pbuffs['Nature's Power'].stack >= 3)) },
{ name = "Lightning", use = (not tbuffs['Lightning']) },
{ name = "Rockslide", use = (true) },
{ name = "Earth Arrow", use = (true) },
}
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 |
-- Class: Mage/Druid
-- DIYCE 2.0
elseif mainClass == "MAGE" and subClass == "DRUID" then
-- Silence
Skill = {
{ name = "Silence", use = (silenceThis) },
-- Potions
{ name = "Action: "..healthpot, use = (phealth <= .50) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .50)) }, -- only mana pot if decent health
-- Heals
{ name = "Recover", use = ((phealth <= .60) and not pbuffs['Recover']) },
{ name = "Recover", use = (phealth <= .30) },
{ name = "Recover", use = ((phealth <= .90) and not combat) }, -- top off before fight
-- Buffs
{ name = "Perception", use = (not pbuffs['Perception']) }, -- Mage/Druid Elite 15
{ name = "Magic Target", use = (not combat and not pbuffs['Magic Target']) }, -- Mage/Druid Elite 20
{ name = "Savage Blessing", use = (not pbuffs['Savage Blessing']) },
{ name = "Fire Ward", use = (not pbuffs['Fire Ward']) },
{ name = "Electrostatic Charge", use = (not pbuffs['Electrostatic Charge']) },
-- In case Electrostatic Charge is still on cooldown and you're getting hit hard
{ name = "Mother Earth's Protection", use = ((phealth <= .30) and not pbuffs['Electrostatic Charge']) },
{ name = "Elemental Catalysis", use = (not pbuffs['Elemental Catalysis']) },
{ name = "Intensification", use = (not pbuffs['Intensification']) },
}
-- Ranged Attack
if enemy then
Skill2 = {
{ name = "Fireball", use = (true) },
{ name = "Lightning", use = (not tbuffs['Lightning']) },
{ name = "Meteor Shower", use = (combat and tbuffs['Lightning']) },
{ name = "Phoenix", use = (combat and melee) },
{ name = "Earth Pulse", use = (combat and melee) },
{ name = "Flame", use = (not tbuffs['Lightning']) },
{ name = "Plasma Arrow", use = (not pbuffs['Charged']) },
}
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 |
-- Class: Scout/Warden
-- DIYCE 2.0
elseif mainClass == "RANGER" and subClass == "WARDEN" then
-- Cancel Blood Arrows out of combat or at less than 40% health, without invoking the GCD.
if friendly or (not UnitExists("target")) or tdead or (phealth <= .40) and (pbuffs['Blood Arrow']) then
CancelBuff("Blood Arrow")
end
-- Potions
Skill = {
{ name = "Action: "..healthpot, use = (phealth <= .50) },
{ name = "Action: "..manapot, use = ((EnergyBar1 <= .50) and (phealth >= .50)) }, -- only mana pot if decent health
-- Self Bufffs
{ name = "Frost Arrow", use = (EnergyBar1 >= 20 and not pbuffs['Frost Arrow']) },
{ name = "Concentration", use = (EnergyBar1 >= 20 and not pbuffs['Concentration']) },
{ name = "Briar Shield", use = (not pbuffs['Briar Shield']) },
}
-- Use Throat Attack on detect enemy spell cast.
if enemy then
Skill2 = {
{ name = "Throat Attack", use = (melee and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and pctEB1 >= 15) },
-- Combat
{ name = "Savage Power", use = (combat and not pbuffs['Savage Power']) },
{ name = "Arrow of Essence", use = (EnergyBar1 >= 20 and boss) },
{ name = "Target Area", use = (combat and boss) },
{ name = "Blood Arrow", use = (phealth >= .80 and party and combat and not pbuffs['Blood Arrow']) },
-- Shots
{ name = "Shot", use = (EnergyBar1 <= 15 and combat) },
{ name = "Autoshot", use = (not ASon and combat) },
{ name = "Hidden Peril", use = (pbuffs[ 'Hidden'] and EnergyBar1 >= 35) }, -- Warden 25 Elite
{ name = "Snipe", use = (pbuffs[ 'Hidden Peril']) },
{ name = "Vampire Arrows", use = (pctEB1 >= 50 and not tbuffs['Vampire Arrows']) },
{ name = "Piercing Arrow", use = (true) },
{ name = "Wind Arrows", use = (thealth >= .75 and EnergyBar1 >= 50) },
{ name = "Combo Shot", use = (true) },
{ name = "Thorn Arrow", use = (pbuffs['Briar Shield']) }, -- Warden 15 Elite
{ name = "Reflected Shot", use = (true) },
-- Wrist and Joint- only if focus is plentiful. I dunno if Joint attack is even worthwhile- maybe for kiting?
{ name = "Wrist Attack", use = (not tbuffs['Wrist Attack'] and EnergyBar1 >= 50 and melee) },
{ name = "Joint Blow", use = (not tbuffs['Joint Blow'] and EnergyBar1 >= 50 and melee) },
{ name = "Power of the Wood Spirit", use = (melee) },
{ name = "Gryphon Bash", use = (melee) },
{ name = "Charged Chop", use = (melee) },
}
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 |
-- Class: Warden/Scout 11/7/2011
-- DIYCE 2.0
elseif mainClass == "WARDEN" and subClass == "RANGER" then
local PetExists = UnitExists("playerpet")
local petname = UnitName("playerpet")
local pethealth = PctH("playerpet")
local petAttackActive = false
if (PetExists and UnitExists("pettarget") and UnitCanAttack("player","pettarget") and combat) then
petAttackActive = true
end
-- Cancel Blood Arrows out of combat or at less than 40% health, without invoking the GCD.
if friendly or (not UnitExists("target")) or tdead or (phealth <= .40) and (pbuffs['Blood Arrow']) then
CancelBuff("Blood Arrow")
end
-- Potions
Skill = {
{ name = "Action: "..healthpot, use = (phealth <= .60) },
{ name = "Action: "..manapot, use = ((pctEB1 <= .50) and (phealth >= .40)) }, -- only mana pot if decent health
{ name = "Elven Prayer", use = ((pethealth <= .70) and PetExists) },
-- Buffs
{ name = "Briar Shield", use = (not pbuffs['Briar Shield']) },
{ name = "Protection of Nature", use = (not pbuffs['Protection of Nature']) },
-- Pet
{ name = "Summon Spirit of the Oak", use = ((not PetExists) and (not pbuffs['Heart of the Oak']) and (not combat)) },
{ name = "Summon Spirit of the Oak", use = ((PetExists) and (not string.find(petname,"Spirit of the Oak")) and (not pbuffs['Heart of the Oak']) and (not combat)) } ,
-- Cheaper to Recast weak pet than to heal
{ name = "Summon Spirit of the Oak", use = ((pethealth <= .25) and (PetExists) and (not pbuffs['Heart of the Oak'])) },
-- Hold Shift to Absorb Spirit of the Oak to Tank
{ name = "Heart of the Oak", use = (IsShiftKeyDown() and (not combat) and (PetExists) and (string.find(petname,"Spirit of the Oak")) and (not pbuffs['Heart of the Oak'])) },
}
-- Combat
if enemy then
Skill2 = {
-- the following is my pet's basic attack command, and it is listed first in order to use it as a combat opener and help ensure that the pet gets first aggro, making aggro management easier.
{ name = "Pet Skill: 3 (Pet Attack)", use = ((not petAttackActive) and (not tdead) and PetExists) },
-- Make sure pet is assisting me.
{ name = "Pet Skill: 3 (Pet Attack)", use = ((petAttackActive) and (not UnitIsUnit( "playerpettarget", "playertarget" )) and PetExists) },
-- Use Throat Attack on detect enemy spell cast.
{ name = "Throat Attack", use = (melee and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and pctEB1 >= 15) },
{ name = "Damage Transfer", use = (PetExists and combat and (pctEB1 <= .50) and (not pbuffs['Energy Absorb'])) },
{ name = "Energy Absorb", use = (combat and (pctEB1 <= .50) and (not pbuffs['Energy Absorb'])) },
{ name = "Blood Arrow", use = ((phealth >= .80) and party and combat and (not pbuffs['Blood Arrow'])) },
{ name = "Savage Power", use = (combat and (not pbuffs['Savage Power'])) },
{ name = "Elven Amulet", use = (combat and (UnitIsUnit( "targettarget", "player" )) and (not pbuffs['Elven Amulet'])) },
{ name = "Vampire Arrows", use = ((EnergyBar2 >= 40) and (not tbuffs['Vampire Arrows'])) },
{ name = "Anti-Magic Arrow", use = (true) },
{ name = "Shot", use = (combat) },
{ name = "Wrist Attack", use = ((melee) and (not tbuffs['Wrist Attack']) and (EnergyBar2 >= 50)) },
{ name = "Thorny Vines", use = ((pctEB1 >= .05) and melee and (not tbuffs['Thorny Vines'])) },
{ name = "Power of the Wood Spirit", use = (melee) },
{ name = "Untamable", use = ((EnergyBar2 >= 60) and melee) },
{ name = "Cross Chop", use = (melee) },
{ name = "Charged Chop", use = (melee) },
{ name = "Frantic Briar", use = (melee) },
}
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 |
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
local useit = type(Skill[x].use) ~= "function" and Skill[x].use or (type(Skill[x].use) == "function" and Skill[x].use() or false)
if useit 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
[B]elseif string.find(Skill[x].name, "Pet Skill:") then
action = string.gsub(Skill[x].name, "(Pet Skill:)( *)(%d+)(.*)", "%3")
if talktome then Msg("- Activating Pet Action "..action, 0, 1, 1) end
UsePetAction(action)
if (arg1 == "v2") then Msg(Skill[x].name.." has been fully processed") end
return true[/B]
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 |
-- Class: Priest/Knight
elseif mainClass == "AUGUR" and subClass == "KNIGHT" then
local PetExists = UnitExists("playerpet")
local petname = UnitName("playerpet")
local pethealth = PctH("playerpet")
local petbuffs = BuffList("playerpet")
local petAttackActive = false
-- Pet Summon
Skill = {
{ name = "Light Fairy", use = ((not PetExists) and (not combat)) },
{ name = "Pet Skill: 6 (Devotion Halo)", use = ((PetExists) and (not petbuffs['Devotion Halo'])) } ,
{ name = "Pet Skill: 7 (Conceal)", use = ((PetExists) and (not petbuffs['Conceal'])) },
|
|
|
Source code |
1 2 3 4 5 6 7 |
elseif string.find(Skill[x].name, "Pet Skill:") then
action = string.gsub(Skill[x].name, "(Pet Skill:)( *)(%d+)(.*)", "%3")
if talktome then Msg("- Activating Pet Action "..action, 0, 1, 1) end
UsePetAction(action)
if (arg1 == "v2") then Msg(Skill[x].name.." has been fully processed") end
return true
end
|
Quoted from "CROMI80;481273"
just cant get the new diyce to work. can someone give me some pointers?
|
|
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 |
--Class: Scout/Warden
if mainClass == "RANGER" and subClass == "WARDEN" then
--Potions and Buffs
Skill = {
{ name = "Frost Arrow", use = (not pbuffs("Frost Arrow")) },
{ name = "Briar Shield", use = (not pbuffs("Briar Shield")) },
{ name = "Entling Offering", use = (not pbuffs("Entling Offering")) },
--Combat & PVE
if enemy and (mode == "PvE") then
Skill2 = {
{ name = "Snipe", use = (pbuffs("Hidden Peril")) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Autoshot", use = (not ASon) },
{ name = "Vampire Arrows", use = (CD("Vampire Arrows") and (EnergyBar1 >= 30)) },
{ name = "Thorn Arrow", use = (CD("Torn Arrow")) },
{ name = "Hidden Peril", use = (CD("Hidden Peril") and (EnergyBar1 >= 30)) },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Wind Arrows", use = ((CD("Wind Arrows")) and (EnergyBar1 >= 55)) },
{ name = "Shoot", use = (CD("Shoot")) },
}
--Combat & PVP
elseif enemy and (mode == "PvP") then
Skill2 = {
{ name = "Detection", use = (not pbuffs("Detection")) },
{ name = "Snipe", use = (pbuffs("Hidden Peril")) },
{ name = "Autoshot", use = (not ASon) },
{ name = "Piercing Arrow", use = (CD("Piercing Arrow")) },
{ name = "Reflected Shot", use = (CD("Reflected Shot")) },
{ name = "Vampire Arrows", use = (CD("Vampire Arrows")) },
{ name = "Thorn Arrow", use = (CD("Torn Arrow")) },
{ name = "Hidden Peril", use = (CD("Hidden Peril") and (EnergyBar1 >= 30)) },
{ name = "Combo Shot", use = (CD("Combo Shot")) },
{ name = "Wind Arrows", use = ((CD("Wind Arrows")) and (EnergyBar1 >= 35)) },
}
end
|
Quoted from "mrmisterwaa;481277"
One last thing... I am not sure why you are CD. DIYCE already checks if a skill is in cooldown before it even tries to use it.
Quoted
Just a weird question, how does playerpet work? Wouldn't the item shop pet be considered one as well? (Same with the summoned pet?)
Quoted from "lordmohg;481288"
Someone posted earlier about using "mode"
/run KillSequence("",11,12,"CD")
/run KillSequence("",11,12,"Buff")
/run KillSequence("",11,12,"DPS")
"playerpet" is what your personal pet is called as a "target" instead of "target" or "player"