Quoted from "FoUZeroEnna;264740"
Ok I have lost all patience with trying to make my function work. I basically used to the MP function that was on I believe page 3 and just added a line to cast regenerate when HP was at 90 and urgent heal if health was at or = to 60 and nothing worked.
Can someone please make a function for MP? I do not even care if its two seperate functions. My WS function works fine but ohhh no not this one. RaR!
Conditions: I would like it to cast regenerate if health is <=90 and urgent heal if health is <=65 and then cycle thru my spells until target is close to death.
And Thank you sixxy for making this combat engine, works brilliantly for my WS.
|
|
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 |
function MagePriest(arg1)
local Skill = {}
local i = 0
local mana = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local phealth = PctH("player")
local thealth = PctH("target")
local health, buffs
if friendly then
health = thealth
buffs = tbuffs
else
health = phealth
buffs = pbuffs
end
i=i+1; Skill[i] = { name = "Holy Aura", use = (phealth <= .30) }
i=i+1; Skill[i] = { name = "Regenerate", use = ((health <= .90) and (not string.find(buffs, "Regenerate"))) }
i=i+1; Skill[i] = { name = "Urgent heal", use = (health <= .65) }
i=i+1; Skill[i] = { name = "Elemental Weakness", use = ((not friendly) and (not string.find(tbuffs, "Elemental Weakness"))) }
i=i+1; Skill[i] = { name = "Magic Drain", use = ((not friendly) and (not string.find(tbuffs, "Drain"))) }
i=i+1; Skill[i] = { name = "Electric Bolt", use = ((not friendly) and (not string.find(tbuffs, "Electric Flux"))) }
i=i+1; Skill[i] = { name = "Fireball", use = (not friendly) }
i=i+1; Skill[i] = { name = "Rising Tide", use = (not friendly) }
i=i+1; Skill[i] = { name = "Flame", use = (not friendly) }
MyCombat(Skill,arg1)
end
|
Quoted from "Tigsman;264950"
strangely odd, but i normally run 2h axe when doing trash and sword and board most of the time tanking. here is what my code looks like for my KW at the moment, always tweaking it though lol
|
|
Source code |
1 2 3 |
local tspell,ttime,telapsed = UnitCastingTime("target")
local tgtcast = UnitCastingTime("target")
|
|
|
Source code |
1 |
local tgtcast,ttime,telapsed = UnitCastingTime("target")
|
Quoted from "ReverantSpark;264933"
Your almost there with blind stab bud, you have to be in front of the target to use it, which Im pretty sure I was. I will retest it after I have corrected the errors.
Quoted from "Sixpax;264982"
Just a minor suggestion for you KWcombat... you don't need both of these lines:
tspell and tgtcast are the same value. So you can just use the first line and replace tspell with tgtcast:
![]()
Source code
1 2 3local tspell,ttime,telapsed = UnitCastingTime("target") local tgtcast = UnitCastingTime("target")
![]()
Source code
1local tgtcast,ttime,telapsed = UnitCastingTime("target")
Quoted from "Sixpax;265006"
AFAIK there's no way to programmatically tell it that you're in front of or behind the target, so in order to have your function execute positional attacks you'll have to signal it that you're in the proper position.
There's a couple of ways to do that, but my preferred method is to pass a 2nd value to the function, much like Tigs is with his threaten and disarm logic.
lol
Quoted from "sinsource;263008"
Hi All,
I am trying to come up with something for a M/R that i have in the works.
I am wondering does this seem structurally sound to you guys ? I haven't had a chance to test it because the M/R isnt high enough level for most of the skills so i will just comment them out until then. The question still remains will with work ?
|
|
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 MageRogue(arg1)
local Skill = {}
local i = 0
local mana = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local health = PctH("player")
i=i+1; Skill[i] = { ['name'] = "Electrostatic Charge", ['use'] = (PctH("player") <= .25) }
i=i+1; Skill[i] = { ['name'] = "Kiss of the Vampire", ['use'] = ((not friendly) and (PctH("player") <= .50)) }
i=i+1; Skill[i] = { ['name'] = "Fang Ritual", ['use'] = ((not combat) and (not string.find(pbuffs,"Fang Ritual"))) }
i=i+1; Skill[i] = { ['name'] = "Energy Influx", ['use'] = ((not combat) and (not string.find(pbuffs,"Energy Influx"))) }
i=i+1; Skill[i] = { ['name'] = "Elemental Weakness", ['use'] = ((not friendly) and (not string.find(tbuffs,"Elemental Weakness"))) }
i=i+1; Skill[i] = { ['name'] = "Discharge", ['use'] = (PctH("player") <= .50) }
i=i+1; Skill[i] = { ['name'] = "Lightning", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Electric Explosion", ['use'] = ((not friendly) and (string.find(pbuffs,"Charged"))) }
i=i+1; Skill[i] = { ['name'] = "Electric Bolt", ['use'] = ((not friendly) and (not string.find(tbuffs,"Electric Flow"))) }
i=i+1; Skill[i] = { ['name'] = "Cursed Fangs", ['use'] = ((not friendly) and (not string.find(tbuffs,"Cursed Fangs"))) }
i=i+1; Skill[i] = { ['name'] = "Plasma Arrow", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
|
Quoted from "RoyRogers;264845"
Exactly
Pretty much. You could delete the lines altogether if you want.
Health pots put at the top. The macro runs the function which does the first thing it is capable of doing then stops. Put the health pots at the top in "reverse" order. Reverse meaning you want the biggest pot to fire at the lowest health. If you are at 30% health and have a Spirit Pot first to fire at 85% and a Phirius B pot after that to fire at 50% it will hit the 85% first and fire then fire the 50% on the next go around. Reverse the order and the 50% will fire first (more immediate need).
Yep, 'tis all you need. I actually have RogueScout1() and RogueScout2(). One I use for normal grinding and does not involve Phirus pots, just the vendor pots. Two involves Phirius pots and I use that while in instances.
Here is what I now use...
Action 68, 69 and 70 are my "Its all gone pear shaped, time to get the goony goo goo ef outa hear" skills... Substitue, Joint Blow and Sprint.
![]()
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 49function RogueScout1(arg1,arg2) local Skill = {} local i = 0 local energy = UnitMana("player") local friendly = (not UnitCanAttack("player","target")) local combat = GetPlayerCombatState() local pbuffs = BuffList("player") local tbuffs = BuffList("target") i=i+1; Skill[i] = { ['name'] = "Action: 68", ['use'] = (PctH("player") < .30) } i=i+1; Skill[i] = { ['name'] = "Action: 69", ['use'] = (PctH("player") < .32) } i=i+1; Skill[i] = { ['name'] = "Action: 70", ['use'] = (PctH("player") < .34) } i=i+1; Skill[i] = { ['name'] = "Action: 62", ['use'] = (PctH("player") < .40) } i=i+1; Skill[i] = { ['name'] = "Action: 61", ['use'] = (PctH("player") < .85) } i=i+1; Skill[i] = { ['name'] = "Combat Master", ['use'] = ((not string.find(pbuffs,"Combat Master")) and (not string.find(pbuffs,"Informer"))) } 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'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35)) } i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) } MyCombat(Skill,arg1) end function RogueScout2(arg1,arg2) local Skill = {} local i = 0 local energy = UnitMana("player") local friendly = (not UnitCanAttack("player","target")) local combat = GetPlayerCombatState() local pbuffs = BuffList("player") local tbuffs = BuffList("target") i=i+1; Skill[i] = { ['name'] = "Action: 68", ['use'] = (PctH("player") < .30) } i=i+1; Skill[i] = { ['name'] = "Action: 69", ['use'] = (PctH("player") < .32) } i=i+1; Skill[i] = { ['name'] = "Action: 70", ['use'] = (PctH("player") < .34) } i=i+1; Skill[i] = { ['name'] = "Action: 65", ['use'] = (PctH("player") < .50) } i=i+1; Skill[i] = { ['name'] = "Action: 64", ['use'] = (PctH("player") < .60) } i=i+1; Skill[i] = { ['name'] = "Action: 63", ['use'] = (PctH("player") < .65) } i=i+1; Skill[i] = { ['name'] = "Action: 62", ['use'] = (PctH("player") < .70) } i=i+1; Skill[i] = { ['name'] = "Action: 61", ['use'] = (PctH("player") < .85) } i=i+1; Skill[i] = { ['name'] = "Combat Master", ['use'] = ((not string.find(pbuffs,"Combat Master")) and (not string.find(pbuffs,"Informer"))) } i=i+1; Skill[i] = { ['name'] = "Poison", ['use'] = ((not combat) and (not string.find(pbuffs,"Poison"))) } 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'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35)) } i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) } MyCombat(Skill,arg1) end
ETA: note that I do not have premed or Vamp Arrows in this. I like to control how I start combat and PM/S/VA/S is now second nature to me. I left shot in the bottom and the script does an excellent job of spamming it when I am out of energy.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
function RogueKnight(arg1,arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { ['name'] = "Enhanced Armor", ['use'] = ((not string.find(pbuffs,"Enhanced Armor")) and (not combat)) }
i=i+1; Skill[i] = { ['name'] = "Poison", ['use'] = ((not string.find(pbuffs,"Poison")) and (not combat)) }
i=i+1; Skill[i] = { ['name'] = "Punishment", ['use'] = (string.find(tbuffs,"Light Seal III")) }
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'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35)) }
i=i+1; Skill[i] = { ['name'] = "Holy Strike", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
|

Quoted from "smoopid;265330"
Is there a way to add health and mana potions to the code below ? or will the engine get stuck on trying to drink a potion if you put in a health check ?
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18function RogueKnight(arg1,arg2) local Skill = {} local i = 0 local energy = UnitMana("player") local friendly = (not UnitCanAttack("player","target")) local pbuffs = BuffList("player") local tbuffs = BuffList("target") i=i+1; Skill[i] = { ['name'] = "Action: 80", ['use'] = (PctH("player") < .85) } i=i+1; Skill[i] = { ['name'] = "Enhanced Armor", ['use'] = ((not string.find(pbuffs,"Enhanced Armor")) and (not combat)) } i=i+1; Skill[i] = { ['name'] = "Poison", ['use'] = ((not string.find(pbuffs,"Poison")) and (not combat)) } i=i+1; Skill[i] = { ['name'] = "Punishment", ['use'] = (string.find(tbuffs,"Light Seal III")) } 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'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=35)) } i=i+1; Skill[i] = { ['name'] = "Holy Strike", ['use'] = (not friendly) } MyCombat(Skill,arg1) end
Quoted from "smoopid;265330"
Is there a way to add health and mana potions to the code below ? or will the engine get stuck on trying to drink a potion if you put in a health check ?
|
|
Source code |
1 2 3 |
function PctM(tgt) return (UnitMana(tgt)/UnitMaxMana(tgt)) end |
|
|
Source code |
1 2 |
i=i+1; Skill[i] = { ['name'] = "Action: 61", ['use'] = (PctH("player") < .80) }
i=i+1; Skill[i] = { ['name'] = "Action: 67", ['use'] = ((not combat) and (PctM < .80)) }
|
Quoted from "RoyRogers;265459"
For mana you will need to add the following as a stand alone function...
function PctM(tgt)
return (UnitMana(tgt)/UnitMaxMana(tgt))
end
I added it under the function defining PctH for tidiness. Now all you need do is add the following lines to your personalized function...
Adjust the Action: ## and Pct? < .## to meet your own specific requirements. And the (no combat) is on my mana line, you can take it out of yours if you want to mana pot in combat.
![]()
Source code
1 2i=i+1; Skill[i] = { ['name'] = "Action: 61", ['use'] = (PctH("player") < .80) } i=i+1; Skill[i] = { ['name'] = "Action: 67", ['use'] = ((not combat) and (PctM < .80)) }
|
|
Source code |
1 |
i=i+1; Skill[i] = { ['name'] = "Action: 67", ['use'] = ((not combat) and (PctM("player") < .80)) }
|
Quoted from "smoopid;265552"
Im getting an error![]()
Maybe im putting this in the wrong place.
![]()
Source code
1 2 3 function PctM(tgt) return (UnitMana(tgt)/UnitMaxMana(tgt)) end
I put this part at the end of the combat engine before my rogueknight function and added the 2 lines to my rogueknight function is this correct ? If so why would I be getting an error ?
Quoted from "Imortalisle;265327"
P.S. Will it make the combat engine faster if I delete the lines I don't need?
Quoted from "RoyRogers;265567"
Did you change the Action numbers to match the slots you have your pots in? And yes, where you put it should be just fine. Need to define the function before calling on it.