|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
function RogueKnight(arg1)
local Skill = {}
local i = 0
local enermy = UnitCanAttack("player", "target")
local energy = UnitMana("player")
local mana = UnitSkill("player")
local tbuffs = BuffList("target")
i=i+1;Skill[i]={name="Action:24(Dis)",use=((enermy) and (BuffTimeLeft("target", "Disarmament") < 6) and (not string.find(tbuffs,"Disarmament IV"))) }
i=i+1;Skill[i]={name="Action:23(WA)", use=((enermy) and (string.find(tbuffs,"Grievous Wound"))) }
i=i+1;Skill[i]={name="Action:22(LB)", use=((enermy) and (string.find(tbuffs,"Bleed"))) }
i=i+1;Skill[i]={name="Action:21(SS)", use=((enermy) and (energy > 85)) }
i=i+1;Skill[i]={name="Action:30(Atk)",use=((enermy)) }
MyCombat(Skill,arg1)
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 |
function RogueMage15(arg1)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local mana = UnitSkill("player")
local friendly = (not UnitCanAttack("player","target"))
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local combat = GetPlayerCombatState()
local level = UnitLevel("target") - UnitLevel("player")
--Change the 9 to whatever number you have Shadowstab on the action bar
local melee = GetActionUsable(9)
local tdead = UnitIsDeadOrGhost("target")
--Autoloot
i=i+1; Skill[i] = { ['name'] = "Attack", ['use'] = (tdead) }
--Buff if +1 levels
i=i+1; Skill[i] = { ['name'] = "Assassins Rage", ['use'] = ((not string.find(pbuffs,"Assassins Rage")) and (level >=1)) }
--Use pots if needed
i=i+1; Skill[i] = { ['name'] = "Action: 21(HP Pot)", ['use'] = ((PctH("player") < .3) and combat) }
i=i+1; Skill[i] = { ['name'] = "Action: 22(MP Pot)", ['use'] = ((PctM("player") < .2) and (PctH("player") > .6)) }
i=i+1; Skill[i] = { ['name'] = "Action: 22(MP Pot)", ['use'] = ((PctM("player") < .5) and (not combat)) }
--Opener
i=i+1; Skill[i] = { ['name'] = "Fireball", ['use'] = ((not friendly) and (mana >=60)) }
i=i+1; Skill[i] = { ['name'] = "Lightning", ['use'] = ((not friendly) and (not melee) and (not string.find(tbuffs,"Lightning"))) }
--Check range (Stops running to target and allows time for 2nd fireball)
if melee then
--This may cause a problem if your behind them (Suggestion? Without passing arg2.)
i=i+1; Skill[i] = { ['name'] = "Blind Stab", ['use'] = ((not friendly) and (energy >=20)) }
--Melee combat sequence (Backwards for logic)
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 >=30) and (string.find(tbuffs,"Bleed")) and (not string.find(tbuffs,"Grievous Wound"))) }
i=i+1; Skill[i] = { ['name'] = "Shadowstab", ['use'] = ((not friendly) and (energy >=20) and (not string.find(tbuffs,"Bleed"))) }
end
MyCombat(Skill,arg1)
end
|

|
|
Source code |
1 |
SendChatMessage("My health is " .. UnitHealth("player"),"SAY")
|
Quoted from "Vaeliorin;286110"
Anyone know if there's a function that returns actual raw HP numbers? I wanted to make my mage only cast Fireball when the enemy was below a certain HP number (basically just to finish mobs off.)
Quoted from "nemecis;285931"
nvm ... added % to the buff check only and it worked. tnks again!
Quoted from "Provoke;286290"
I was wondering if there is a way of incorporating the Rogue/Warrior weapon switch into a macro?
I saw Sixpax posted a macro in another thread, but I'm not sure how that would work in the DIYCE...
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
local enemy = UnitCanAttack("player", "target")
local energy = UnitMana("player")
local mainhandname = GetInventoryItemDurable("player", 15)
local useDagger
if mainhandname ~= "DAGGERNAMEHERE" then
PickupEquipmentItem(16)
PickupEquipmentItem(15)
else
useDagger = true
end
i=i+1; Skill[i] = { name = "Shadowstab", use = (enemy and (useDagger) and (energy >= 20) and (not string.find(tbuffs, "Bleed"))) }
|
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Action: 9 (Switch to Dagger)", use = (enemy) }
|
Quoted from "Provoke;286290"
I was wondering if there is a way of incorporating the Rogue/Warrior weapon switch into a macro?
I saw Sixpax posted a macro in another thread, but I'm not sure how that would work in the DIYCE...
Quoted from "mrmarc0001;286320"
You would have those macros on your skillbar and call them like you would a Potion or Food Item...
Quoted from "Sixpax;286336"
That code has always been scary to me because it has to move the weapon to your pointer to do the swap, and what happens if there's an error or you get disconnected right when the weapon swap is happening? Is there a chance you'll lose your weapon?
I can't really incorporate that into the engine because I believe there needs to be a slight delay between the weapon swap and the Shadowstab cast, and then another when swapping back. The only way to do delays is with the /wait command in a macro.
Quoted from "Sixpax;286222"
For whatever reason they keep changing the output of that function and one other (see below). It used to be that UnitHealth() would return the actual health number. Then they added UnitChangeHealth() and modified UnitHealth() to return a whole % value, but it only applied to mobs, not players. So you still used UnitHealth() for actual player health and UnitChangeHealth() for actual mob health. Now I noticed that theromwiki.com has been updated and describes UnitChangeHealth() as a health change since the last "tick" (2 sec interval).
So basically, I have no idea anymore. Try using UnitChangeHealth("target") and see what value you get back.
Quoted from "Vaeliorin;286724"
I tried it. It seems to work as intended (giving you the change since the last time it ran, apparently), although when I did UnitChangeHealth("player") it first returned 5, then my max health, even though I'd been at max health both times I tried it.
I just decided to set it a < 10% at the moment, and I'll just have to update it as monsters get more health.
Quoted from "Tigsman;286781"
yes, if you were able to view the mob before fight starts so it knows what its starting health was.
T
Quoted from "stayfrosty02;286813"
Again thanks Six, tiggs and everyone who has contributed to this post. I was wanting to see if there was a way to add a message to party chat when I used blood arrow so the healers didn't freak out. I guess it could be party chat or /s but could it be incorporated into my lua file instead of a macro on the action bar? ANy help would be appreciated
thx
|
|
Source code |
1 2 3 |
if (UnitCastingTime("player") == "Blood Arrow") and (GetNumPartyMembers() > 1) then
SendChatMessage("Using Blood Arrow", "PARTY")
end
|
Quoted from "Sixpax;286339"
Unfortunately that won't work because the function I'm using with "Action:" definitions (UseAction) can't call a macro.
