Last active
August 29, 2015 14:08
-
-
Save StinkyTwitch/90ae679cbcb1046acdf4 to your computer and use it in GitHub Desktop.
Hunter Library - Pet To Target Distance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local libPST = {} | |
--[[------------------------------------------------------------------------------------------------ | |
DISTANCE BETWEEN PET AND TARGET | |
--------------------------------------------------------------------------------------------------]] | |
function libPST.PetToTargetDistance(check) | |
local x1, y1, z1 = ObjectPosition("Pet") | |
local x2, y2, z2 = ObjectPosition("Target") | |
local dx = x2 - x1 | |
local dy = y2 - y1 | |
local dz = z2 - z1 | |
distance = math.sqrt((dx*dx) + (dy*dy) + (dz*dz)) | |
if distance > check then | |
return true | |
else | |
return false | |
end | |
end | |
ProbablyEngine.library.register('libPST', libPST) | |
-- Rotation Code | |
{"/cast Dash", {"@libPST.PetToTargetDistance(15)", "timeout(petDash, 2)"}}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment