Spec swap script
Hiyas, all :) I'm looking for a script for KG panels, that will change when I swap specs. I use sStats for all my data feeds, and can't bring myself to install fortress, or chocolate bar, etc, for just one feed. So a script (for KG Panels) that will change my spec. I THINK I'll be able to muddle my way thru to mimicing (sp?) a data feed if I could get this core script for OnClick to let me swap specs.
Mebbe I should try to insert a /runscript macro into an OnClick script for KG Panels. Gah, the sheer amount of things I do not know, is horrifying :( My thanks, in advance, for any/all help, this community is incredible :D |
/run if( GetActiveTalentGroup() == 1 ) then DEFAULT_CHAT_FRAME:AddMessage("Spec1...");SetActiveTalentGroup(2) else DEFAULT_CHAT_FRAME:AddMessage("Spec2...");SetActiveTalentGroup(1) end
/in 6 /equipset [spec:2]Eq1;Eq2 |
I use this macro to swap specs. The /usetalents command is provided in the default UI.
Code:
/usetalents [spec:1] 2;1 |
Quote:
|
I've never used kgPanels, and looking through the code, it looks like it takes in Lua code to run a script. I can provide code to feed into the addon, but I wouldn't know where to go to put it in. This is made to run in version 1.5.4.4 if it makes any difference. There's an added check because kgPanels appears to register CLICK events as 2 handler functions. Without checking a local variable it injects into the user script, it'll run the code twice in one click.
Code:
if released then SetActiveTalentGroup(GetActiveTalentGroup()%2+1); end |
Quote:
|
Now I'd like to know if anyone knows a script that would call a panel based on what spec I'm currently in? :D
|
Quote:
|
I'm assuming to show another frame configured in kgPanels. You'd have to know the frame's name to access it. I would suggest trying to find it using /framestack. I'm not sure what API calls are provided by kgPanels if any at all.
|
Exactly, I'm looking for a script for KG Panels, that would would show/call a panel that I've made when I switch specs. From tank to heals, and vice versa. The basic idea is making two panels, one that shows when I'm bear, while the other one hides, and one that shows when I'm in heals spec, while the first one hides.
|
kgPanels includes a way to get the actual frame name of a panel as long as you know the name you use to configure it - /framestack isn't needed.
I believe the command is kgPanels:FetchFrame("framenameinconfigmenu") as kgPanels doesn't name the actual frames that it generates. |
Mebbe I explained it wrong, lol, sometimes I confuse myself. I 'm looking for a script that will show a panel based on what spec my toon is in. I switch spec, the panel switches.
|
Yeah, you need the name of the frame to do this. ;)
Code:
local f = kgPanel:Fetch("myframenameforspec2") --or whatever this line should be Code:
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
This worked perfectly, Seerah, with very few tweaks. You rock, lady, as always, my thanks! This is what I ended up with.
OnLoad: Code:
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") Code:
if released then SetActiveTalentGroup(GetActiveTalentGroup()%2+1); end Code:
local f = kgPanels:FetchFrame("BM") |
And here's a new noobish wrinkle....when I reload, or zone, they both show up, ao I have to change specs, to get one to hide. Any ideas how I would change the show/hide parameters? It works flawlessly, except for this one small thing, lol. My thanks, in advance, for any/all help~
|
Quote:
|
Quote:
:banana: :banana: :banana: :banana: |
cfg for all 3 trees?
Kinda looking for the same thing, im about to create art for each spec for a few classes with the release of my ui edit, would there be a way to have it detect what tree im into rather than what spec im into?. Like for dks
Blood - Frost - Unholy 1 2 3 the art is based around the spec so id like it to switch accordingly! thanks. edit, also class would be preferable! |
Could probably use
http://wowprogramming.com/docs/api/GetPrimaryTalentTree tabIndex = GetPrimaryTalentTree(isInspect, isPet, talentGroup) so like local spec = GetPrimaryTalentTree(false, false) if spec == 1 blood else if spec == 2 frost etc etc |
Quote:
|
All times are GMT -6. The time now is 09:25 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI