Any idea about how to make it work?
Any idea about how to make it work?
The best thing I found wasdistIndexCode:inRange = CheckInteractDistance("unit", distIndex)
Number - A value from 1 to 4:
1 = Inspect, 28 yards
2 = Trade, 11.11 yards
3 = Duel, 9.9 yards
4 = Follow, 28 yards
Would be nice to have a custom yard check, instead of only those 4. Maybe theres a command that I'm missing who knows!
i know this, but need more closer range check for caster. 0-5 yards will be good. anyway thanks
For 0-5 yards. simply check to see if melee attack is in range. Melee attack range is precisely 5 yards. Use API IsSpellInRange. Another API to approximate distance is CheckInteractDistance.
For more range check indicators, use known spells to check distance.
Not working, I already tried time ago but I tested again just to be sure:
Tried replacing "Auto Attack" with any other spell and it worked perfectly. Maybe Auto Attack is not considered a spell? I don't know.Code:if IsSpellInRange("Auto Attack","target") == 1 then print("Im in melee range") else print("Im out of range") end
About the "CheckInteractDistance" I already replied: it works but it's limitated to 4 fixed yards, and if you are caster you don't need it at all, since all caster's abilities are ranged.and u can simply use the IsSpellInRange.
Also: I found this macro:
You press it and every cast/spell you do, it prints on the chat the name of the spell and its ID.Code:/run local f=CreateFrame("Frame","f") f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") f:SetScript("OnEvent", function(self, event, ...) local a,b=select(9, ...) if(b) then c=format("%.4X",a) ChatFrame1:AddMessage(b.."--"..a.."--"..c) end end)
For example you will read "Drain Life - 47857" when u cast Drain Life.
I tried both autoattacking with right click of mouse, and clicking the "Auto Attack" spell from the spellbook, and the macro prints only numbers, not "Auto Attack - 123456", it prints like, for example, "124 - 873".
So I said ok "123" is the name of Auto Attack and "873" is the ID. Well, the "weird" part is everytime you melee swing, both "name" and "id" change. You can test it yourself you can spam drain life 50 times it will always print out "Drain Life - 47857", but autoattack will change everytime.
Now I don't know why this happens but this was my last resource to get the melee range as caster.
I was thinking also about the "IsItemInRange" with some in-game object that requires melee. My question is... what item could it be? And if we found one, will the function work even if we don't have the item in bag?
The answer is here: [Request] WA for Distance to Target
nice macro to find spellID, xD
for the iteminrange yes u need item in baG to work.
how to use libRangeCheck-2.0 ?
Last edited by bynike; 11-22-2016 at 08:13 PM.
since this post is tagged PQR, Why not try PQR_UnitDistance("Player","Target") <= 5
PQR_UnitDistance not for PQR111.