Skip to content

Instantly share code, notes, and snippets.

@lithammer
Created July 7, 2012 10:26
Show Gist options
  • Save lithammer/3065785 to your computer and use it in GitHub Desktop.
Save lithammer/3065785 to your computer and use it in GitHub Desktop.
Script to automatically position Aptechka raid frames bases on role (dps/tank or healer)
-- Aptechka raid frames:
-- https://github.com/rgd87/Aptechka
-- Usage:
-- Put this script into the AptechkaUserConfig\userconfig.lua file.
-- Moves the raid frames according to current spec
local Mover = CreateFrame('Frame')
Mover:RegisterEvent('PLAYER_ENTERING_WORLD')
Mover:RegisterEvent('GROUP_ROSTER_UPDATE')
local class = select(2, UnitClass('player'))
local function Mover_OnEvent(self, event, ...)
if event == 'PLAYER_ENTERING_WORLD' then
self:RegisterEvent('ACTIVE_TALENT_GROUP_CHANGED')
self:UnregisterEvent('PLAYER_ENTERING_WORLD')
end
local dps = 'setpos point=CENTER x=480 y=-200'
local healer = 'setpos point=CENTER x=180 y=-200'
local command = dps
-- If in healer spec and a party
if GetNumSubgroupMembers() > 0 and GetSpecialization() and GetSpecializationRole(GetSpecialization()) == 'HEALER' then
command = healer
end
Aptechka.SlashCmd(command)
end
Mover:SetScript('OnEvent', Mover_OnEvent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment