From the looks of it, your script always returns the highest talent tab's info (1 if you haven't bought dual-spec, 2 if you have).
You may want to use GetActiveTalentGroup() to find out WHICH talents are active, and then query GetTalentTabInfo() with the result from it.
__________________
-- Taryble
|