Skip to content

Instantly share code, notes, and snippets.

@StinkyTwitch
StinkyTwitch / gist:90ae679cbcb1046acdf4
Last active August 29, 2015 14:08
Hunter Library - Pet To Target Distance
local libPST = {}
--[[------------------------------------------------------------------------------------------------
DISTANCE BETWEEN PET AND TARGET
--------------------------------------------------------------------------------------------------]]
function libPST.PetToTargetDistance(check)
local x1, y1, z1 = ObjectPosition("Pet")
local x2, y2, z2 = ObjectPosition("Target")
@StinkyTwitch
StinkyTwitch / treasures_of_draenor.txt
Created November 13, 2014 05:59
Treasures of Draenor
TALADOR TREASURES
Aarko's Family Treasure
Amethyl Crystal
Aruuna Mining Cart
Barrel of Fish
Bonechewer Remnants
Bonechewer Spear
Bright Coin
@StinkyTwitch
StinkyTwitch / gist:640a7a7b6e1557c330e5
Last active August 29, 2015 14:10
LineOfSight PE1 Mod
function LineOfSight(a, b)
local ax, ay, az = ObjectPosition(a)
local bx, by, bz = ObjectPosition(b)
if UnitID( "Target" ) == "76585" then
return true
elseif TraceLine(ax, ay, az+2.25, bx, by, bz+2.25, losFlags) then
return false
end
return true
end
@StinkyTwitch
StinkyTwitch / overload.lua
Last active August 29, 2015 14:10
PE r10 Update for "ground" and "mouseover.ground" issues
-- Current r10 starting at Line 103
function UnitID(target)
local guid = UnitGUID(target)
if guid then
local type, zero, server_id, instance_id, zone_uid, npc_id, spawn_uid = strsplit("-", guid)
if type == "Player" then return tonumber(ServerID) end
if npc_id then return tonumber(npc_id) end
end
return false
@StinkyTwitch
StinkyTwitch / gist:7845a9350dd6fa73c7d8
Created December 3, 2014 05:44
Auto Target PE Block
--[[--------------------------------------------------------------------------------------------
AUTOTARGET
* Will automatically target nearest enemy. If you accidentally select a friendly target it
clears your selection and reselects the nearest enemy. To override this press and hold Right
Control.
----------------------------------------------------------------------------------------------]]
{{
{ "/script TargetNearestEnemy(); if not UnitAffectingCombat('target') and not CheckSpecialTarget() then ClearTarget() end;", { "!target.exists", }, },
{ "/script TargetNearestEnemy(); if UnitIsDeadOrGhost('target') then ClearTarget() end;", { "target.exists", "target.dead", }, },
{ "/cleartarget", { "@LibPRA.ClearTarget()", "!modifier.rcontrol", }, },
@StinkyTwitch
StinkyTwitch / AutoTarget.lua
Last active August 29, 2015 14:10
AutoTarget Drop In Module
-- version: 0.9
-- This variable is here just for testing purposes while I/we verify the code works correctly in
-- all situations. Will eventually not be needed.
GRunAutoTargetCode = false
-- Our main table for storing the objects and their distance from the player.
-- The table looks like this: [index] [object_pointer_address] [distance_to_player]
-- The table is sorted by distance to the player.
-- To get the object pointer use "GUnitCache[i].key"
@StinkyTwitch
StinkyTwitch / gist:1e446f71fc15183c0938
Last active August 29, 2015 14:13
Check Hunter Queue
--[[------------------------------------------------------------------------------------------------
CHECK HUNTER QUEUE
--------------------------------------------------------------------------------------------------]]
function LibHunter.CheckHunterQueue(spell_id)
if (GetTime() - LibHunter.QueueTime) > LibHunter.QueueTimeValidFor then
LibHunter.QueueTime = 0
LibHunter.QueueSpell = nil
return false
else
@StinkyTwitch
StinkyTwitch / specialtargets.lua
Created February 4, 2015 16:25
SpecialTargets.lua
--[[------------------------------------------------------------------------------------------------
GLOBAL TABLE OF SPECIAL CASE TARGETS
* Credit: MrTheSoulz for the framework
--------------------------------------------------------------------------------------------------]]
SpecialTargets = {
-- TRAINING DUMMIES
31144, -- Training Dummy - Lvl 80
31146, -- Raider's Training Dummy - Lvl ??
32541, -- Initiate's Training Dummy - Lvl 55 (Scarlet Enclave)
32542, -- Disciple's Training Dummy - Lvl 65
@StinkyTwitch
StinkyTwitch / firehack.lua
Last active August 29, 2015 14:14
Modified UnitsAroundUnit firehack.lua
-- ProbablyEngine Rotations
-- Released under modified BSD, see attached LICENSE.
-- Functions that require FireHack
local SpecialTargets = {
-- TRAINING DUMMIES
31144, -- Training Dummy - Lvl 80
31146, -- Raider's Training Dummy - Lvl ??
32541, -- Initiate's Training Dummy - Lvl 55 (Scarlet Enclave)
@StinkyTwitch
StinkyTwitch / GetSpellCooldown.lua
Created February 15, 2015 22:35
Hack AddOn Example Code
function PrintDuration(spell)
local start, duration, enabled = GetSpellCooldown(spell)
if not start then return false end
if start ~= 0 then
return (start + duration - GetTime())
end
return 0
end
C_Timer.NewTicker(0.1, (function() print(PrintDuration("Fists of Fury")) end), nil)