OK, I know that RoM disabled the Distance to Target bit of code a long time ago but I was wondering if it is possible to re-enable that like some people did with other bits. I am not looking for anything illeagal just curious about that part.
If not, than I think it would be possible using GetActionUsable. If there was a list of skills that had different ranges (it could be specific hotbar slots or manually filled in like DIYCE) it could display the approximate range once that skill lights up. For example, I have a skill that has a range of 250 a "250" would show up over the target's head (or something like that). Once the next skill lights up at 200 the same thing would happen. The catch is that the check needs to be on a timer so that the GetActionUsable check is automatic if the player has a target. It wouldn't be 100% precise but would give a good general distance.
I guess the basic idea would be something like
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
local LockedOn = UnitExists("target")
local updateTime = 0 -- How long since we last did an update
local updateIntervall = 0.5 -- How often do we update the frames
function Distance()
if LockedOn and (GetActionUsable(11) == true) then --melee distance skill
[[insert tooltip showing distance code here]]
elseif
if LockedOn and (GetActionUsable(12) == true) then -- next closest distance
[[insert tooltip showing distance code here]]
end
updateTime = updateTime + elapsedTime
if updateTime >= updateIntervall and LockedOn then
Distance()
end
|
I know this is probably all wrong but that's the concept anyway.