|
|
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 |
function KnightScout(arg1,arg2)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player","target"))
local shield = (GetEquipSlotInfo(17) ~= nil)
local combat = GetPlayerCombatState()
local mana = PctM("player")
local focus = UnitSkill("player")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
i=i+1; Skill[i] = { ['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'] = "Holy Seal", ['use'] = (not string.find(pbuffs,"Holy Seal")) }
i=i+1; Skill[i] = { ['name'] = "Enhanced Armor", ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
i=i+1; Skill[i] = { ['name'] = "Vampire Arrows", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
--i=i+1; Skill[i] = { ['name'] = "Charge", ['use'] = (not friendly) }
--i=i+1; Skill[i] = { ['name'] = "Hatred Strike", ['use'] = (not string.find(pbuffs,"Hatred Strike")) and (arg2 == "tank")) }
--i=i+1; Skill[i] = { ['name'] = "Threaten", ['use'] = (string.find(tbuffs,"Holy Seals 3") and (not string.find(pbuffs,"Threaten")) and (arg2 == "tank")) }
i=i+1; Skill[i] = { ['name'] = "Mana Return", ['use'] = (string.find(tbuffs,"Holy Seals 3") and (mana <= .75)) }
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) }
--i=i+1; Skill[i] = { ['name'] = "Whirlwind Shield", ['use'] = (shield and (not friendly) and (arg2 == "tank")) }
MyCombat(Skill,arg1)
end
function ScoutKnight(arg1)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local mana = PctM("player")
local focus = UnitSkill("player")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
if (not combat) then
i=i+1; Skill[i] = { ['name'] = "Frost Arrow", ['use'] = (not string.find(pbuffs,"Frost Arrow")) }
end
i=i+1; Skill[i] = { ['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'] = (string.find(tbuffs, "Vampire Arrows") and focus >= 20)}
i=i+1; Skill[i] = { ['name'] = "Shot", ['use'] = (not friendly) }
i=i+1; Skill[i] = { ['name'] = "Joint Blow", ['use'] = (string.find(tbuffs, "Joint Blow") and focus >= 15)}
--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 "Urtho;310371"
Ok, when i try to run my code for ScoutKnight(with a macro /run ScoutKnight() ) it does absolutely nothing.
I am not sure if i have something in there that is interefering with it or not, I have been looking around the forums, and this thread looking for info about it and not understanding much of it lol.
|
|
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 |
function ScoutKnight(arg1)
local Skill = {}
local i = 0
local friendly = (not UnitCanAttack("player","target"))
local combat = GetPlayerCombatState()
local mana = PctS("player")
local focus = UnitMana("player")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
if (not combat) then
i=i+1; Skill[i] = { name = "Frost Arrow", use = (not string.find(pbuffs,"Frost Arrow")) }
end
i=i+1; Skill[i] = { 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 = (string.find(tbuffs, "Vampire Arrows") and (focus >= 20)) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Joint Blow", use = (string.find(tbuffs, "Joint Blow") and (focus >= 15)) }
--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 "Pharoh93;309838"
As you can see I did not create this - So i am trying to look it over, supposedly this function works but when I put it in and I /run it nothing happens, no errors or hick-ups its just like I am pushing an empty macro button. Any pointers for this?
|
|
Source code |
1 |
/run RogueKnight("v1")
|
|
|
Source code |
1 |
/run RogueKnight("v2")
|
Quoted from "Pharoh93;310041"
Yeah I did install it, I already have a KnightRogue function/macro that I use all the time - it is just this RK that is giving me problems, and I don't know which part it is.
|
|
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 |
function WK(arg1,arg2)
local Skill = {}
local i = 0
local enemy = (UnitCanAttack("player","target") and (not UnitIsDeadOrGhost()))
local rage = UnitMana("player")
local mana = UnitSkill("player")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local health = PctH("player")
i=i+1; Skill[i] = { ['name'] = "Survival Instinct", ['use'] = (health <= .24) }
i=i+1; Skill[i] = { ['name'] = "Enhanced Armor", ['use'] = (not string.find(pbuffs,"Enhanced Armor")) }
i=i+1; Skill[i] = { ['name'] = "Blocking Stance", ['use'] = (not string.find(pbuffs,"Blocking Stance")) }
i=i+1; Skill[i] = { ['name'] = "Enraged", ['use'] = (enemy and (rage < 20)) }
i=i+1; Skill[i] = { ['name'] = "Thunder", ['use'] = (enemy and (rage >= 15) and string.find(tbuffs,"Weakened")) }
i=i+1; Skill[i] = { ['name'] = "Open Flank", ['use'] = (enemy and (rage >= 10) and string.find(tbuffs,"Vulnerable")) }
i=i+1; Skill[i] = { ['name'] = "Punishment", ['use'] = (enemy and string.find(tbuffs,"Light Seal III")) }
i=i+1; Skill[i] = { ['name'] = "Slash", ['use'] = (enemy and (rage >= 30) and (not string.find(tbuffs,"Bleed"))) }
i=i+1; Skill[i] = { ['name'] = "Probing Attack", ['use'] = (enemy and (rage >= 20) and (not string.find(tbuffs,"Vulnerable"))) }
i=i+1; Skill[i] = { ['name'] = "Holy Strike", ['use'] = (enemy) }
MyCombat(Skill,arg1)
end
|
Quoted from "SNeekey;310856"
First I can't figure out how to incorporate item set skills, i've been looking but no luck so far....
|
|
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 WarriorScout(arg1)
local i=0
local Skill={}
local pHe = PctH("player")
local rage = UnitMana("player")
local focus = UnitSkill("player")
local tBl = BuffTimeLeft("target","Bleed")
local tSB = BuffTimeLeft("target","Skull Broken")
if ((UnitCanAttack("player","target")) and (not UnitIsDeadOrGhost("target"))) then
i=i+1;Skill[i]={name="Action:50",use=(pHe < 25)}-------------------------------------Survival Instinct
i=i+1;Skill[i]={name="Action:23",use=((focus > 50) and (tSB < 1))}-------------------Skull Bash
i=i+1;Skill[i]={name="Action:25",use=((focus > 50) and (tSB > 1))}-------------------Stun Shot
i=i+1;Skill[i]={name="Action:22",use=((rage > 25) and (tBl > 0))}--------------------Tactical Strike
i=i+1;Skill[i]={name="Action:21",use=(rage > 50)}------------------------------------Slash
i=i+1;Skill[i]={name="Action:28",use=true}-------------------------------------------Shot
i=i+1;Skill[i]={name="Action:31",use=(rage < 50)}------------------------------------Enrageed
i=i+1;Skill[i]={name="Action:33",use=((focus > 50) and (rage < 50) and (tSB > 3 ))}--Sword of Breath
i=i+1;Skill[i]={name="Action:32",use=((focus > 50) and (rage < 50) and (tSB > 3 ))}--Aim for the Wound
i=i+1;Skill[i]={name="Action:29",use=(focus == 100)}---------------------------------Vampire Arrows
i=i+1;Skill[i]={name="Action:30",use=true}-------------------------------------------Attack
end
MyCombat(Skill,arg1)
end
|
Quoted from "blurterblurter;311179"
not sure why im getting:
Interface/Addons/MyFunctions\Functions.lua [string '?']:5 ')' expected (to close '(' at line 4) near 'local'
|
|
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
function DebuffList(tgt)
local cnt = 1
local buffcmd = UnitDebuff
local buffstr = "/"
if UnitCanAttack("player",tgt) then
buffcmd = UnitBuff
end
local buff = buffcmd(tgt,cnt)
while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end
return string.gsub(buffstr, "(%()(.*)(%))", "%2")
end
function wait(seconds)
local start = os.time()
repeat until os.time() > start + seconds
end
function RogueKnight(arg1, arg2)
local Skill = {}
local i = 0
--Player Data
local health = PctH("player")
local energy = UnitMana("player")
local mana = PctS("player")
local pbuffs = BuffList("player")
local dbuffs = DebuffList("player")
local poisoned = string.find(dbuffs,"Poison")
local afraid = string.find(dbuffs,"Fear")
local horrified = string.find(dbuffs,"Horror")
local lion = string.find(pbuffs,"Lion's Protection")
--Combat State
local combat = GetPlayerCombatState()
--Target Data
local enemy = UnitCanAttack("player","target")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
local tDead = UnitIsDeadOrGhost()
local tBleed = string.find(tbuffs,"Bleed" or "Blind Spot Bleed" or "Sneak Attack Bleed")
local tWound = string.find(tbuffs,"Grievous Wound")
local tDisarmed = string.find(tbuffs,"Disarmament IV")
--Interrupt List
local ilist = "/Crimson Whirl/Counter/Fireball/Thunderstorm/Spell of Doom/Flame"
--Equipment and Pet Protection
if (health <= .15) then
SwapEquipmentItem()
for i=1,3 do
if (IsPetSummoned(i) == true) then
ReturnPet(i);
end
end
end
--Vanish
i=i+1; Skill[i] = { name = "Vanish", use = ((health < .25) and (UnitDebuff("player",1) == nil)) }
if string.find(pbuffs,"Enhanced Armor") then Wait(5)
end
--Interrupt
--i=i+1; Skill[i] = { name = "Shadow Prison", use = (enemy and (tspell ~= nil) and string.find(ilist,tspell) and (arg2=="interrupt")) }
--Cures
i=i+1; Skill[i] = { name = "Poison Protection", use = (poisoned) }
--i=i+1; Skill[i] = { name = "Courageous Guard", use = (afraid or horrified) }
--Premed
i=i+1; Skill[i] = { name = "Premeditation", use = ((not combat) and (not string.find(pbuffs,"Premeditation"))) }
--Healing
--i=i+1; Skill[i] = { name = "Power of the Lion", use = (lion and (health < .80)) }
i=i+1; Skill[i] = { name = "Action: 40(HP Pot)", use = (health < .40) }
--Common Buffs
i=i+1; Skill[i] = { name = "Enhanced Armor", use = ((not string.find(pbuffs,"Enhanced Armor")) and (mana > .05)) }
i=i+1; Skill[i] = { name = "Lion's Protection", use = ((not lion) and (mana > .05)) }
i=i+1; Skill[i] = { name = "Poison", use = ((not combat) and (not string.find(pbuffs,"Poisonous"))) }
--i=i+1; Skill[i] = { name = "Searing Light", use = ((not string.find(pbuffs,"Searing Light")) and (mana > .1)) }
--i=i+1; Skill[i] = { name = "Evasion", use = (combat and (health <= .9)) }
--Rare Buffs
if ((arg2 == "boss") and combat) then
--i=i+1; Skill[i] = { name = "Informer", use = (not string.find(pbuffs,"Informer")) }
i=i+1; Skill[i] = { name = "Assassins Rage", use = (true) }
end
--Attacks from behind
if ((arg2 == "behind") and enemy) then
i=i+1; Skill[i] = { name = "Sneak Attack", use = ((not combat) and (energy >= 30)) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((energy >= 25) and (not (string.find(tbuffs,"Blind Spot Bleed")))) }
end
--Main Attacks
if enemy then
i=i+1; Skill[i] = { name = "Wound Attack", use = ((energy >= 35) and tBleed and tWound) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((energy >= 30) and tBleed and (not tWound)) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 20) and (not tBleed)) }
i=i+1; Skill[i] = { name = "Disarmament", use = (((not tDisarmed) or (BuffTimeLeft("target","Disarmament") <= 2))) }
end
--Normal Attack or Loot
i=i+1; Skill[i] = { name = "Attack", use = (enemy or tDead) }
MyCombat(Skill,arg1)
end
|
Quoted from "Pharoh93;311375"
So far this is the beast that has come about due to a lot of attempts to code - I have been running into a few problems with this code when I get to low HP - When Vanish is cast the mobs do not reset right away and they hang up for a second in front of you - If you click the macro again then you are taken out of vanish and you have promptly defeated the purpose of using vanish.
I have tried Various Wait() functions I have found while google'ing and it seems that the wait command does not pause the macro but instead it freezes my game - For the exact amount of time put in the macro, then resumes and continues on its way...
The code I have tried with the most success is in the
--Vanish
Section of the code, At the moment it checks for the buff Enhanced Armor because i didn't want to test this macro with a 10 minute timer that also requires me to be in combat. Could that be the problem?
|
|
Source code |
1 |
local wait = 0 |
|
|
Source code |
1 2 3 |
function CEwait(seconds) wait = os.time() + seconds -- current time + wait time end |
|
|
Source code |
1 2 3 |
if(os.time() < wait)then
return -- If we're still in wait cycle, skip running and let the game continue
end
|
|
|
Source code |
1 2 3 4 |
if string.find(pbuffs,"Enhanced Armor") then
CEwait(5)
return -- Skip function and start wait cycle
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
local wait = 0
function DebuffList(tgt)
local cnt = 1
local buffcmd = UnitDebuff
local buffstr = "/"
if UnitCanAttack("player",tgt) then
buffcmd = UnitBuff
end
local buff = buffcmd(tgt,cnt)
while buff ~= nil do
buffstr = buffstr..buff.."/"
cnt = cnt + 1
buff = buffcmd(tgt,cnt)
end
return string.gsub(buffstr, "(%()(.*)(%))", "%2")
end
function CEwait(seconds)
wait = os.time() + seconds -- current time + wait time
end
function RogueKnight(arg1, arg2)
if(os.time() < wait)then
return -- If we're still in wait cycle, skip running and let the game continue
end
local Skill = {}
local i = 0
--Player Data
local health = PctH("player")
local energy = UnitMana("player")
local mana = PctS("player")
local pbuffs = BuffList("player")
local dbuffs = DebuffList("player")
local poisoned = string.find(dbuffs,"Poison")
local afraid = string.find(dbuffs,"Fear")
local horrified = string.find(dbuffs,"Horror")
local lion = string.find(pbuffs,"Lion's Protection")
--Combat State
local combat = GetPlayerCombatState()
--Target Data
local enemy = UnitCanAttack("player","target")
local tbuffs = BuffList("target")
local tspell,ttime,telapsed = UnitCastingTime("target")
local tDead = UnitIsDeadOrGhost()
local tBleed = string.find(tbuffs,"Bleed" or "Blind Spot Bleed" or "Sneak Attack Bleed")
local tWound = string.find(tbuffs,"Grievous Wound")
local tDisarmed = string.find(tbuffs,"Disarmament IV")
--Interrupt List
local ilist = "/Crimson Whirl/Counter/Fireball/Thunderstorm/Spell of Doom/Flame"
--Equipment and Pet Protection
if (health <= .15) then
SwapEquipmentItem()
for i=1,3 do
if (IsPetSummoned(i) == true) then
ReturnPet(i);
end
end
end
--Vanish
i=i+1; Skill[i] = { name = "Vanish", use = ((health < .25) and (UnitDebuff("player",1) == nil)) }
if string.find(pbuffs,"Enhanced Armor") then
CEwait(5)
return -- Skip function and start wait cycle
end
--Interrupt
--i=i+1; Skill[i] = { name = "Shadow Prison", use = (enemy and (tspell ~= nil) and string.find(ilist,tspell) and (arg2=="interrupt")) }
--Cures
i=i+1; Skill[i] = { name = "Poison Protection", use = (poisoned) }
--i=i+1; Skill[i] = { name = "Courageous Guard", use = (afraid or horrified) }
--Premed
i=i+1; Skill[i] = { name = "Premeditation", use = ((not combat) and (not string.find(pbuffs,"Premeditation"))) }
--Healing
--i=i+1; Skill[i] = { name = "Power of the Lion", use = (lion and (health < .80)) }
i=i+1; Skill[i] = { name = "Action: 40(HP Pot)", use = (health < .40) }
--Common Buffs
i=i+1; Skill[i] = { name = "Enhanced Armor", use = ((not string.find(pbuffs,"Enhanced Armor")) and (mana > .05)) }
i=i+1; Skill[i] = { name = "Lion's Protection", use = ((not lion) and (mana > .05)) }
i=i+1; Skill[i] = { name = "Poison", use = ((not combat) and (not string.find(pbuffs,"Poisonous"))) }
--i=i+1; Skill[i] = { name = "Searing Light", use = ((not string.find(pbuffs,"Searing Light")) and (mana > .1)) }
--i=i+1; Skill[i] = { name = "Evasion", use = (combat and (health <= .9)) }
--Rare Buffs
if ((arg2 == "boss") and combat) then
--i=i+1; Skill[i] = { name = "Informer", use = (not string.find(pbuffs,"Informer")) }
i=i+1; Skill[i] = { name = "Assassins Rage", use = (true) }
end
--Attacks from behind
if ((arg2 == "behind") and enemy) then
i=i+1; Skill[i] = { name = "Sneak Attack", use = ((not combat) and (energy >= 30)) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((energy >= 25) and (not (string.find(tbuffs,"Blind Spot Bleed")))) }
end
--Main Attacks
if enemy then
i=i+1; Skill[i] = { name = "Wound Attack", use = ((energy >= 35) and tBleed and tWound) }
i=i+1; Skill[i] = { name = "Low Blow", use = ((energy >= 30) and tBleed and (not tWound)) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((energy >= 20) and (not tBleed)) }
i=i+1; Skill[i] = { name = "Disarmament", use = (((not tDisarmed) or (BuffTimeLeft("target","Disarmament") <= 2))) }
end
--Normal Attack or Loot
i=i+1; Skill[i] = { name = "Attack", use = (enemy or tDead) }
MyCombat(Skill,arg1)
end
|
Quoted from "Pharoh93;311592"
Thank you very much for the thorough explaination, the reason I left it as "enhanced armor" is because I was messing with my code trying to get it to work and Vanish is on a 10 minute timer so i needed a buff for the wait function to check to that was more readily available.![]()
Quoted from "dassimo;311856"
Hi everyone.
I'm a newbie at RoM and rather "older" than a teenager. Okay so I'm old.
I'm going to roll a Priest to level 10 and then choose a Knight secondary class. I will probably then switch and use Knight as my primary class. I think this combo is as fast/solid as my reflexes can manage.
Now I've read a lot of this thread and it has me straining to understand what I need to do to create an engine.
As such and I do ask humbly, would someone who is talented in this area please provide a macro I can use on the Priest as primary and then a macro for the Knight / Priest from level 10 onwards.
I would very much appreciate this and I'm sure others in the same "code illiterate" mentality as me can also use.
Thanks very much.
Quoted from "Pharoh93;311375"
So far this is the beast that has come about due to a lot of attempts to code - I have been running into a few problems with this code when I get to low HP - When Vanish is cast the mobs do not reset right away and they hang up for a second in front of you - If you click the macro again then you are taken out of vanish and you have promptly defeated the purpose of using vanish.
Quoted from "dassimo;311856"
Hi everyone.
I'm a newbie at RoM and rather "older" than a teenager. Okay so I'm old.
I'm going to roll a Priest to level 10 and then choose a Knight secondary class. I will probably then switch and use Knight as my primary class. I think this combo is as fast/solid as my reflexes can manage.
Now I've read a lot of this thread and it has me straining to understand what I need to do to create an engine.
As such and I do ask humbly, would someone who is talented in this area please provide a macro I can use on the Priest as primary and then a macro for the Knight / Priest from level 10 onwards.
I would very much appreciate this and I'm sure others in the same "code illiterate" mentality as me can also use.
Thanks very much.
Quoted from "redcrux;312078"
i dont mean to sound like a douch or anything but this addon is quite code intensive, and even if you use a premade code, you will need to tweak it to your own preferences and tweak it for each situation. so if you dont have the skills or reflexes to play normaly and dont have the ability to learn a bit of coding then you probably wont have much success in this game. gotta have one or the other unfortunately![]()