|
|
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 |
function KnightCombo2(arg1, arg2)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player", "target"))
local shield = (GetEquipSlotInfo(17) ~= nil)
local combat = GetPlayerCombatState()
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local health, buffs
if friendly then
health = PctH("target")
buffs = tbuffs
else
health = PctH("player")
buffs = pbuffs
end
i=i+1; Skill[i] = { name = "Action: 34 (Mana)", use = (PctS("player") <= .75) }
i=i+1; Skill[i] = { name = "Action: 36 (Health)", use = (PctH("player") <= .75) }
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 = "Holy Shield", use = (health <= .55) }
i=i+1; Skill[i] = { name = "Urgent Heal", use = (health <= .75) }
i=i+1; Skill[i] = { name = "Regenerate", use = ((health <= .85) and (not string.find(buffs, "Regenerate"))) }
i=i+1; Skill[i] = { name = "Shield of Atonement", use = ((not friendly) and shield) }
i=i+1; Skill[i] = { name = "Whirlwind Shield", use = ((not friendly) and shield) }
i=i+1; Skill[i] = { name = "Mana Return", use = (string.find(tbuffs, "Holy Seals 3")) }
i=i+1; Skill[i] = { name = "Punishment", use = ((not friendly) and string.find(tbuffs, "Light Seal III")) }
i=i+1; Skill[i] = { name = "Holy Strike", use = (not friendly) }
MyCombat(Skill,arg1)
end
|
Quoted from "SNeekey;385811"
Does anyone know how long it takes the script to find, and exicute a skill, in MS?
like is there any CD built in anywhere?
Quoted from "Sixpax;386018"
Make your macro like so:
/run Msg("Start: "..GetTime())
/run YourFunction("v1")
/run Msg("End: "..GetTime())
That will show a precise time value (I think it's actually the number of seconds since your computer started up) before and after it has executed, so just take the difference. Make sure it actually executes a skill. You might want to run it numerous times to get a good range, because it will vary.
My guess is the times will be between 0.2 and 0.4 seconds. Please let me know what results you get.
|
|
Source code |
1 2 3 |
local combat = GetPlayerCombatState()
local dead = UnitIsDeadOrGhost("target")
local enemy = UnitCanAttack("player","target")
|
Quoted from "mots;386403"
Is there a script to not have a certain skill cast until another one is not on cooldown? tried looking a little through this but 135 pages is a little much =P
Quoted from "firescue17;386494"
I'm using a single file with different functions inside said file for all my characters. The code is getting rather long having to declare redundant variables in each individual function.
Above are a few that always have the same meaning, regardless of what class you are playing.
![]()
Source code
1 2 3local combat = GetPlayerCombatState() local dead = UnitIsDeadOrGhost("target") local enemy = UnitCanAttack("player","target")
Is there some way to declare these globally outside the individual class functions? Is there a reason one would not want to do this?
Quoted from "Sixpax;386511"
There's a function called "CD" in the DIYCE code which will return a true if the skill is ready and false if it's not (still on cooldown). Because of the name, it's very easy to confuse it with asking if the skill is on cooldown (sorry for that, it made sense when I made it lol). So just think of it as a "is the skill ready?" check.
You just pass it the skill name as a string. So let's say you want to use a skill called ThisSkill if another skill called ThatSkill is ready, then you'd code it this way:
i=i+1; Skill = { name = "ThisSkill", use = CD("ThatSkill") }
So ThisSkill won't get used until ThatSkill is also available to be used.
Quoted from "ghostwolf82;386539"
That works if you want to use ThisSkill while ThatSkill is on cooldown. However if you want to only use ThisSkill if ThatSkill is ready, then you would want your code to look like this:
i=i+1; Skill = { name = "ThisSkill", use = (not CD("ThatSkill")) }
|
|
Source code |
1 |
local SkillReady = CD |
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 20) and (not CD("Probing Attack"))) }
|
Quoted from "Sixpax;366484"
I gave your code the once-over and found a whole bunch of errors. I corrected as many as I spotted, so give this a try:
Also, whenever you run your code and it doesn't work, be sure to look for a red flashing icon by the minimap and click on it. That will give you some indication of syntax errors and the line number they occur on.
![]()
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 61function ChkArg(arg1, skillname) arg1 = arg1 or "" return (string.find(arg1, skillname) ~= nil) end function ScoutWarden(arg1,arg2,arg3) local Skill = {} local i = 0 local focus = UnitMana("player") local mana = UnitSkill("player") local friendly = (not UnitCanAttack("player","target")) local combat = GetPlayerCombatState() local myhealth = PctH("player") local pbuffs = BuffList("player") local tDead = UnitIsDeadOrGhost("target") local LockedOn = UnitExists("target") local a1,a2,a3,a4,a5,ASon = GetActionInfo(61) -- # is your Autoshot slot number if (myhealth <= .1) then SwapEquipmentItem() for j=1,3 do if IsPetSummoned(j) then ReturnPet(j) end end CastSpellByName("Elven Amulet") return true end i=i+1; Skill[i] = { name = "Blood Arrow", use = (ChkArg(arg2,"boss") and combat and (not ChkArg(pbuffs, "Blood Arrow")) and (myhealth >= .75)) } i=i+1; Skill[i] = { name = "Blood Arrow", use = (ChkArg(pbuffs, "Blood Arrow") and ((not combat) or (myhealth <= .25))) } i=i+1; Skill[i] = { name = "Savage Power", use = (ChkArg(arg2,"boss") and combat and (not ChkArg(pbuffs, "Savage Power"))) } i=i+1; Skill[i] = { name = "Arrow of Essence", use = (ChkArg(arg2,"boss") and combat) } i=i+1; Skill[i] = { name = "Concentration", use = (ChkArg(arg2,"boss") and combat and (not ChkArg(pbuffs,"Concentration"))) } i=i+1; Skill[i] = { name = "Action: 62 (Archer's Glory)", use = (ChkArg(arg2,"boss") and combat and (not ChkArg(pbuffs, "Archer's Glory"))) } i=i+1; Skill[i] = { name = "Autoshot", use = ((not friendly) and (not ASon)) } i=i+1; Skill[i] = { name = "Serenity", use = ( ChkArg(arg2,"boss") and (not CD("Concentration")) and (not ChkArg(pbuffs,"Concentration")) and (UnitMana("player")<15)) } i=i+1; Skill[i] = { name = "Item: Focus Potion", use = (ChkArg(arg2,"boss") and combat and (focus <= 10)) } i=i+1; Skill[i] = { name = "Briar Shield", use = (ChkArg(arg3,"consume") and (not ChkArg(pbuffs,"Briar Shield"))) } i=i+1; Skill[i] = { name = "Entling Offering", use = (ChkArg(arg3,"consume") and (not ChkArg(pbuffs,"Entling Offering"))) } i=i+1; Skill[i] = { name = "Item: Roast Wolf Leg", use = (ChkArg(arg3,"consume") and combat and (not (ChkArg(pbuffs,"Informer") or ChkArg(pbuffs,"Roast Wolf Leg")))) } i=i+1; Skill[i] = { name = "Item: Frenzy Potion", use = (ChkArg(arg3,"consume") and combat and (not ChkArg(pbuffs,"Frenzy Potion"))) } i=i+1; Skill[i] = { name = "Item: Strong Stimulant", use = (ChkArg(arg3,"consume") and combat and (not ChkArg(pbuffs,"Strong Stimulant"))) } i=i+1; Skill[i] = { name = "Briar Shield", use = (not ChkArg(pbuffs,"Briar Shield")) } i=i+1; Skill[i] = { name = "Entling Offering", use = (not ChkArg(pbuffs,"Entling Offering")) } i=i+1; Skill[i] = { name = "Shoot", use = (not friendly) } i=i+1; Skill[i] = { name = "Snipe", use = (ChkArg(pbuffs,"Hidden Peril")) } i=i+1; Skill[i] = { name = "Combo Shot", use = (not friendly) } i=i+1; Skill[i] = { name = "Thorn Arrow", use = (not friendly) } i=i+1; Skill[i] = { name = "Hidden Peril", use = (not friendly) } i=i+1; Skill[i] = { name = "Wind Arrows", use = ((not friendly) and (focus >= 15)) } MyCombat(Skill,arg1) if (tDead) or (not LockedOn) or friendly then TargetNearestEnemy() end end
Also, just in case you're not aware of this, that function relies on passing certain text strings to it as the 2nd and 3rd argument in your macro. Let me know if you don't understand what that means and I'll explain further.
Quoted from "trucly363;387584"
Hello Sixpax
Im using this macro for scout/knight, i have commented out some of the skills that knight sub doesnt have. I'd like to know how to call the arg2 for "boss" fight.
Thanks alot
|
|
Source code |
1 2 3 |
if UnitSex("target") > 2 then
arg2 = "boss"
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 |
function WardenWarrior(arg1, hpotslot, mpotslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local friendly = (not UnitCanAttack("player", "target"))
local enemy = (UnitCanAttack("player","target"))
local mana = UnitMana("player")
local rage = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local front = UnitIsUnit("player", "targettarget")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(2)
local LockedOn = UnitExists("target")
local _1,potcd
if hpotslot ~= nil then
_1,potcd=GetActionCooldown(hpotslot)
end
if mpotslot ~= nil then
_1,potcd=GetActionCooldown(mpotslot)
end
if (PctH("player")<.50) and (potcd == 0) then
UseAction(hpotslot)
return
end
if (PctM("player")<.50) and (potcd == 0) then
UseAction(mpotslot)
return
end
i=i+1; Skill[1] = { name = "Charged Chop", use = (enemy and melee and (not combat)) }
i=i+1; Skill[i] = { name = "Slash", use = (enemy and melee and (rage >= 25) and (not string.find(tbuffs,"/Bleed/"))) }
i=i+1; Skill[i] = { name = "Beast Chop", use = (enemy and melee and (rage >= 20) and (string.find(tbuffs,"/Bleed/"))) }
i=i+1; Skill[i] = { name = "Power of the Wood Spirit" use = (enemy and melee) }
i=i+1; Skill[i] = { name = "Attack", use = (enemy or tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if (not LockedOn) then
TargetNearestEnemy()
end
if LockedOn and (not enemy) then
TargetNearestEnemy()
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 |
function WardenWarrior(arg1, hpotslot, mpotslot)
local Skill = {}
local i = 0
local combat = GetPlayerCombatState()
local enemy = (UnitCanAttack("player","target"))
local mana = UnitMana("player")
local rage = UnitSkill("player")
local tbuffs = BuffList("target")
local pbuffs = BuffList("player")
local tDead = UnitIsDeadOrGhost("target")
local melee = GetActionUsable(2)
local LockedOn = UnitExists("target")
hpotslot = hpotslot or 0
mpotslot = mpotslot or 0
i=i+1; Skill[i] = { name = "Action: "..mpotslot, use = (pctmana <= .50) }
i=i+1; Skill[i] = { name = "Action: "..hpotslot, use = (phealth <= .50) }
if enemy and melee then
i=i+1; Skill[1] = { name = "Charged Chop", use = (not combat) }
i=i+1; Skill[i] = { name = "Slash", use = (rage >= 25) and (not string.find(tbuffs,"/Bleed/")) }
i=i+1; Skill[i] = { name = "Beast Chop", use = (rage >= 20) and (string.find(tbuffs,"/Bleed/")) }
i=i+1; Skill[i] = { name = "Power of the Wood Spirit" use = true }
end
i=i+1; Skill[i] = { name = "Attack", use = (enemy or tDead or (not combat and not enemy)) }
MyCombat(Skill,arg1)
if (tDead) or (not LockedOn) or (not enemy) then
TargetNearestEnemy()
end
end
|