|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
function kdps(arg1, arg2)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player", "target"))
local shield = (GetEquipSlotInfo(17) ~= nil)
local combat = GetPlayerCombatState()
local rage = UnitSkill("player")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { name = "Enhanced Armor", use = (not string.find(pbuffs, "Enhanced Armor")) }
i=i+1; Skill[i] = { name = "Holy Seal", use = (not string.find(pbuffs, "Holy Seal")) }
i=i+1; Skill[i] = { name = "Action:71(FSS)", use = (not friendly) }
i=i+1; Skill[i] = { name = "Slash", use = (not friendly) and (rage > 60) }
i=i+1; Skill[i] = { name = "Action:1(dps)", use= (not friendly) }
MyCombat(Skill,arg1)
end
|
|
|
Source code |
1 2 3 |
/run kdps() /wait .2 /cast Flawless Scarlet Sword |
Quoted from "eohippus;292491"
Venomous - The reason probing attack isn't going off is because you need to think of DIYCE as a set of skill priorities for combat, if the conditions of a skill "ahead" of probing attack meets duplicate requirements, it will never be used. Try the following (note I don't have high level skills or Throat Attack in my macro, but you can add some back in, just think about where you want them, i.e. if I had a choice I would want skill A to go off first). You need to add a "not string.find" to probing attack and put it first. So that way if the target is already vulnerable, DIYCE will skip probing attack, otherwise it will apply the skill so you can get the vulnerability debuff and trigger the condition for Open Flank. You also only want shot to go off if none of your other priorities are available, so I place it after Slash.
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19function WarriorScout(arg1) local Skill = {} local i = 0 local friendly = (not UnitCanAttack("player","target")) local rage = UnitMana("player") local focus = UnitSkill("player") local tbuffs = BuffList("target") local tspell = UnitCastingTime("target") i=i+1; Skill [i] = { name = "Enraged", use = (rage <= 50) } i=i+1; Skill [i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >= 20)) } i=i+1; Skill [i] = { name = "Open Flank", use = ((not friendly) and (rage >= 10) and (string.find(tbuffs,"Vulnerable"))) } i=i+1; Skill [i] = { name = "Probing Attack", use = ((not friendly) and (rage > 20) and (not string.find(tbuffs, "Vulnerable"))) } i=i+1; Skill [i] = { name = "Aim for the Wound", use = ((not friendly) and (focus >= 30) and (rage < 25)) } i=i+1; Skill [i] = { name = "Skull Breaker", use = ((not friendly) and (focus >= 30) and (rage < 25)) } i=i+1; Skill [i] = { name = "Tactical Attack", use = ((not friendly) and (rage >= 15) and string.find(tbuffs,"Bleed")) } i=i+1; Skill [i] = { name = "Slash", use = ((not friendly) and (rage >= 25)) } i=i+1; Skill [i] = { name = "Shot", use = (not friendly) } MyCombat(Skill,arg1) end
|
|
Source code |
1 |
[string '?']:102: bad argument #1 to 'GetActionCooldown' (number expected, got nil) |
|
|
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 |
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, "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
|
|
|
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 |
function SR(arg1,arg2)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player","target"))
local a1,a2,a3,a4,a5,ASon = GetActionInfo(5) -- # is your Autoshot slot number
-- Player Attributes
local pHealth = PctH("player")
local pFocus = UnitMana("player")
local pEnergy = UnitSkill("player")
-- Player BuffStrings
local pBuffs = BuffList("player")
local pFrostArrow = string.find(pBuffs,"Frost Arrow")
local pBloodArrow = string.find(pBuffs,"Blood Arrow")
-- Target (de)BuffStrings
local tBuffs = BuffList("target")
local tFrostSlowdown = string.find(tBuffs,"Frost Slowdown")
local tLasso = string.find(tBuffs,"Enhanced Lasso")
local tVampireArrows = string.find(tBuffs,"Vampire Arrows")
-- Target Actions
local tSpell,tTime,tElapsed = UnitCastingTime("target")
-- Other Status Checks
local enemy = UnitCanAttack("player", "target")
local combat = GetPlayerCombatState()
local tDead = UnitIsDeadOrGhost("target")
-- Modifier Keys
local useShift = IsShiftKeyDown()
local useCtrl = IsCtrlKeyDown()
local useAlt = IsAltKeyDown()
-- Easy Debugging
if useCtrl then arg1 = "v2" end
-- Health Monitoring
i=i+1; Skill[i] = { name = "Action: 12 (HP Short CD)", use = (pHealth <= .80) and (arg2 == "Boss") }
i=i+1; Skill[i] = { name = "Action: 12 (HP Short CD)", use = (pHealth <= .80) }
-- Loot or normal attack
i=i+1; Skill[i] = { name = "Action: 1 (Loot/Attack)", use = ((not combat) and tDead) }
-- Buffs
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pBuffs,"Frost Arrow")) }
-- Combat (primary actions)
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((pHealth >= .95) and (not string.find(pBuffs, "Blood Arrow")) and (arg2 == "Boss")) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((pHealth < .5) and string.find(pBuffs, "Blood Arrow") and (arg2 == "Boss")) }
i=i+1; Skill[i] = { name = "Blood Arrow", use = ((pHealth < .5) and string.find(pBuffs, "Blood Arrow")) }
i=i+1; Skill[i] = { name = "Weak Spot", use = (enemy and (arg2 == "Boss") and (pFocus >= 30)) }
i=i+1; Skill[i] = { name = "Sapping Arrow", use = (enemy and (arg2 == "Boss")) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (enemy and (arg2 == "Boss") and (pFocus >= 20)and (not string.find (tBuffs,"Vampire Arrows"))) }
i=i+1; Skill[i] = { name = "Combo Shot", use = (enemy) }
i=i+1; Skill[i] = { name = "Autoshot", use = (enemy) }
i=i+1; Skill[i] = { name = "Shot", use = (enemy) }
i=i+1; Skill[i] = { name = "Piercing Arrow", use = (enemy) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = (enemy and (pFocus >= 15)) }
i=i+1; Skill[i] = { name = "Shadowstab", use = (enemy and (pEnergy >= 35)) }
MyCombat(Skill,arg1)
end
|
Quoted from "henkze;292548"
The problem isn't, that my will not swing his weapon and cause white attacks/damage. The problem is that my character doesn't move towards the target to attack it with the item set skill which is located at my hotbar at slot 71.
Quoted from "DawwtheElf;293090"
A little help here please. When I hit the macro it works like a charm, but when target is dead I get the error message:
I'm also having trouble to get the pots to work and to turn of the "Blood Arrow" when it's on.
![]()
Source code
1 [string '?']:102: bad argument #1 to 'GetActionCooldown' (number expected, got nil)
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Blood Arrow", use = (((not combat) or (pHealth < .5)) and pBloodArrow) }
|
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Autoshot", use = ((enemy) and (not ASon)) }
|
|
|
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 RoguePriest(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 tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { name = "Werfen", ['use'] = ((not friendly) and (ttime >= 1) and ((ttime - telapsed) > 0.5)) }
i=i+1; Skill[i] = { name = "Gift", use = (not ChkBuff("player","Giftig") and not combat) }
i=i+1; Skill[i] = { name = "Aura der Schnelligkeit", use = (not string.find(pbuffs, "Aura der Schnelligkeit") and not combat) }
i=i+1; Skill[i] = { name = "Magischer Schutz", use = (not ChkBuff("player","Magischer Schutz") and not combat) }
i=i+1; Skill[i] = { name = "Gesegnetes Quellwasser", use = (not ChkBuff("player","Gesegnetes Quellwasser") and not combat) }
i=i+1; Skill[i] = { name = "Regenerieren", use = ((PctH("player") < .95) and (not string.find(pbuffs, "Regenerieren"))) }
i=i+1; Skill[i] = { name = "Gesegnete Aura", use = ((PctH("player") < .15) ) }
i=i+1; Skill[i] = { name = "Spitzel", use = ((not string.find(pbuffs, "M\195\182rderischer Zorn")) and (not string.find(pbuffs, "Spitzel")) and combat) }
i=i+1; Skill[i] = { name = "Ausweichen", use = ((not string.find(pbuffs, "Ausweichen")) and combat) }
i=i+1; Skill[i] = { name = "Wilder Angriff", use = ((PctH("player") < .40) and (string.find(pbuffs, "Ausweichen")) and combat) }
-- i=i+1; Skill[i] = { name = "Item: Siegel der Verteidigung", use = (not string.find(pbuffs,"Siegel der Verteidigung")) }
i=i+1; Skill[i] = { name = "M\195\182rderischer Zorn", use = ((not string.find(pbuffs, "M\195\182rderischer Zorn")) and (not string.find(pbuffs, "Spitzel")) and combat) }
i=i+1; Skill[i] = { name = "Vorsatz", use = (not ChkBuff("player","Vorsatz") and not combat) }
i=i+1; Skill[i] = { name = "Hinterhalt", use = ((not friendly) and (energy >= 20) and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Toter Winkel-Angriff", use = ((not friendly) and (energy >= 25) and string.find(tbuffs, "Blutende Wunde") and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Blendung", use = ((not friendly) and (energy >= 20) and not string.find(tbuffs, "Blind") and string.find(tbuffs, "Blutende Wunde") and string.find(tbuffs, "Starke Blutung")) }
i=i+1; Skill[i] = { name = "Wunden angreifen", use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Blutende Wunde") and string.find(tbuffs, "Starke Blutung")) }
i=i+1; Skill[i] = { name = "Gemeiner Schlag", use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Blutende Wunde")) }
i=i+1; Skill[i] = { name = "Meucheln", use = ((not friendly) and (energy >= 35) and not string.find(tbuffs, "Blutende Wunde") and not string.find(tbuffs, "Hinterhalt-Blutende Wunde")) }
MyCombat(Skill,arg1)
end
function RogueBoss(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 tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { name = "Werfen", ['use'] = ((not friendly) and (ttime >= 1) and ((ttime - telapsed) > 0.5)) }
i=i+1; Skill[i] = { name = "Gift", use = (not ChkBuff("player","Giftig") and not combat) }
i=i+1; Skill[i] = { name = "Aura der Schnelligkeit", use = (not ChkBuff("player","Aura der Schnelligkeit") and not combat) }
i=i+1; Skill[i] = { name = "Magischer Schutz", use = (not ChkBuff("player","Magischer Schutz") and not combat) }
i=i+1; Skill[i] = { name = "Gesegnetes Quellwasser", use = (not ChkBuff("player","Gesegnetes Quellwasser") and not combat) }
i=i+1; Skill[i] = { name = "Regenerieren", use = ((PctH("player") < .95) and (not string.find(pbuffs, "Regenerieren"))) }
i=i+1; Skill[i] = { name = "Gesegnete Aura", use = ((PctH("player") < .15) ) }
i=i+1; Skill[i] = { name = "Spitzel", use = ((not string.find(pbuffs, "M\195\182rderischer Zorn")) and (not string.find(pbuffs, "Spitzel")) and combat) }
i=i+1; Skill[i] = { name = "Ausweichen", use = ((not string.find(pbuffs, "Ausweichen")) and combat) }
i=i+1; Skill[i] = { name = "Wilder Angriff", use = ((PctH("player") < .40) and (string.find(pbuffs, "Ausweichen")) and combat) }
i=i+1; Skill[i] = { name = "Item: Siegel der Verteidigung", use = (not string.find(pbuffs,"Siegel der Verteidigung")) }
i=i+1; Skill[i] = { name = "M\195\182rderischer Zorn", use = ((not string.find(pbuffs, "M\195\182rderischer Zorn")) and (not string.find(pbuffs, "Spitzel")) and combat) }
i=i+1; Skill[i] = { name = "Verbergen", use = (not ChkBuff("player","Verbergen") and not combat) }
i=i+1; Skill[i] = { name = "Schattengef\195\164ngnis", use = ((not friendly) and (energy >= 50) and not string.find(tbuffs, "Schattengef\195\164ngnis")) }
i=i+1; Skill[i] = { name = "Schattenschritt", use = ((not friendly) and (energy >= 20) and string.find(tbuffs, "Schattengef\195\164ngnis")) }
i=i+1; Skill[i] = { name = "Hinterhalt", use = ((not friendly) and (energy >= 20) and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Item: Trank der herausragenden Fertigkeit", use = (energy <= 10) }
i=i+1; Skill[i] = { name = "Toter Winkel-Angriff", use = ((not friendly) and (energy >= 25) and string.find(tbuffs, "Blutende Wunde") and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Blendung", use = ((not friendly) and (energy >= 20) and not string.find(tbuffs, "Blind") and string.find(tbuffs, "Blutende Wunde") and string.find(tbuffs, "Starke Blutung")) }
i=i+1; Skill[i] = { name = "Wunden angreifen", use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Blutende Wunde") and string.find(tbuffs, "Starke Blutung")) }
i=i+1; Skill[i] = { name = "Gemeiner Schlag", use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Blutende Wunde")) }
i=i+1; Skill[i] = { name = "Meucheln", use = ((not friendly) and (energy >= 35) and not string.find(tbuffs, "Blutende Wunde") and not string.find(tbuffs, "Hinterhalt-Blutende Wunde")) }
MyCombat(Skill,arg1)
end
|
Quoted from "Neon82;294177"
Hi need help in my funktion,
first my code is for German-Skills
next i have an Item witch i will yous to buff me (buff time 2min) it works but to use this item i must first target me and in combat it is a bit dificult if i must first target me then use the item and then target the enemy back. so is it possible
too modifi my funktion that if the buff ends and i must rebuff me that i (in combat/ a enemy is in targete but not in combat)
1.automatikly fokus the enemy
2. target me
3. use the item
4 target back the enemy
or when (not in combat/and no enemy is in target)
1. target me
2. use the item
for the moment i disabled the item ("Spiegel der Verteidigung")
Quoted from "mrmarc0001;294260"
EDIT: Oops, I mixed up my code there. Is it still not possible to set focus via Lua?
Quoted from "Neon82;294237"
i don't know. it just don't work if a enemy is my target (error : can
Quoted from "Sixpax;294344"
You mean with FocusUnit()??
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
-- Requires DIYCE
function Switchback()
if (not string.find(BuffList("player"),"BUFFNAME")) then
if (not UnitExists("focus1")) then
FocusUnit(1,"target")
end
TargetUnit("player")
else TargetUnit("focus1") --or use TargetNearestEnemy()
end
end
|
Quoted from "Sixpax;294349"
I'm going to incorporate the ability to call your own custom "skill execution" function. This will be the ultimate in customization because you'll be able to do pretty much whatever you want it to do.
Change targets, cancel buffs, equip arrows when empty, remember the last skill used, keep skill counters, perform pet related actions... as long as you can build the code to perform the action, it will do it.
Quoted
i=i+1; Skill = { name = "Blood Arrow", use = (((not combat) or (pHealth < .5)) and pBloodArrow) }
Quoted from "DawwtheElf;294545"
Sounds sweet! Could this function be inplemented: Use the skill in the prio list that have the current range even if it's last in the prio list. Now when I hit the go button, my toon runs to the target and engages. I want it to stand still and use the skill that is within range. This was standard in UFACS and would be great for me if you could work here.
This turn Blood Arrow off at once, but I want it to turn off when under a certain %hp, but how do I engage it? Help plz.
Quoted from "DawwtheElf;294545"
Sounds sweet! Could this function be inplemented: Use the skill in the prio list that have the current range even if it's last in the prio list. Now when I hit the go button, my toon runs to the target and engages. I want it to stand still and use the skill that is within range. This was standard in UFACS and would be great for me if you could work here.
Quoted from "DawwtheElf;294545"
This turn Blood Arrow off at once, but I want it to turn off when under a certain %hp, but how do I engage it? Help plz.
Quoted from "Sixpax;294561"
If I understand you correctly, you're asking to have a particular skill run to the target and attack when click-to-move is disabled? I've had others request this and I briefly looked at the UFACS code to try to figure out how it's accomplishing this, but have yet to figure it out. I'm sure it's possible, but I have no idea how to code it.
I'm not clear on what you're asking. Can you be a bit more detailed?
|
|
Source code |
1 |
(not combat) |