Quoted from "lokanu;304882"
Range is too difficult to test accurately; you're better off not attempting it. The only method is to put a dummy skill on your hotbar and check if it's available or not (Icon is red or not). However, the icon can be red for other reasons then simply being out of range, thus not a good method.
Quoted from "shawnis;304911"
Only problem is that I don't want it to use those skills first if I am < 49 to my target and since you can use those skills at any range, it will fire them off first regardless unless there's a check that says if target is > 50 or something, it will attempt to use them first, thus negating my sneak attack and putting me in combat.
Quoted from "lokanu;304917"
You're better off making another DIYCE function and putting it on another hotkey just for the sake of using when you know you're close enough. There just isn't any method to guarantee range checking atm.
Quoted from "shawnis;304938"
Hey one more question, I'm pretty new to LUA, so; Will I need a function to check if the spell is usable? Since it has a CD (Shadow Prison), I am thinking logically it may just keep trying to cast it even though it's on CD and not move down the line unless I tell it to move on if it's not usable (few other spells that have CD's I want to add to this as well if conditions are met. Is there a function to check to make sure the spell is off of it's cooldown?
|
|
Source code |
1 |
i=i+1; Skill[i] = { ['name'] = "Shadow Prison", ['use'] = ((not friendly) and (CD("Shadow Prison")) and (not string.find(tbuffs, "Shadow Prison")))
|
Quoted from "shawnis;304938"
Hey one more question, I'm pretty new to LUA, so; Will I need a function to check if the spell is usable? Since it has a CD (Shadow Prison), I am thinking logically it may just keep trying to cast it even though it's on CD and not move down the line unless I tell it to move on if it's not usable (few other spells that have CD's I want to add to this as well if conditions are met. Is there a function to check to make sure the spell is off of it's cooldown?
Quoted from "lokanu;304947"
This also requires you to set "tbuffs" prior.
|
|
Source code |
1 |
i=i+1; Skill[i] = { name = "Shadow Prison", use = ((not friendly) and (CD("Shadow Prison")) and (UnitIsPlayer("target") and UnitCanAttack("player","target") and (energy >=50)) and (not string.find(tbuffs, "Shadow Prison")))
|
Quoted from "mrmarc0001;304967"
Read the original post and parts of this thread and/or refer to my guide.

|
|
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 |
function RogueScout(arg1, arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
i=i+1; Skill[i] = { name = "Throat Attack", use = ((not friendly) and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) > 0.3) and (focus >= 15)) }
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 = "Sneak Attack", use = ((not friendly) and (energy >= 30) and (arg2 == "behind") and (not combat)) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and (energy >= 25) and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Shadow Prison", use = ((not friendly) and (CD("Shadow Prison")) and (not string.find(tbuffs, "Shadow Prison")))
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Energy Thief", use = (energy <= 30)) }
i=i+1; Skill[i] = { name = "Wound Attack", use = ((not friendly) and (energy >= 38) 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 = "Vampire Arrows", use = (not friendly) }
MyCombat(Skill,arg1)
end
|
|
|
Source code |
1 |
tbuffs = BuffList("target")
|
Quoted from "shawnis;305091"
Well, here is what I created, bad part is that when I try to use it in game, nothing happens at all. Anyone mind giving me a few pointers on what I did wrong, maybe helping me correct it?

|
|
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 RogueScout(arg1, arg2)
local Skill = {}
local i = 0
local energy = UnitMana("player")
local focus = UnitSkill("player")
local friendly = (not UnitCanAttack("player", "target"))
local combat = GetPlayerCombatState()
local tspell,ttime,telapsed = UnitCastingTime("target")
local pbuffs = BuffList("player")
local tbuffs = BuffList("target")
local melee = GetActionUsable(#) -- # is your Shadowstab action bar slot number
i=i+1; Skill[i] = { name = "Throat Attack", use = ((not friendly) and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15)) }
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 = "Vampire Arrows", use = ((not friendly) and (not melee)) }
i=i+1; Skill[i] = { name = "Shot", use = ((not friendly) and (not melee)) }
i=i+1; Skill[i] = { name = "Sneak Attack", use = ((not friendly) and melee and (energy >= 30) and (arg2 == "behind") and (not combat)) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind") and (not string.find(tbuffs, "Bleed"))) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and melee and (energy >= 35) and (not string.find(tbuffs, "Bleed"))) }
i=i+1; Skill[i] = { name = "Shadow Prison", use = ((not friendly) and (energy >= 50) and UnitIsPlayer("target") and (not string.find(tbuffs, "Shadow Prison"))) }
i=i+1; Skill[i] = { name = "Shot", use = (not friendly) }
i=i+1; Skill[i] = { name = "Energy Thief", use = (energy <= 30) }
i=i+1; Skill[i] = { name = "Wound Attack", use = ((not friendly) and melee 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 melee and (energy >= 35) and string.find(tbuffs, "Bleed")) }
i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind")) }
i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and melee and (energy >= 35)) }
i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) }
MyCombat(Skill,arg1)
end
|
Quoted from "Sixpax;305184"
Looks like you have some unbalanced parentheses/brackets on the Shadow Prison line and the Energy Thief line... that'll get ya every time
In response to your previous questions:
1) You don't need to do the CD() check as that is built in to the code, so you can take that off of the Shadow Prison line.
2) A "cheap" way to do the range check you're looking for is evaluating whether GetActionUsable() is true or not for a melee range skill. Although that will return false for other reason (like insufficient energy), but in your case that should do the trick.
Give this one a try. I think I covered all of your requirements (including the PvP check), plus some extras that you might like. Be sure to replace the #-sign with your Shadowstab action bar slot number.
![]()
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 31function RogueScout(arg1, arg2) local Skill = {} local i = 0 local energy = UnitMana("player") local focus = UnitSkill("player") local friendly = (not UnitCanAttack("player", "target")) local combat = GetPlayerCombatState() local tspell,ttime,telapsed = UnitCastingTime("target") local pbuffs = BuffList("player") local tbuffs = BuffList("target") local melee = GetActionUsable(#) -- # is your Shadowstab action bar slot number i=i+1; Skill[i] = { name = "Throat Attack", use = ((not friendly) and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15)) } 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 = "Vampire Arrows", use = ((not friendly) and (not melee)) } i=i+1; Skill[i] = { name = "Shot", use = ((not friendly) and (not melee)) } i=i+1; Skill[i] = { name = "Sneak Attack", use = ((not friendly) and melee and (energy >= 30) and (arg2 == "behind") and (not combat)) } i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind") and (not string.find(tbuffs, "Bleed"))) } i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and melee and (energy >= 35) and (not string.find(tbuffs, "Bleed"))) } i=i+1; Skill[i] = { name = "Shadow Prison", use = ((not friendly) and (energy >= 50) and UnitIsPlayer("target") and (not string.find(tbuffs, "Shadow Prison"))) } i=i+1; Skill[i] = { name = "Shot", use = (not friendly) } i=i+1; Skill[i] = { name = "Energy Thief", use = (energy <= 30) } i=i+1; Skill[i] = { name = "Wound Attack", use = ((not friendly) and melee 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 melee and (energy >= 35) and string.find(tbuffs, "Bleed")) } i=i+1; Skill[i] = { name = "Blind Spot", use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind")) } i=i+1; Skill[i] = { name = "Shadowstab", use = ((not friendly) and melee and (energy >= 35)) } i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) } MyCombat(Skill,arg1) end
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function WarriorScout(arg1)
local i=0
local Skill={}
local rage = UnitMana("player")
local focus = UnitSkill("player")
local bleed = BuffTimeLeft("target","Bleed")
local skull = BuffTimeLeft("target","Skull Broken")
local vamp = BuffTimeLeft("target","Vampire Arrows")
if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then
i=i+1;Skill[i]={name="Action:22",use=((focus>30) and (skull < 1))}--Skull Bash
i=i+1;Skill[i]={name="Action:21",use=true}--Shot
i=i+1;Skill[i]={name="Action:23",use=((rage < 25) and (bleed > 0))}--Tactical Strike
i=i+1;Skill[i]={name="Action:24",use=((rage>50) and (bleed < 8))}--Slash
i=i+1;Skill[i]={name="Action:25",use=((focus < 50) and (vamp < 1))}--Vampire Arrows
i=i+1;Skill[i]={name="Action:30",use=true}--Attack
end
MyCombat(Skill,arg1)
end
|
Quoted from "venomous42;305357"
could a warrior/scout with a good working macro, post the macro/macro's they use? i went though all 80+ pages here, and there is only one macro posted, and it doesnt work to well.
i just switched to w/r from w/s, so i dont have my 40 elites, but i can delete it from the macro. thanks for any replies.
Quoted from "blurterblurter;305420"
![]()
Source code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18function WarriorScout(arg1) local i=0 local Skill={} local rage = UnitMana("player") local focus = UnitSkill("player") local bleed = BuffTimeLeft("target","Bleed") local skull = BuffTimeLeft("target","Skull Broken") local vamp = BuffTimeLeft("target","Vampire Arrows") if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then i=i+1;Skill[i]={name="Action:22",use=((focus>30) and (skull < 1))}--Skull Bash i=i+1;Skill[i]={name="Action:21",use=true}--Shot i=i+1;Skill[i]={name="Action:23",use=((rage < 25) and (bleed > 0))}--Tactical Strike i=i+1;Skill[i]={name="Action:24",use=((rage>50) and (bleed < 8))}--Slash i=i+1;Skill[i]={name="Action:25",use=((focus < 50) and (vamp < 1))}--Vampire Arrows i=i+1;Skill[i]={name="Action:30",use=true}--Attack end MyCombat(Skill,arg1) end
|
|
Source code |
1 |
if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then
|
|
|
Source code |
1 |
if (UnitCanAttack("player","target") and (not UnitIsDeadOrGhost("target"))) then
|