Quantcast
WoWInterface - View Single Post - Classic profession skill levels?
View Single Post
01-21-20, 11:06 AM   #11
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 310
Not to hijack a topic but I was wondering about profession with my databar I use and was wondering with the help from this post does the following code look like it will work in Classic?

Code:
		proPlugin:SetScript('OnEnter', function()		
			local anchor, panel, xoff, yoff = DataTextTooltipAnchor(Text)
			GameTooltip:SetOwner(panel, anchor, xoff, yoff)
			GameTooltip:ClearLines()
			GameTooltip:AddLine(hexa..PLAYER_NAME.."'s"..hexb.." Professions")
			GameTooltip:AddLine' '
			for i = 1, select("#", GetNumPrimaryProfessions()) do
				local v = select(i, GetSkillLineInfo());
				if v ~= nil then
					local skillName, _, _, skillRank, _, _, skillMaxRank, _, _, _, _, _, _ = GetSkillLineInfo(v)
					GameTooltip:AddDoubleLine(skillName, skillRank..' / '..skillMaxRank,.75,.9,1,.3,1,.3)
				end
			end
			GameTooltip:AddLine' '
			GameTooltip:AddLine("|cffeda55fLeft Click|r to Open Profession #1")
			GameTooltip:AddLine("|cffeda55fMiddle Click|r to Open Spell Book")
			GameTooltip:AddLine("|cffeda55fRight Click|r to Open Profession #2")
			
			GameTooltip:Show()
		end)


		proPlugin:SetScript("OnClick",function(self,btn)
			local prof1, prof2 = GetNumPrimaryProfessions()
			if btn == "LeftButton" then
				if prof1 then
					if(GetSkillLineInfo(prof1) == ('Skinning')) then
						CastSpellByName("Skinning Skills")
					elseif(GetSkillLineInfo(prof1) == ('Mining')) then
						CastSpellByName("Mining Skills")
					elseif(GetSkillLineInfo(prof1) == ('Herbalism')) then
						CastSpellByName("Herbalism Skills")					
					else	
						CastSpellByName((GetSkillLineInfo(prof1)))
					end
				else
					print('|cff33ff99BasicUI:|r |cffFF0000No Profession Found!|r')
				end
			elseif btn == 'MiddleButton' then
				ToggleSpellBook(BOOKTYPE_PROFESSION)	
			elseif btn == "RightButton" then
				if prof2 then
					if(GetSkillLineInfo(prof2) == ('Skinning')) then
						CastSpellByName("Skinning Skills")
					elseif(GetSkillLineInfo(prof2) == ('Mining')) then
						CastSpellByName("Mining Skills")
					elseif(GetSkillLineInfo(prof2) == ('Herbalism')) then
						CastSpellByName("Herbalism Skills")						
					else
						CastSpellByName((GetSkillLineInfo(prof2)))
					end
				else
					print('|cff33ff99BasicUI:|r |cffFF0000No Profession Found!|r')
				end
			end
		end)
thanks for any help with this.
Coke

Last edited by cokedrivers : 01-21-20 at 11:30 AM.
  Reply With Quote