Advertisement
Guest User

Untitled

a guest
May 26th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.73 KB | None | 0 0
  1. --[[============================================================================
  2.     LOCAL VARIABLES
  3. ----------------------------------------------------------------------------]]--
  4. local id, name, description, icon, background, role, primaryStat-- = GetSpecializationInfo(GetSpecialization())
  5.  
  6. local currentPriority -- the currently active priority
  7.  
  8. local className, classFileName = UnitClass("player")
  9. --[[============================================================================
  10.     FUNCTIONS
  11. ----------------------------------------------------------------------------]]--
  12. function StatPriorityPrint(msg)
  13.     msg = MSG_PREFIX .. msg
  14.     DEFAULT_CHAT_FRAME:AddMessage(msg)
  15. end
  16.  
  17. local PrintMsg = StatPriorityPrint
  18.  
  19. function GetPriority()
  20.     id, name, description, icon, background, role, primaryStat = GetSpecializationInfo(GetSpecialization())
  21.     currentPriority = SPECS[id]
  22.     PrintMsg("Prioritizing for: " .. COLORS[className] .. name .. " - " .. className .. COLORS[0])
  23. end
  24. --[[============================================================================
  25.     WIDGETS AND FRAMES
  26. ----------------------------------------------------------------------------]]--
  27. local LoginFrame = CreateFrame("Frame")
  28. LoginFrame:RegisterEvent("PLAYER_LOGIN")
  29. LoginFrame:SetScript("OnEvent",
  30.     function(self, event, ...)
  31.         PrintMsg(LOAD_MSG)
  32.         PrintMsg("Type " .. COLORS[2] .. "/stp help " .. COLORS[0] .. "for a list of commands")
  33.  
  34.         GetPriority()
  35.        
  36.         className, classFileName = UnitClass("player")
  37.     end
  38. )
  39.  
  40. local TalentChangedFrame = CreateFrame("Frame") --fires when the player changes their specialization
  41. TalentChangedFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
  42. TalentChangedFrame:SetScript("OnEvent",
  43.     function(self, event, ...)
  44.         GetPriority()
  45.     end
  46. )
  47. --[[============================================================================
  48.     SLASH COMMANDS
  49. ----------------------------------------------------------------------------]]--
  50. SLASH_STATPRIORITY1 = "/stp"
  51. function SlashCmdList.STATPRIORITY(msg, editbox)
  52.     if msg == "" then
  53.         PrintMsg(COLORS[className] .. name .. " - " .. className .. ":" .. COLORS[0])
  54.         local i = 1
  55.         repeat
  56.             PrintMsg(i .. ". " .. currentPriority[i])
  57.             i = i + 1
  58.         until currentPriority[i] == nil
  59.     elseif msg == "help" then
  60.         PrintMsg(COLORS[2] .. "/stp" .. COLORS[0] .. "    Print your current " .. COLORS[1] .. "StatPriority" .. COLORS[0] .. " in chat")
  61.     elseif msg == "same" then
  62.         PrintMsg("imo same tbh")
  63.     else
  64.         PrintMsg(COLORS[2] .. "/stp " .. msg .. COLORS[0] .. " was not recognized. Type " .. COLORS[2] .. "/stp help" .. COLORS[0] .. " for a list of commands.")
  65.     end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement