Quoted from "Sixpax;395468"
Great idea. Thanks for this suggestion.
I've updated post #1405 with this change and modified the explanation and code example.

|
|
Source code |
1 2 3 4 5 6 7 8 9 |
function WarriorRogue(arg1)
-- local declarations here
if (not melee) and CD("Surprise Attack") and MySkill("Surprise Attack", arg1) then return true end
if (rage >= 25) and CD("Slash") and MySkill("Slash", arg1) then return true end
if (energy >= 20) and CD("Shadowstab") and MySkill("Shadowstab", arg1) then return true end
return false
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function WarriorRogue(arg1)
local skillname = nil
-- other local declarations here
skillname = "Surpirse Attack"
if (not melee) and CD(skillname) and MySkill(skillname, arg1) then return true end
skillname = "Slash"
if (rage >= 25) and CD(skillname) and MySkill(skillname, arg1) then return true end
skillname = "Shadowstab"
if (energy >= 20) and CD(skillname) and MySkill(skillname, arg1) then return true end
return false
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 |
function CustomAction(actionname) -- this function will be called by the MySkill function *IF* the skillname being processed starts out with "Custom:"
if (actionname == "Save Pet") then -- adding this line so that you could use the CustomAction function for other custom actions
-- if (health <= .15) then -- if my health is 15% or less, then do the following... this check could be used inside of your class function instead, and should be, so I'm commenting it out here
SwapEquipmentItem() -- changes your current equipment set to your other equipment set... this will only prevent equipment damage if your other set is totally *EMPTY*, otherwise your secondary set will take the damage rather than your primary set and you will still need to repair your equipment
for i=1,3 do -- this loop checks each of three pets, and if the pet is active, it stores it
if (IsPetSummoned(i) == true) then
ReturnPet(i);
end
end
-- end -- also commenting out the "end" here because it is the closing statement for the health check that I commented out above
end -- adding this line to close the actionname check made above
end
function ScoutRogueSnipeMA(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local melee = GetActionUsable(8) -- # is your Shadowstab action bar
local WarnMe50 = ((PctH("player") <= .50) and (PctH("player") >= .26) and (WarningFrame:AddMessage("--- WARNING: Health is UNDER 50%! ---", 255, 255, 0)))
i=i+1; Skill[i] = { name = "Custom: Save Pet", use = combat and (PctH("player") <= .15) } -- this is the line that would allow you to use the new code shown above... if I am in a state of combat and my health is 15% or less, then use the "Save Pet" custom action code above.
i=i+1; Skill[i] = { name = "Action: 55 (HP pot)", use = (PctH("player") <= .60) }
i=i+1; Skill[i] = { name = "Action: 56 (HP pot)", use = (PctH("player") <= .60) }
i=i+1; Skill[i] = { name = "Action: 57 (HP pot)", use = (PctH("player") <= .60) }
i=i+1; Skill[i] = { name = "Action: 58 (HP pot)", use = (PctH("player") <= .60) }
i=i+1; Skill[i] = { name = "Action: 59 (HP pot)", use = (PctH("player") <= .60) }
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not ChkBuff("player","Frost Arrow")) }
i=i+1; Skill[i] = { name = "Arrow of Essence", use = (not ChkBuff("player","Arrow of Essence")) }
i=i+1; Skill[i] = { name = "Snipe", use = ((not friendly) and (not combat))}
i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (focus >= 70)) }
i=i+1; Skill[i] = { name = "Wind Arrows", use = ((not friendly) and (focus >= 75)) }
i=i+1; Skill[i] = { name = "Combo Shot", use = ((not friendly) and (focus >= 80)) }
i=i+1; Skill[i] = { name = "Wrist Attack", use = ((not friendly) and (melee)) }
i=i+1; Skill[i] = { name = "Joint Blow", use = ((not friendly) and (melee)) }
-- i=i+1; Skill[i] = { name = "Autoshot", use = ((not friendly) and (not ASon)) }
-- i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
-- i=i+1; Skill[i] = { name = "Piercing Arrow", use = (not friendly) }
-- i=i+1; Skill[i] = { name = "Repelling Arrow", use = ((not friendly) and (mana >= 250)) }
-- i=i+1; Skill[i] = { name = "Disarmament", use = (((not friendly) and (mana > 150)) and (not string.find(tbuffs,"Disarmament II"))) }
-- i=i+1; Skill[i] = { name = "Disarmament", use = ((not friendly) and (mana > 150)) }
-- i=i+1; Skill[i] = { name = "Snipe", use = ((not friendly) and (not combat)) }
-- i=i+1; Skill[i] = { name = "Sapping Arrow", use = (not friendly) }
-- i=i+1; Skill[i] = { name = "Snipe", use = (not friendly) }
-- i=i+1; Skill[i] = { name = "Repelling Arrow", use = ((not friendly) and (mana >= 250)) }
-- i=i+1; Skill[i] = { name = "Disarmament", use = (((not friendly) and (mana > 150)) and (not string.find(tbuffs,"Disarmament II"))) }
-- i=i+1; Skill[i] = { name = "Disarmament", use = ((not friendly) and (mana > 150)) }
MyCombat(Skill,arg1)
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function ScoutRogue(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local enemy = UnitCanAttack("player","target")
i=i+1; Skill[i] = { name = "Flèche de givre", use = (not ChkBuff("player","Flèche de givre")) }
i=i+1; Skill[i] = { name = "Flèche sangsues", use = enemy }
i=i+1; Skill[i] = { name = "Tir", use = enemy }
i=i+1; Skill[i] = { name = "Flèche du vent", use = (enemy and (focus >= 15)) }
MyCombat(Skill,arg1)
end
|
Quoted from "Drake1132;395962"
I'm not sure that DIYCE would work on a French client with English skill names, because the skill names used in DIYCE would not be the same as those used by the client.
|
|
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 |
-- REQUIRES _d303Fix Add-on for os.time() function
g_petBuffBeast = false;
g_petBuffBeastTime = 0;
function WardenWarrior(arg1, aoe, boss)
local Skill = {};
local i = 0;
local pMana = PctM("player");
local pRage = PctS("player");
local enemy = UnitCanAttack("player", "target");
local tDead = UnitIsDeadOrGhost("target");
local lockedOn = UnitExists("target");
i = i+1; Skill[i] = { name = "Will Attack", use = (enemy and (pRage <= .50)) }
i = i+1; Skill[i] = { name = "Charged Chop", use = (enemy and ChkBuff("player", "Solidified Will")) }
i = i+1; Skill[i] = { name = "Beast Chop", use = (enemy and (pRage >= .20) and ChkBuff("player", "Will of the Beast")) }
i = i+1; Skill[i] = { name = "Double Chop", use = (enemy and g_petBuffBeast and (pRage >= .25)) }
i = i+1; Skill[i] = { name = "Beast Chop", use = (enemy and (pRage >= .20)) }
i = i+1; Skill[i] = { name = "Power of the Wood Spirit", use = enemy }
MyCombat(Skill, arg1)
if UnitExists("playerpet") then
if not g_petBuffBeast and ChkBuff("playerpet","Beast") then
g_petBuffBeast = true;
g_petBuffBeastTime = os.time();
elseif g_petBuffBeast and ((g_petBuffBeastTime+20) <= os.time()) then
g_petBuffBeast = false;
end
end
end
|
Quoted from "ghostwolf82;396133"
@nmgara - If Beast Chop requires that you have the buff "Will of the Beast" on you, then the second Beast Chop will never fire, you can remove it.
Cheers!
Quoted
function ScoutPriest(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local tspell,ttime,telapsed = UnitCastingTime("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(9)
i=i+1; Skill = { ['name'] = "Throat Attack", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (focus >= 15)) }
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = (not ChkBuff("player","Frost Arrow")) }
i=i+1; Skill[i] = { ['name'] = "Autoshot", ['use'] = ((not friendly) and (not ASon)) }
i=i+1; Skill[i] = { ['name'] = "Combo Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Piercing Arrow", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Wind Arrows", ['use'] = ((not friendly) and (focus >= 15)) }
-- i=i+1; Skill[i] = { ['name'] = "Snipe", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
Quoted from "xromkc1;396217"
Hi again!
I need some help adding 3 functions to my existing ScoutPriest macro. I've tried to piece together the Throat Attack part myself, but I must be doing something wrong. The other two, I can't find info on anywhere.
Edit - I fixed Throat Attack. Working fine now!
1: Is there a way to have a skill (say an interrupt or a tanking cooldown) type in a channel. Say, if I'm tanking an instance and DIYCE uses Resolution or my scout interrupts a skill, to say in party "Resolution Used" or "Interrupted X ability", etc?
2: It's hard on big pulls to see if a mob I'm not already targeting is casting something. Is there a way to detect if an enemy in the pack is casting and switch to it and interrupt automatically?
3: A line to check debuffs on my group and cast Purifying Shot (S/P dispel).
4: A line to check if anyone in the group is below 50% mana and then use Mana Arrows on that player.
Here's what I'm using now;
Cheers!
|
|
Source code |
1 2 3 4 |
local ttimeremaining = 0
if (ttime ~= nil) then
ttimeremaining = ttime - telapsed
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 |
if CD(actionname) then
if talktome then Msg("- "..actionname) end
if (actionname == ("<skill to check against>" or "<other skill to check against>")) then -- you can add any number of skill/action names to check against here
<insert code to send message to chat> -- this is probably done with the AddMessage function that is built into the RoM API (see the List of Functions page on theromwiki.com)
end
CastSpellByName(actionname) -- cast the spell
return true
end
|
|
|
Source code |
1 |
i=i+1; Skill[i] = { ['name'] = "Mana Arrows", ['use'] = friendly and (((UnitManaType("target") == 1) and (PctM("target") <= 0.5)) or ((UnitSkillType("target") == 1) and (PctS("target") <= 0.5))) }
|
Quoted from "yannakm;396023"
Thanks, I switched back to ANSI.
I can't seems to make it work with accentuated characters, so for the spells that has them, I refer to slot number instead. It's not very practicle, but at least it works.
I know for sure that you need to use the proper language of spells depending of the language of the client.
Quoted from "Drake1132;396337"
With such a setup, you are merely letting people know that you are *attempting* to use the noted action... there is no check in place to see if you successfully use the action or not, and as far as I know there is no way to check.
![]()
Source code
1 <insert code to send message to chat> -- this is probably done with the AddMessage function that is built into the RoM API (see the List of Functions page on theromwiki.com)
|
|
Source code |
1 |
SendChatMessage("This is my message", "PARTY")
|
Quoted from "Drake1132;396337"
2. As far as I know, there is no way in the game to detect a particular creature as casting/using a spell/skill when you do not have them targeted, which means that in order to to check all creatures, you would have to cycle through them one at a time. You could theoretically write a function that would cycle through them and make such a check, but I suspect that the process would take longer than would be worthwhile.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
local tspell,ttime,telapsed
for j = 1,12 do
if (not UnitExists("focus"..j)) then
break
end
tspell, ttime, telapsed = UnitCastingTime("focus"..j)
if (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) >= 0.5) and CD("Throat Attack") then
TargetUnit("focus"..j)
CastSpellByName("Throat Attack")
return true
end
end
|
Quoted from "Drake1132;396337"
3. The biggest issue with this is that there are a large number of "harmful effects" with different effect names that you would need/want to check against, and this can make things a little prohibitive. My suggestion would be to cycle through each party member target and look for a particular debuff *icon* using the UnitDebuff() API. The reason I suggest doing it this way is that many debuffs use the same icon as one another, specifically, most curses use the same curse debuff icon, and most poisons use the same poison debuff icon, etc. Once you have that set up, you make it so that when you find a party member with the icon that you are looking for listed in their debuff list, then you could cast Purifying Shot on that target. You can look through the original DIYCE code for the BuffList() function to get an idea of how to iterate through the entire debuff list of a target.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
local function UnitIsSick(thisunit, matchType)
local cnt = 1
local debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)
while debuff ~= nil do
if (matchType == debuffType) then
return true
end
cnt = cnt + 1
debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)
end
return false
end
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
if CD("Purifying Shot") then
for j = 1,GetNumPartyMembers()-1 do
if UnitIsSick("party"..j, 10) then
TargetUnit("party"..j)
CastSpellByName("Purifying Shot")
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 |
function ChkBuffTime(tgt,buffname)
local cnt = 1
local buffcmd = UnitBuff
if UnitCanAttack("player",tgt) then
buffcmd = UnitDebuff
end
local buff = buffcmd(tgt,cnt)
while buff ~= nil do
if buff == buffname then
return GetPlayerBuffLeftTime(cnt-1)
end
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end
return 0
end
function MyBuffs()
local mybuffs = { "Grace of Life", "Amplified Attack", "Magic Barrier", "Battle Monk Stance", "Soul Bond" }
for i,buffname in pairs(mybuffs) do
Msg("Checking "..buffname)
Msg("Checking "..i)
if (ChkBuffTime("player",buffname) <= 120) then
Msg("Casting "..buffname)
CastSpellByName(buffname)
return
end
end
end
|
Quoted from "Sixpax;396450"
if CD("Purifying Shot") then
for j = 1,GetNumPartyMembers()-1 do
if UnitIsSick("party"..j, 10) then
TargetUnit("party"..j)
CastSpellByName("Purifying Shot")
return true
end
end
Quoted from "Drake1132;396337"
With such a setup, you are merely letting people know that you are *attempting* to use the noted action... there is no check in place to see if you successfully use the action or not, and as far as I know there is no way to check.
![]()
Source code
1 2 3 4 5 6 7 8if CD(actionname) then if talktome then Msg("- "..actionname) end if (actionname == ("<skill to check against>" or "<other skill to check against>")) then -- you can add any number of skill/action names to check against here <insert code to send message to chat> -- this is probably done with the AddMessage function that is built into the RoM API (see the List of Functions page on theromwiki.com) end CastSpellByName(actionname) -- cast the spell return true end
Bit of (more) help please!
|
|
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 ScoutPriestB(arg1)
local Skill = {}
local i = 0
local focus = UnitMana("player")
local friendly = (not UnitCanAttack("player","target"))
local tspell,ttime,telapsed = UnitCastingTime("target")
local a1,a2,a3,a4,a5,ASon = GetActionInfo(9)
local function UnitIsSick(thisunit, matchType)
local cnt = 1
local debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)
while debuff ~= nil do
if (matchType == debuffType) then
return true
end
cnt = cnt + 1
debuff,_2,_3,_4,debuffType = UnitDebuff(thisunit, cnt)
end
return false
end
-- DECURSE
if CD("Purifying Shot") then
for j = 1,GetNumPartyMembers()-1 do
if UnitIsSick("party"..j, 10) then
TargetUnit("party"..j)
CastSpellByName("Purifying Shot")
return true
end
end
end
-- SKILLS
i=i+1; Skill[i] = { ['name'] = "Neck Strike", ['use'] = ((not friendly) and (tspell ~= nil) and (ttime >= 1) and ((ttime - telapsed) > 0.5) and (focus >= 15)) }
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = (not ChkBuff("player","Frost Arrow")) }
i=i+1; Skill[i] = { ['name'] = "Autoshot", ['use'] = ((not friendly) and (not ASon)) }
i=i+1; Skill[i] = { ['name'] = "Combo Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Piercing Arrow", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Wind Arrows", ['use'] = ((not friendly) and (focus >= 15)) }
-- i=i+1; Skill[i] = { ['name'] = "Snipe", ['use'] = (not friendly) }
MyCombat(Skill,arg1)
end
|
|
|
Source code |
1 2 |
local boss = UnitSex("target") > 2
local elite = UnitSex("target") == 2
|
Quoted from "ghostwolf82;398912"
Ok, So I am having some thoughts, and am now messing with a scout, and wondering if anyone ever figured out a way to make arrows with a rune war bow?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
arrowTime = 0
function DoDIYCE(tableFunction, ammoName)
if ammoName ~= nil then
if GetCountInBagByName(ammoName) > 0 then
UseItemByName(ammoName)
return true
end
if GetInventoryItemDurable("player", 9) == 0
and GetTime() - arrowTime > 2 then
UseEquipmentItem(10)
arrowTime = GetTime()
return true
end
end
|
Quoted from "Xemnosyst;398970"
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15arrowTime = 0 function DoDIYCE(tableFunction, ammoName) if ammoName ~= nil then if GetCountInBagByName(ammoName) > 0 then UseItemByName(ammoName) return true end if GetInventoryItemDurable("player", 9) == 0 and GetTime() - arrowTime > 2 then UseEquipmentItem(10) arrowTime = GetTime() 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 |
--Ammo Check and Equip
if (ammo == false) then
local HaveAmmo = false
local arrows = ""
for i=1,60 do
local x,y,name = GetBagItemInfo(i)
if ((string.find(name, " Thorn")) or (string.find(name, " Arrow"))) then
HaveAmmo = true
arrows = name
end
end
if (HaveAmmo == true) then
i=i+1; Skill[i] = { name = "Item: "..arrows, use = (not ammo) } --Equip arrows if have
elseif ((g_cnt%100) == 0) then
i=i+1; Skill[i] = { name = "Action: 16 (Rune War Bow)", use = true }
--DEFAULT_CHAT_FRAME:AddMessage"I need to get Arrows!"
end
g_cnt = g_cnt + 1
end
|
Quoted from "ghostwolf82;399132"
Ok, how am I to call this within my function?
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
if GetCountInBagByName("<ammo name here>") > 0 then
UseItemByName("<ammo name here>")
return true
end
if GetInventoryItemDurable("player", 9) == 0
and GetTime() - arrowTime > 2 then
UseEquipmentItem(10)
arrowTime = GetTime()
return true
end
|