Quoted from "WarPrince;511145"
By saying that it wont check cooldowns, do you mean that it will keep trying to use the potion and therefore not advance anymore in the code? Im trying to set it up to where an energy pot will be used before energy thief. If this can you tell me how to have the cd checked.
Quoted from "WarPrince;511241"
Ok so I followed Peryl's guide on how to create timers on page 21 of this thread. Before, when I tried creating timers it would mess up my addons and not work at all. Now my addons are fine so that's an improvement. However, now i get the following errors and my code stopped working.
"Attempt to call global 'PctM' (a nil value)" and " '<eof>' expected near 'end' " (this error is on the diyce lua file not the custom lua)
Could i get some insight on how to remedy these errors. 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 46 47 48 49 50 51 52 53 54 |
if mainClass == "WARRIOR" and subClass == "WARDEN" then
--Timers for this class
CreateDIYCETimer("SSBleed", 6) --Change the value between 6 -> 7.5 depending on your lag.
-- slot 71 72 73 , for mana phyrius 20% 30% 50%
-- slot 74 75 76 , for hp phyrius 20% 30% 50%
-- slot 77 78 79 , for hp+m pots 20% 30% 50%
if (goat2 == "1") then -- HP phyrius button
Skill = {
{ name = "Action: 79 (50%)", use = ((phealth <= .51) and (pctEB2 < .51 ) and (boss or elite)) },
{ name = "Action: 78 (30%)", use = ((phealth <= .31) and (pctEB2 < .31 ) and (boss or elite)) },
{ name = "Action: 77 (20%)", use = ((phealth <= .21) and (pctEB2 < .21 ) and (boss or elite)) },
{ name = "Action: 76 (50% hp)", use = ((phealth <= .51) and (boss or elite)) },
{ name = "Action: 75 (30% hp)", use = ((phealth <= .31) and (boss or elite)) },
{ name = "Action: 74 (20% hp)", use = ((phealth <= .21)) },
}
elseif (goat2 == "2") then --- MP phyr button
Skill = {
{ name = "Action: 79 (50%)", use = ((phealth <= .51) and (pctEB2 < .51 ) and (boss or elite)) },
{ name = "Action: 78 (30%)", use = ((phealth <= .31) and (pctEB2 < .31 ) and (boss or elite)) },
{ name = "Action: 77 (20%)", use = ((phealth <= .21) and (pctEB2 < .21 ) and (boss or elite)) },
{ name = "Action: 76 (50% MP)", use = ((pctEB2 <= .51) and (boss or elite)) },
{ name = "Action: 75 (30% MP)", use = ((pctEB2 <= .31) and (boss or elite)) },
{ name = "Action: 74 (20% MP)", use = ((pctEB2 <= .21)) },
}
end
if ((enemy) and (goat2 == "0")) then ------->>>> neeed help here
Skill2 = {
{ name = "Battle Creed", use = (not pbuffs['Battle Creed']) },
{ name = "Briar Shield", use = (not pbuffs['Briar Shield']) },
{ name = "Survival Instinct", use = ((plife <= .48) and (boss)) }
{ name = "Savage Whirlwind", use = (pctEB2 >= .05) },
{ name = "Tactical Attack", use = ((tbuffs[500081]) and (EnergyBar1 >= 16)) },
{ name = "Attack Weakener", use = ((pctEB2 >= .05) and tbuffs['Vulnerable']) },
{ name = "Open Flank", use = ((tbuffs['Vulnerable']) and (EnergyBar1 >=11)) },
{ name = "Probing Attack", use = ((EnergyBar1 >= 21) and (tbuffs[500081])) },
{ name = "Slash", use = (EnergyBar1 >= 26), timer = "SSBleed", ignoretimer = (pbuffs['aggressivness']) },
{ name = "Enraged", use = ((EnergyBar1 < 25) and (boss or elite)) },
{ name = "Power of the Wood Spirit", use = (pctEB2 >= .05) },
}
end
-- Class: Warden/Warrior
|
Quoted from "neonsun;511294"
![]()
Source code
1{ name = "Slash", use = (EnergyBar1 >= 26), timer = "SSBleed", ignoretimer = (pbuffs["[COLOR=#ff0000]aggressivness[/COLOR]"]) },
NOte : previous poster plz check how i use the timer , this way u can understand
Quoted from "neonsun;511294"
ok i need ur input on the following code
--> the 1st part is a phyrius pot user code put on 2 buttons 1 for hp phyr and 1 for mana phyr ,
do u think it can be improved ??
![]()
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-- slot 71 72 73 , for mana phyrius 20% 30% 50% -- slot 74 75 76 , for hp phyrius 20% 30% 50% -- slot 77 78 79 , for hp+m pots 20% 30% 50% if (goat2 == "1") then -- HP phyrius button Skill = { { name = "Action: 79 (50%)", use = ((phealth <= .51) and (pctEB2 < .51 ) and (boss or elite)) }, { name = "Action: 78 (30%)", use = ((phealth <= .31) and (pctEB2 < .31 ) and (boss or elite)) }, { name = "Action: 77 (20%)", use = ((phealth <= .21) and (pctEB2 < .21 ) and (boss or elite)) }, { name = "Action: 76 (50% hp)", use = ((phealth <= .51) and (boss or elite)) }, { name = "Action: 75 (30% hp)", use = ((phealth <= .31) and (boss or elite)) }, { name = "Action: 74 (20% hp)", use = ((phealth <= .21)) }, } elseif (goat2 == "2") then --- MP phyr button Skill = { { name = "Action: 79 (50%)", use = ((phealth <= .51) and (pctEB2 < .51 ) and (boss or elite)) }, { name = "Action: 78 (30%)", use = ((phealth <= .31) and (pctEB2 < .31 ) and (boss or elite)) }, { name = "Action: 77 (20%)", use = ((phealth <= .21) and (pctEB2 < .21 ) and (boss or elite)) }, { name = "Action: 76 (50% MP)", use = ((pctEB2 <= .51) and (boss or elite)) }, { name = "Action: 75 (30% MP)", use = ((pctEB2 <= .31) and (boss or elite)) }, { name = "Action: 74 (20% MP)", use = ((pctEB2 <= .21)) }, } end
Quoted from "neonsun;511294"
--> i need ur attention at the long buffs i cast when goat=2 , without changing much things, how can i get the buffs cast irrespective of having an enemy selected ,should i put another "if" within ?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
if (goat2 == "1") then -- HP phyrius button
[B][I]...snipped code to make this shorter...[/I][/B]
elseif (goat2 == "2") then --- MP phyr button
[B][I]...snipped code to make this shorter...[/I][/B]
elseif (goat2=="0") then
Skill = {
[B][I]-- Add those buffs here[/I][/B]
}
end
[B][I]Remainder of code stays the same[/I][/B]
|
Quoted
{ name = "Item: Potion of Exquisite Skill", use = (boss and (EnergyBar1 <25)), timer="Energy Potion CD" },
{ name = "Energy Thief", use = ((EnergyBar1 <25) and boss)},
Quoted from "WarPrince;511309"
Thanks Peryl I got the timer working perfectly but I have another problem. Below is the problamatic code
So now the potion is used when i want it to but Energy Thief isnt used at all. Could it possibly be due to having the same requirements for activation?
Quoted from "SirMasterBlue;510977"
I've been all over this and a few other threads. My ? is...is there a way to check the level of a skill to adjust the amount of mana/energy used?
i.e.
![]()
Source code
1{ name = "Crazy Blades", use = (EnergyBar1 >= (20+(2(skillLevel)))) and ((not pbuffs['Crazy Blades']) or (pbuffs['Crazy Blades'].time <= 45)) },
BTW....thanks for everything! You guys/gals are amazing!
Quoted from "neonsun;511626"
@ my onw porblem : and this is a question to experienced users, what wiuld be more efficient ?
- using dyice to check for humanoid or beast Or
- make a list of the bosses from tosh gc sc that are humanoid or beast and use it as a variable
(both methods are things i dont know how to do and help is deeply appreciated .)
Thank you
Quoted from "neonsun;511626"
my onw porblem : and this is a question to experienced users, what wiuld be more efficient ?
- using dyice to check for humanoid or beast Or
- make a list of the bosses from tosh gc sc that are humanoid or beast and use it as a variable
(both methods are things i dont know how to do and help is deeply appreciated .)
Thank you
|
|
Source code |
1 |
/run DEFAULT_CHAT_FRAME:AddMessage("Target is "..(UnitRace("target") or "unknown"))
|
|
|
Source code |
1 |
{ name = "SomeSkill", use = UnitRace("target") == "Human" },
|
|
|
Source code |
1 2 |
local race = UnitRace("target")
local humanoid = race == "Human" or race == "Elf"
|
|
|
Source code |
1 |
{ name = "SomeSkill", use = not humanoid },
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
local bossTypes = {
HUMANOID = 1,
BEAST = 2,
}
local bossList = {
['boss name 1'] = bossTypes.HUMANOID,
['boss name 2'] = bossTypes.BEAST,
}
|
|
|
Source code |
1 |
local bossRacialType = bossList[UnitName('target') or '']
|
|
|
Source code |
1 |
{ name = "SomeSkill", use = bossRacialType == bossTypes.Beast },
|
Quoted from "Peryl;511494"
@SirMasterBlue
Not sure what you mean by Mana cost variable.
Quoted from "SirMasterBlue;511922"
A K/R's level 30 elite skill is Crazy Blades. It costs 20 mana at level 0 and an additional 2 mana per upgrade. Short of going into DIYCE and editing everytime I upgrade that skill, is there a way to write a variable to handle the changes?
|
|
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 |
function KillSequence(arg1, goat2, healthpot, manapot, foodslot)
--arg1 = "v1" or "v2" for debugging
--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(21) -- # is your melee range spell slot number
--local a1,a2,a3,a4,a5,ASon = GetActionInfo(14) -- # is your Autoshot 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
[B]local race = UnitRace("target")
local Beamoid = race == "Humanoid" or race == "Beast"[/B]
--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
--Check for level 1 mobs, if it is, drop target and acquire a new one.
if (LockedOn and (UnitLevel("target") < 2)) then
TargetUnit("")
return
end
--Begin Player Skill Sequences
--Priest = AUGUR, Druid = DRUID, Mage = MAGE, Knight = KNIGHT,
--Scout = RANGER, Rogue = THIEF, Warden = WARDEN, Warrior = WARRIOR
-- Class: Warrior/warden
if mainClass == "WARRIOR" and subClass == "WARDEN" then
--Timers for this class
CreateDIYCETimer("SSBleed", 6) --Change the value between 6 -> 7.5 depending on your lag.
--goat2: 0 = Buffs, 1 = Melee, 2 = Ranged, 3 = Cooldowns & Potions, 4 = Longer Cooldowns
-- slot 72 73 74 , for mana phyrius 20% 30% 50%
-- slot 75 76 77 , for hp phyrius 20% 30% 50%
-- slot 78 79 80 , for hp+m pots 20% 30% 50%
if (goat2 == "1") then -- HP phyrius button
Skill = {
}
elseif (goat2 == "2") then -- mp phyr button
Skill = {
}
elseif (goat2 == "0") then
Skill = {
{ name = "Battle Creed", use = (not pbuffs['Battle Creed']) },
{ name = "Briar Shield", use = (not pbuffs['Briar Shield']) },
{ name = "Survival Instinct", use = (phealth <= .48) },
}
end
[B] if ((enemy) and (Beamoid) and (goat2 == "0")) then[/B]
Skill2 = {
{ name = "Savage Whirlwind", use = (pctEB2 >= .05) },
{ name = "Tactical Attack", use = ((tbuffs[500081]) and (EnergyBar1 >= 16)) },
{ name = "Attack Weakener", use = ((pctEB2 >= .05) and tbuffs['Vulnerable'] and (not pbuffs['Aggressiveness'])) },
{ name = "Open Flank", use = ((tbuffs['Vulnerable']) and (EnergyBar1 >=11)) },
{ name = "Probing Attack", use = ((EnergyBar1 >= 21) and (tbuffs[500081])) },
{ name = "Slash", use = (EnergyBar1 >= 26), timer = "SSBleed", ignoretimer = (pbuffs['Aggressiveness']) },
{ name = "Enraged", use = ((EnergyBar1 < 25) and (boss or elite)) },
{ name = "Power of the Wood Spirit", use = (pctEB2 >= .05) },
}
[B]elseif ((enemy) and (goat2 == "0")) then[/B]
Skill2 = {
{ name = "Savage Whirlwind", use = (pctEB2 >= .05) },
{ name = "Tactical Attack", use = ((tbuffs[500081]) and (EnergyBar1 >= 16)) },
{ name = "Attack Weakener", use = ((pctEB2 >= .05) and tbuffs['Vulnerable'] and (not pbuffs['Aggressiveness'])) },
{ name = "Action: 06 (set skill)", use = ((EnergyBar1 >=11)) },
{ name = "Probing Attack", use = ((EnergyBar1 >= 21) and (tbuffs[500081])) },
{ name = "Slash", use = (EnergyBar1 >= 26), timer = "SSBleed", ignoretimer = (pbuffs['Aggressiveness']) },
{ name = "Enraged", use = ((EnergyBar1 < 25) and (boss or elite)) },
{ name = "Power of the Wood Spirit", use = (pctEB2 >= .05) },
}
end
-- Class: Warden/Warrior
elseif mainClass == "WARDEN" and subClass == "WARRIOR" then
if (goat2 == "0") then
Skill = {
{ name = "Briar Shield", use = (not pbuffs['Briar Shield']) },
}
end
[B] if ((enemy) and (goat2 == "0")) then[/B]
Skill2 = {
{ name = "Pulse Mastery", use = ((tbuffs['Beast Sigil']) and (pctEB1 >= .05)) },
{ name = "Beast Chop", use = (EnergyBar2 >= 21) },
{ name = "Double Chop", use = (pctEB1 >= .05) },
{ name = "Slash", use = (EnergyBar2 >= 25) },
{ name = "Will Attack", use = (pctEB1 >= .05) },
{ name = "Power of the Wood Spirit", use = (pctEB1 >= .05) },
}
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
|