Also BehindUnit return values:
true being in front
false being behind
(i think its already too late to fix, kinda legacy).
Last edited by botirk; 01-02-2015 at 04:34 PM.
Love the object manager, thanks!
There seems to be a issue with '/reload' tho, seems to crash WoW anyone can confirm?
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety.
not sorted, just list of units.
will check BehindUnit
hey, tool isnt for stress-test! dont need reload a 10 times using alt-tab![]()
Also fatal exception(or idk) during casual jumping in city. Seems not reliable.
Those who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety.
I've updated PE to use the newest version, look for it in the next release (should be 6.0.2r13).
first post updated. object manager really was heavy - optimized
updated function:PHP Code:
local DistanceTo = function(unit1, unit2)
unit1 = unit1 or 'player'
unit2 = unit2 or 'target'
if UnitExists(unit1) and UnitExists(unit2) and UnitPosition then
local px, py, pz = UnitPosition(unit1)
local ux, uy, uz = UnitPosition(unit2)
return sqrt((px - ux)^2 + (py - uy)^2 + (pz - uz)^2)
end
return 0
end
local enemycount = function(unit, maxdist)
unit = unit or 'target'
maxdist = maxdist or 10
local count = ObjectsCount()
local allcount = 0
for i=1, count-1 do
local obj, id = ObjectByIndex(i)
if obj and UnitCanAttack('player', obj) and unithp(obj) > 0 and DistanceTo(unit, obj) <= maxdist then
allcount = allcount + 1
end
end
return allcount
end
Also it requires affirmation before injection (it was not there previosly in case of only 1 wow running).
Here is my code:
it seems not affecting FPS, but the frame it being called very slow(every 0.1 seconds in my case).Code:units = function() local allies,targets = {},{} if UnitCanAssist("player") then allies[1] = "player" end if UnitCanAttack("target") then targets[1] = "target" end for i=1,ObjectsCount()-1 do local obj = ObjectByIndex(i) if obj then if UnitCanAssist(obj) then if not UnitIsUnit("player",obj) then allies[#allies+1] = obj end elseif UnitCanAttack(obj) then if not UnitIsUnit("target",obj) then targets[#targets+1] = obj end end end end return allies,targets end
ObjectCount is ~100 in my garrison near dummies.
Last edited by botirk; 01-08-2015 at 01:33 AM.
use objectscount one time and save it returns to value, else you call it each time in cycle
Nice additions to the tool. Took me awhile figure out how you can pass GUIDs to Unitxxxx LUA functions. Again, nice work.