• 0

    posted a message on TradeskillInfo Official Thread
    i found the bigger problems with the tradeskillinfodata file. change 29457 to 29547. and the component for flagon of mead (id 2954) needs to be added. it is also completly missing the recipe for refined deeprock salt (it is stored as source recipe, but no recipe!) so need to either add that recipy, or fix the source info. fyi i posted this as an addon on wowinterface named tradeskill advice
    Posted in: General AddOns
  • 0

    posted a message on LittleWigs
    ya i know it didnt really belong here, it didnt really belong anywhere, BUT i used one of the ones that had a lot of similiar events (black morass) so i built it into little wigs like that. i wish i could have goten the shieldsmash and life drain bars to work. and i wanted others to benefit from my work.
    Posted in: Raid AddOns
  • 0

    posted a message on TradeskillInfo Official Thread
    oh so thats how you attach a file, attached is the data file i used to find the skillup rate. despite how much it seems to zigzag around it has an impressivly high R^2 value, its no .999 but its useable. i intended to do 20, but those 9 alone took some time. and as you can see i had a yellow take 7 attempts to get a skillup, and i had a 39 green (grey at 40) take both 1, and 20, attempts, to achieve. plus its pretty easy to see a progression from low to high attempts.
    Posted in: General AddOns
  • 0

    posted a message on TradeskillInfo Official Thread
    i wasnt exactly asking for this to become canon, i was just presenting my work so those who choose to use it can benefit from it.

    not trying to go off on a complete tangent here but thats like saying you cant trust any tanking mod because of dodge/parry ect. or any theory craft that uses crit rates, because they arnt "fool proof always 10% over the next 10 random checks". its how random chances are supposed to work, you "could" get 20 combines in a row with no skill up on a yellow, just like you "could" get 10 skillups in a row in a green. its impossible to predict. i wish i could have gathered more data, but since i wont bot and i already spent 2-3 hours getting what little data i did have, i figure it is a close enough approximation to work for me.

    i could very well also be off assuming each primary tradeskill uses same formula's or that each tier does. BUT its the only data i had to work with and considering how simple and accurate even those few samples i did have were to a simple linear equation. besides, rarely does a green ever even show up in the result of anything my mod spits out (i think mithril spurs and grinding stones was it)
    Posted in: General AddOns
  • 0

    posted a message on TradeskillInfo Official Thread
    how do i do that? i guess you could put it in its own lua file but the skipme thing still has to be edited one way or another. im not very good with lua (let alone the frames) but i do have basic programming experience.
    Posted in: General AddOns
  • 0

    posted a message on TradeskillInfo Official Thread
    those patch messages could meen they extended when they went grey couldnt they? unless you know for sure they didnt ;)

    then like i said if you dont trust my formulas are good enough, set the pessemism factor higher, setting it to 100 will pretty much guarentee you ONLY use oranges. the powerleveling guide isnt always up to date with the prices. a great example is enchanting 291-300 illusion dust is ~5g a piece which comes out to ~40g per combine, enchant shield uses dream dust which is 98s a piece for ~10g a combine. using hoard kilrog average prices.
    true it goes yellow at 285 and green at 305 but unless "yellow" happens to be "25%" skill up rate, its more cost effective to use dream dust. those types of details are the ENTIRE reason i wrote this mod hack instead of blindly following that guide.

    the only thing i wish is auctioneer advanced being able to list the like 5 cheapest seen prices on last scan, so i can use "cheapest" instead of "average", the good news is i just looked and cheapest dream is 60 silver, cheapest illusion 3g 50s, meening yellow would have to be "21%" to be worth using the illusion dust
    Posted in: General AddOns
  • 0

    posted a message on TradeskillInfo Official Thread
    like i said i tested it myself with low skill cooking, and it seemed such a simple formula why bother making a more complicated one. could i be wrong? sure,but what you "feel" happpens is nothing when facing real statistics, you could feel your ice bolt crits more then fire bolt but in fact theyre the same you just use ice more. ;) this is why i added the pessemism factors, so you can phase out green or yellow if you dont entirly trust my skillup rate formula. until someone writes a data gathering mod that dozens of people use to track these skillups for each tradeskill we can only hope blizzard was lazy with the primary tradeskills.
    Posted in: General AddOns
  • 0

    posted a message on LittleWigs
    heres a mod i wrote for the shartuul event in blades edge mountain, you do have to enable bigwiggs itself to get it to turn on(its disabled if your not in a group) but everything else works, this only needs 1 extra line in the modules.xml file but it isnt very localized. to fully localize this a line for babble boss would need to be added for shartuul

    <Script file="Shartuul.lua"/>

    then just throw the code below into sharrtuul.lua and save it in your littlewiggs folder and bingo you got warnings for the end 3 bosses as well as phase updates.

    ------------------------------
    --   Are you local?   --
    ------------------------------
    
    
    --sorry i didnt localize this much yet, this is my VERY first wow mod
    --local boss = AceLibrary("Babble-Boss-2.2")["Shartuul"]
    local boss = "Shartuul"
    local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)
    
    L:RegisterTranslations("enUS", function() return {
    	cmd = "Shartuul",
    
    	part="Part %s",	
    	
    	engage_trigger = "Back to your patrol, worm! That shield is more valuable to me than a hundred of you...",
    	disable_trigger = "Aargh! If I must fall, I'm taking you with me!",
    	disable_warning = "Shartuul has been defeated!",
    
    	death_trigger1 = "What manner of deception is this!? Who turns my underlings against me?", --Boss 1 dead
    	death_trigger2 = "Very well, intruder. You have earned my undivided attention...", --Boss 2 dead
    	death_trigger3 = "Eye of Shartuul dies.", --Boss 3 dead
    	death_trigger4 = "Dreadmaw! You shall pay dearly, trespasser...", --Boss 4 dead
    	death_trigger5 = "Aargh! If I must fall, I'm taking you with me!", -- Shartuul dead
    
    	spawn_trigger1 = "Hah! You've unleashed my pet! Your soul shall be its next meal.",--Boss 1 released
    	spawn_trigger2 = "Your pathetic efforts shall yield you nothing but pain.", --Boss 2 released
    	
    	--emotes
    	emote1="%a focuses intensely!", --eye of shartuul beam
    	emote2="Prepare to be incinerated!", --shartuul incinerate
    	emote3="%a is afflicted by Shadow Resonance.", --debuff resonance
    	emote4="%a is afflicted by Lacerating Bite.", --debuff lacerating
    	
    	emote1_warn="Iceblock NOW",
    	emote2_warn="Iceblock NOW",
    	emote3_warn="Cure NOW",
    	emote4_warn="Cure NOW",
    	
    	-- Bars
    	Lifetap = "Enemy - Lifetapped",
    	Lifetap_desc = "Warns when Lifetap will end.",
    	Lifetap_trigger = "%a* is afflicted by Siphon Life%a*",
    	Lifetap_warning = "Lifetap fading soon.",
    	Lifetap_bar = "Lifetap fades in: ",
    	
    	Shieldsmash = "Shieldsmash cooldown",
    	Shieldsmash_desc = "reminds you to shieldsmash",
    	Shieldsmash_trigger = "%a*Smash Shield hits%a*",
    	Shieldsmash_warning = "Shieldsmash ready!",
    	Shieldsmash_bar = "Shieldsmash ready in: ",
    	
    	--options
    	incinerate="incinerate", 
    	beam="beam", 
    	cures="cures",
    	phases="phases",
    	shieldsmash="shieldsmash", 
    	lifetap="lifetap",
    } end )
    
    L:RegisterTranslations("zhTW", function() return {
    	part="?",	
    	
    	engage_trigger = "?",
    	disable_trigger = "?",
    	disable_warning = "?",
    
    	death_trigger1 = "?", --Boss 1 dead
    	death_trigger2 = "?", --Boss 2 dead
    	death_trigger3 = "?", --Boss 3 dead
    	death_trigger4 = "?", --Boss 4 dead
    	death_trigger5 = "?", -- Shartuul dead
    
    	spawn_trigger1 = "?",--Boss 1 released
    	spawn_trigger2 = "?", --Boss 2 released
    	
    	--emotes
    	emote1="?", --eye of shartuul beam
    	emote2="?", --shartuul incinerate
    	emote3="?", --debuff resonance
    	emote4="?", --debuff lacerating
    	
    	emote1_warn="?",
    	emote2_warn="?",
    	emote3_warn="?",
    	emote4_warn="?",
    	
    	-- Bars
    	Lifetap = "?",
    	Lifetap_desc = "?",
    	Lifetap_trigger = "?",
    	Lifetap_warning = "?",
    	Lifetap_bar = "?",
    	
    	Shieldsmash = "?",
    	Shieldsmash_desc = "?",
    	Shieldsmash_trigger = "?",
    	Shieldsmash_warning = "?",
    	Shieldsmash_bar = "?",
    	
    	--options
    	incinerate="?", 
    	beam="?", 
    	cures="?",
    	phases="?",
    	shieldsmash="?", 
    	lifetap="?",
    } end )
    
    L:RegisterTranslations("koKR", function() return {
    	part="?",	
    	
    	engage_trigger = "?",
    	disable_trigger = "?",
    	disable_warning = "?",
    
    	death_trigger1 = "?", --Boss 1 dead
    	death_trigger2 = "?", --Boss 2 dead
    	death_trigger3 = "?", --Boss 3 dead
    	death_trigger4 = "?", --Boss 4 dead
    	death_trigger5 = "?", -- Shartuul dead
    
    	spawn_trigger1 = "?",--Boss 1 released
    	spawn_trigger2 = "?", --Boss 2 released
    	
    	--emotes
    	emote1="?", --eye of shartuul beam
    	emote2="?", --shartuul incinerate
    	emote3="?", --debuff resonance
    	emote4="?", --debuff lacerating
    	
    	emote1_warn="?",
    	emote2_warn="?",
    	emote3_warn="?",
    	emote4_warn="?",
    	
    	-- Bars
    	Lifetap = "?",
    	Lifetap_desc = "?",
    	Lifetap_trigger = "?",
    	Lifetap_warning = "?",
    	Lifetap_bar = "?",
    	
    	Shieldsmash = "?",
    	Shieldsmash_desc = "?",
    	Shieldsmash_trigger = "?",
    	Shieldsmash_warning = "?",
    	Shieldsmash_bar = "?",
    	
    	--options
    	incinerate="?", 
    	beam="?", 
    	cures="?",
    	phases="?",
    	shieldsmash="?", 
    	lifetap="?",
    	
    } end )
    
    L:RegisterTranslations("frFR", function() return {
    	part="?",	
    	
    	engage_trigger = "?",
    	disable_trigger = "?",
    	disable_warning = "?",
    
    	death_trigger1 = "?", --Boss 1 dead
    	death_trigger2 = "?", --Boss 2 dead
    	death_trigger3 = "?", --Boss 3 dead
    	death_trigger4 = "?", --Boss 4 dead
    	death_trigger5 = "?", -- Shartuul dead
    
    	spawn_trigger1 = "?",--Boss 1 released
    	spawn_trigger2 = "?", --Boss 2 released
    	
    	--emotes
    	emote1="?", --eye of shartuul beam
    	emote2="?", --shartuul incinerate
    	emote3="?", --debuff resonance
    	emote4="?", --debuff lacerating
    	
    	emote1_warn="?",
    	emote2_warn="?",
    	emote3_warn="?",
    	emote4_warn="?",
    	
    	-- Bars
    	Lifetap = "?",
    	Lifetap_desc = "?",
    	Lifetap_trigger = "?",
    	Lifetap_warning = "?",
    	Lifetap_bar = "?",
    	
    	Shieldsmash = "?",
    	Shieldsmash_desc = "?",
    	Shieldsmash_trigger = "?",
    	Shieldsmash_warning = "?",
    	Shieldsmash_bar = "?",
    	
    	--options
    	incinerate="?", 
    	beam="?", 
    	cures="?",
    	phases="?",
    	shieldsmash="?", 
    	lifetap="?",
    } end )
    
    ----------------------------------
    --   Module Declaration   --
    ----------------------------------
    
    local mod = BigWigs:NewModule("Shartuul")
    mod.partyContent = true
    mod.zonename = AceLibrary("Babble-Zone-2.2")["Blade's Edge Mountains"]
    mod.enabletrigger = {"Shartuul","Felguard Degrader"}
    mod.toggleoptions = {"incinerate", "beam", "cures", -1, "phases", -1, "shieldsmash", "lifetap","bosskill"}
    mod.revision = tonumber(("$Revision: 42771 $"):sub(12, -3))
    
    ------------------------------
    --   Initialization   --
    ------------------------------
    
    function mod:OnRegister()
    	self:RegisterEvent("CHAT_MSG_MONSTER_WHISPER")
    end
    
    function mod:OnDisable()
    	self:RegisterEvent("CHAT_MSG_MONSTER_WHISPER")
    end
    
    function mod:OnEnable()
    	self:RegisterEvent("CHAT_MSG_MONSTER_YELL")--(shartuul incinerate)
    	self:RegisterEvent("CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE")--(life siphon)
    	self:RegisterEvent("CHAT_MSG_SPELL_SELF_DAMAGE")--(shadow resonance, lacerating bite)
    	self:RegisterEvent("CHAT_MSG_RAID_BOSS_EMOTE")--(eye of shartuul beam)
    	self:RegisterEvent("CHAT_MSG_SPELL_PET_DAMAGE")--(throw axe)
    	self:RegisterEvent("CHAT_MSG_MONSTER_WHISPER")--other deaths
    	self:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH")--(eye death)
    	self:RegisterEvent("UNIT_SPELLCAST_START")--eye beam
    	self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")--life siphon
    	
    end
    
    ------------------------------
    --   Event Handlers   --
    ------------------------------
    
    function mod:CHAT_MSG_MONSTER_YELL(msg)
    	if not self.db.profile.incinerate then return end
    	if msg == L["emote2"] then
    		self:Message(L["emote2_warn"], "Urgent")
    	end
    end
    
    function mod:CHAT_MSG_SPELL_PERIODIC_CREATURE_DAMAGE(msg)
    	if self.db.profile.lifetap and msg:find(L["Lifetap_trigger"]) then
    		self:Bar(L["Lifetap_bar"], 60, "Spell_Shadow_LifeDrain")
    		self:DelayedMessage(50, L["Lifetap_warning"], "Urgent", nil, "Info")
    	end
    end
    
    function mod:UNIT_SPELLCAST_SUCCEEDED(msg)
    	if self.db.profile.lifetap and arg2=="Life Siphon" then
    		self:Bar(L["Lifetap_bar"], 60, "Spell_Shadow_LifeDrain")
    		self:DelayedMessage(50, L["Lifetap_warning"], "Urgent", nil, "Info")
    	end
    end
    
    function mod:CHAT_MSG_SPELL_SELF_DAMAGE(msg)
    	if self.db.profile.cures and msg == L["emote3"] then
    		self:Message(L["emote3_warn"], "Urgent")
    	end
    	if self.db.profile.cures and msg == L["emote4"] then
    		self:Message(L["emote4_warn"], "Urgent")
    	end
    end
    
    function mod:CHAT_MSG_RAID_BOSS_EMOTE(msg)
    	if self.db.profile.beam and msg:find(L["emote1"]) then
    		self:Message(L["emote1_warn"], "Urgent")
    	end
    end
    
    function mod:UNIT_SPELLCAST_START(msg)	
    	if self.db.profile.beam and arg2=="Dark Glare" then
    		self:Message(L["emote1_warn"], "Urgent")
    	end
    end
    
    function mod:CHAT_MSG_COMBAT_HOSTILE_DEATH(msg)
    	if self.db.profile.phases and msg == L["death_trigger3"] then
    		phase=6
    		self:Message(L["part"]:format(phase), "Important")
    	end
    end
    
    function mod:CHAT_MSG_SPELL_PET_DAMAGE(msg)
    	if self.db.profile.shieldsmash and msg:find(L["Shieldsmash_trigger"]) then
    		self:Bar(L["Shieldsmash_bar"], 25, "Spell_Holy_RighteousFury")
    		self:DelayedMessage(26, L["Shieldsmash_warning"], "Urgent", nil, "Info")
    	end
    end
    
    function mod:CHAT_MSG_MONSTER_WHISPER(msg)
    	if msg == L["engage_trigger"] then
    		if GetMinimapZoneText() ~= AceLibrary("Babble-Zone-2.2")["Blade's Edge Mountains"] or BigWigs:IsModuleActive(name) then return end
    		phase=1
    		self:Message(L["part"]:format(phase), "Important")
    		BigWigs:EnableModule(name)
    	end
    	if self.db.profile.phases and msg == L["death_trigger1"] then
    		phase=3
    		self:Message(L["part"]:format(phase), "Important")
    	end
    	if self.db.profile.phases and msg == L["death_trigger2"] then
    		phase=5
    		self:Message(L["part"]:format(phase), "Important")
    	end
    	if self.db.profile.phases and msg == L["death_trigger4"] then
    		phase=7
    		self:Message(L["part"]:format(phase), "Important")
    	end
    	if self.db.profile.bosskill and msg == L["death_trigger5"] then
    		if self.db.profile.bosskill then self:Message(L["disable_warning"]:format(boss), "Bosskill", nil, "Victory") end
    		BigWigs:ToggleModuleActive(self, false)
    	end
    	if self.db.profile.phases and msg == L["spawn_trigger1"] then
    		phase=2
    		self:Message(L["part"]:format(phase), "Important")
    	end
    	if self.db.profile.phases and msg == L["spawn_trigger2"] then
    		phase=4
    		self:Message(L["part"]:format(phase), "Important")
    	end
    end
    Posted in: Raid AddOns
  • 0

    posted a message on TradeskillInfo Official Thread
    huge post inc! prepare to go blind!

    i did a bit of hacking around with this mod to generate a "tradeskill advice" type of function.

    first off a bit of info virtually no one has taken the time to figure out. the skill up rate is a ratio of how far from yellow to grey your skill is. so for example something yellow at 310 grey at 330 will have a skillup rate of 95% at 311, 50% at 320, 10% at 328 ect. i found this by making a new char 9 times and recording how long it took to skill up from the spicy bread combine and it is DANM close to that formula(skillrate=(curskill-grey)/(yellow-grey).

    to use this stuff you need auctioneer advanced installed. it is entirly console based, i can hold my own programing code but making clean ui is a bit out of my league. the good news is these functions are modular, (you dont change anything in TSI itself) except for one line (so you can store something)

    this will recomend the cheapest way to get a skillup for a skill at a skill level(assuming you get 0 back from selling that item, lets face it, no one wants to buy 20 rough copper pants), i also added the ability to skip specific recipies, and to only use recipies you currently know. while i was doing this i slapped together a find most profitable item but it does assume that item actually sells.

    i added a pessemism factor for yellow and green skillup areas for those who think theyre unlucky. to use these you would use the commands:
    /script TradeskillInfo:findcheapmakeall(tradeskill,onlyknown,start,end)
    /script TradeskillInfo:findprofit(tradeskill,onlyknown)
    /script TradeskillInfo:findcheapmake(tradeskill,onlyknown,skill)
    /script TradeskillInfo:makeskiped(id,state)
    /script TradeskillInfo:resetskiped()

    yes findcheapmake is a little redundant but it was what i started with

    where tradeskill is whatever your looking for, "A" for alchemy "Ba" for blacksmithing counting armorsmith recipies, and so on, these are easily found in the tradeskillinfodata file
    use onlyknown as true if you only want to use recipies you know, and false or nil if you dont
    start and end would be like 1 375 if you wanted them all, skill is whatever like 250
    id is the recipy id (2454 is Elixir of Lion's Strength) and set state to true if you want that recipy skipped.

    as an example to know what to tradeskill for smithing from 365 to 375 using any recipy do /script TradeskillInfo:findcheapmakeall("B",false,365,374)
    that is not a typo, it finds what you need AT 374 to GET 375, always remember that. if something quotes you 365-367 as one recipy, it meens you do that one AT 367 UNTIL 368

    there are a few typos in the data and this mod will find them quickly (things like needing 29465 instead of 29564 for an item, but that number probably isnt right)
    this mod also relies on you having those datafiles with all the yellow/grey infos, if one is incorrect you will get invalid results

    to use my functions first edit TradeskillInfo:RegisterDefaults adding a line with
    skipme={},

    then insert these functions into the tradeskillinfo.lua file, careful, forum cut off the longer lines, make sure you select all and paste somewhere.
    function TradeskillInfo:findprofit(id2,onlyknown)
    	if strlen(id2)>1 then
    		spec=strsub(id2,2,strlen(id2)-1)
    		id2=strsub(id2,1,1)
    	end
    	combines=self:getthedata(id2,onlyknown,spec)
    	profit=-1000000000
    	id=0
    	for i,j in pairs(combines) do
    		if type(j)=="table" then
    			cost=0
    			for k,l in pairs(j) do
    				if type(l)=="table" then
    					cost=combines[i][k].cost*combines[i][k].num+cost
    				end
    			end
    			profit2=combines[i].yield*combines[i].sell-cost
    			if profit2>profit then
    				profit=profit2
    				id=combines[i].name
    				id3=i
    			end
    		end
    	end
    	DEFAULT_CHAT_FRAME:AddMessage(id..", "..profit..", "..id3)
    	for i,j in pairs(combines[id3]) do
    		if type(j)=="table" then
    			cost=combines[id3][i].cost*combines[id3][i].num
    			DEFAULT_CHAT_FRAME:AddMessage(combines[id3][i].name..", -"..cost..", "..combines[id3][i].id)
    		end
    	end
    end
    function TradeskillInfo:makeskiped(id,state)
    	if not TradeskillInfo.db.profile.skipme then TradeskillInfo.db.profile.skipme={} end
    	if state then 
    		TradeskillInfo.db.profile.skipme[id]=true
    	elseif TradeskillInfo.db.profile.skipme[id] then
    		TradeskillInfo.db.profile.skipme[id]=false
    	end
    end
    
    function TradeskillInfo:resetskiped()
    	TradeskillInfo.db.profile.skipme={}
    end
    function TradeskillInfo:findcheapmakeall(id2,onlyknown,s,e)
    	if strlen(id2)>1 then
    	spec=strsub(id2,2,strlen(id2)-1)
    	id2=strsub(id2,1,1)
    	end
    	if not s then s=1 end
    	if not e then e=375 end
    	local combines=self:getthedata(id2,onlyknown,spec)				
    	local profit={}
    	local id={}
    	local ski2={}
    	local id3={}
    	for i,j in pairs(combines) do
    		if type(j)=="table" then
    			local cost=0
    			for k,l in pairs(j) do
    				if type(l)=="table" then
    					cost=combines[i][k].cost*combines[i][k].num+cost
    					
    				end
    			end
    			if cost == 0 then cost = 10000000 end
    			local profit2=0-cost
    			if combines[i].grey and combines[i].grey>0 and combines[i].yellow and combines[i].yellow>0 and combines[i].orange and combines[i].orange>0 then
    			
    
    				for curskill = s,e,1 do
    				
    					local skilluprate=(curskill-combines[i].grey)/(combines[i].yellow-combines[i].grey)
    					if combines[i].yellow==combines[i].grey then
    						skilluprate=.00000000001
    					end
    					local pessemism=1
    					if curskill<combines[i].orange then
    						skilluprate=0.000000000001
    					elseif curskill < combines[i].yellow then
    						skilluprate=1
    					elseif curskill<combines[i].green then
    						pessemism=1.1
    					elseif curskill<combines[i].grey then
    						pessemism=1.3
    					else
    						skilluprate=0.000000000001
    					end
    					local profit3=profit2/skilluprate*pessemism
    					if not profit[curskill] then profit[curskill]=-1000000000 end
    					if profit3>profit[curskill] then
    						profit[curskill]=profit3
    						id[curskill]=combines[i].name
    						id3[curskill]=i
    						ski2[curskill]=skilluprate
    						
    					end
    				end
    				
    			else
    				DEFAULT_CHAT_FRAME:AddMessage("requesting skillup data for: "..combines[i].name..", id: "..i)
    				
    			end
    		end
    	end
    	local totcost=0
    	local temp1={}
    	for curskill = s,e,1 do
    		totcost=profit[curskill]+totcost
    		id[curskill]=id[curskill] or 0
    		profit[curskill]=profit[curskill] or 0
    		id3[curskill]=id3[curskill] or 0
    		ski2[curskill]=ski2[curskill] or 0
    		if temp1.id and temp1.id==id[curskill] then
    			temp1.num=temp1.num+1
    			temp1.avg=(temp1.avg*(temp1.num-1)+profit[curskill])/temp1.num
    			temp1.sk2=curskill
    			temp1.sk3=temp1.sk .. "-" .. temp1.sk2
    		else
    			if curskill > s then
    				for k,l in pairs(combines[temp1.id3]) do
    					if type(l)=="table" then
    						if l.stats then
    							DEFAULT_CHAT_FRAME:AddMessage("buy directly: "..l.name)
    						end
    					end
    				end
    				DEFAULT_CHAT_FRAME:AddMessage("final result: "..temp1.id..", cost/skillup: "..temp1.avg..", id: "..temp1.id3.." for skill: " .. temp1.sk3)
    			end
    			temp1.num=1
    			temp1.avg=profit[curskill]
    			temp1.sk2=curskill
    			temp1.id=id[curskill]
    			temp1.pr=profit[curskill]
    			temp1.id3=id3[curskill]
    			temp1.sk=curskill
    			temp1.sk3=curskill
    		end
    		
    	end
    	for k,l in pairs(combines[temp1.id3]) do
    		if type(l)=="table" then
    			if l.stats then
    				DEFAULT_CHAT_FRAME:AddMessage("buy directly: "..l.name)
    			end
    		end
    	end
    	DEFAULT_CHAT_FRAME:AddMessage("final result: "..temp1.id..", cost/skillup: "..temp1.avg..", id: "..temp1.id3.." for skill: " .. temp1.sk3)
    	DEFAULT_CHAT_FRAME:AddMessage("price to achieve all these skillups: " .. totcost)
    end
    function TradeskillInfo:findcheapmake(id2,onlyknown,ski3)
    	if strlen(id2)>1 then
    		spec=strsub(id2,2,strlen(id2)-1)
    		id2=strsub(id2,1,1)
    	end
    	combines=self:getthedata(id2,onlyknown,spec)
    	profit=-1000000000
    	id=0
    	id3=0
    	ski2=0
    	for i,j in pairs(combines) do
    		if type(j)=="table" then
    			cost=0
    			for k,l in pairs(j) do
    				if type(l)=="table" then
    					cost=combines[i][k].cost*combines[i][k].num+cost
    				end
    			end
    			profit2=0-cost
    			if combines[i].grey and combines[i].grey>0 and combines[i].yellow and combines[i].yellow>0 and combines[i].orange and combines[i].orange>0 then
    				
    				curskill=ski3 or TradeskillInfo:GetCharSkillLevel(UnitName("player"),id2) or 0
    				skilluprate=(curskill-combines[i].grey)/(combines[i].yellow-combines[i].grey)
    				pessemism=1
    				if curskill<combines[i].orange then
    					skilluprate=0.000000000001
    				elseif curskill < combines[i].yellow then
    					skilluprate=1
    				elseif curskill<combines[i].green then
    					pessemism=1.1
    				elseif curskill<combines[i].grey then
    					pessemism=1.3
    				else
    					skilluprate=0.000000000001
    				end
    				profit2=profit2/skilluprate/pessemism
    				if profit2>profit then
    					profit=profit2
    					id=combines[i].name
    					id3=i
    					ski2=skilluprate
    					
    				end
    			else
    				DEFAULT_CHAT_FRAME:AddMessage("requesting skillup data for: "..combines[i].name..", id: "..i)
    				
    			end
    		end
    	end
    	for k,l in pairs(combines[id3]) do
    		if type(l)=="table" then
    			if l.stats then
    				DEFAULT_CHAT_FRAME:AddMessage("buy directly: "..l.name)
    			end
    		end
    	end
    	DEFAULT_CHAT_FRAME:AddMessage("final result: "..id..", cost/skillup: "..profit..", id: "..id3..", skilluprate: "..ski2.." for skill: " .. curskill)
    end
    function TradeskillInfo:getthedata(skill2,onlyknown,spec)
    	local name=UnitName("player")
    	local skills={}
    	local combines={}
    	local combines2={}
    	local pick1=0
    	local pick2=0
    	for skill,level in pairs(TradeskillInfo.db.realm.userdata[TradeskillInfo.vars.playername].skills) do
    		skills[skill] = level;
    	end
    	for id,skill in pairs(TradeskillInfo.vars.combines) do
    	
    		if (not onlyknown or TradeskillInfo:IsCombineKnowByChar(name,id)) and not TradeskillInfo.db.profile.skipme[id] and TradeskillInfo:GetCombineFactionAvailable(id) then
    			combines[id] = skill;
    		end
    	end
    	for h,i in pairs(combines) do
    		
    		local pick3=self:GetCombine(h) --level yield name
    		local supertemp=false
    		
    		if pick3 and skill2==pick3.skill and (not spec or pick3.spec=="" or pick3.spec==spec or strsub(spec,1,1)==pick3.spec) then
    			if h==30069 then
    			DEFAULT_CHAT_FRAME:AddMessage("spec is "..pick3.spec)
    			end
    			combines2[h]={}
    			combines2[h].name=pick3.name
    			combines2[h].yield=pick3.yield
    			combines2[h].skill=pick3.skill
    			if h>0 then
    				combines2[h].sell=AucAdvanced.API.GetAlgorithmValue("StdDev",h) or GetSellValue(h) or 1000000
    			else
    				combines2[h].sell=0
    			end
    			pick3=self:GetCombineComponents(self:MakeSpecialCase2(h))
    			for k,j in pairs(pick3) do
    				local temp1,temp2=self:getsubcomponentcost(k,j,h)
    				combines2[h][k]={}
    				combines2[h][k].source=TradeskillInfo.vars.sources[j.source]
    				combines2[h][k].num=j.num
    				combines2[h][k].name=j.name
    				combines2[h][k].cost=temp1
    				combines2[h][k].id=j.id
    				combines2[h][k].stats=temp2
    				
    			end
    			local string1=TradeskillInfo:GetUnColoredDifficulty(h)
    			if strsub(string1, 1,5) == "skill" then
    				local _,string2=strsplit("(",string1)
    				combines2[h].orange=strsplit(")",string2)
    				combines2[h].orange=tonumber(combines2[h].orange) or 0
    				
    			elseif strlen(string1)>1 then
    				combines2[h].grey,_,combines2[h].yellow,combines2[h].orange=strsplit("/", string1)
    				)
    				combines2[h].orange=tonumber(combines2[h].orange) or 0
    				if combines2[h].orange==0 then 
    					combines2[h].orange=tonumber(combines2[h].yellow) or 0 
    				end
    				combines2[h].yellow=tonumber(combines2[h].yellow) or 0
    				combines2[h].grey=tonumber(combines2[h].grey) or 0
    				combines2[h].green=(combines2[h].yellow+combines2[h].grey)/2
    				[h].orange..",, "..string1)
    			else
    				DEFAULT_CHAT_FRAME:AddMessage("no skillup data for: "..combines2[h].name..", id: "..h..", "..string1)
    			end
    		end
    	end
    	return combines2
    end
    function TradeskillInfo:getsubcomponentcost(id,data1,id2)
    if not data1 then 
    	return 1000000,0 
    end
    local temp1
    local temp2
    local temp3
    local temp4
    local lowcost
    if data1.id==17 or data1.id==18 or data1.id==19 or data1.id==20 then
    	data1.source="M"
    end
    if data1.id==21884 or data1.id==21885 or data1.id==22452 or data1.id==22451 then
    	data1.source="M"
    end
    if not data1.source then
    	DEFAULT_CHAT_FRAME:AddMessage("warning! invalid recipy found! probably a typo in the data, fix component "..id..",for recipy id "..id2)
    	for i,j in pairs(data1) do
    		DEFAULT_CHAT_FRAME:AddMessage(i..", "..j)
    	end
    	return 1000000,0 
    end
    if strsub(data1.source, 1, 1)=="V" then
    	lowcost=data1.cost or 0
    elseif strsub(data1.source, 1, 1)=="C" then
    	temp1,temp3,temp4=AucAdvanced.API.GetAlgorithmValue("StdDev",data1.id) or 1000000;
    	if temp1==0 then 
    		temp1=1000000 
    	end
    	
    	pick3=self:GetCombineComponents(self:MakeSpecialCase2(data1.id))
    	lowcost=1000000
    	
    	if type(pick3)=="table" then
    		for k,j in pairs(pick3) do
    			
    			lowcost=lowcost+self:getsubcomponentcost(k,j,id2)*j.num
    		end
    		if lowcost > temp1 then
    			lowcost=temp1
    			--DEFAULT_CHAT_FRAME:AddMessage("buy "..data1.name.." directly")
    			temp2=id
    		end
    	else
    		DEFAULT_CHAT_FRAME:AddMessage("error on "..id2.." "..data1.id)
    	end
    else
    	lowcost,temp3,temp4 = AucAdvanced.API.GetAlgorithmValue("StdDev",data1.id) or 1000000;
    	if lowcost==0 then 
    		lowcost=1000000 
    	end
    end
    return lowcost,temp2
    end
    function TradeskillInfo:MakeSpecialCase2(id)	
    	if not self.vars.specialcases[id] then
    		return id;
    	end
    	local tempstr=tostring(id)
    	for k,v in pairs(self.vars.specialcases) do
    		local tempstr2=strsplit("|",v)
    		if tempstr==tempstr2 then
    			return k
    		end
    	end
    	return id;
    end


    all functions work for me for all tradeskills so if theres a bug its not entirly my fault ^_^ if you have a problem from this try smacking me around on corvix on kilrogg, im not always very active, try a wow mail.
    btw special recipies are a little flakey, it just grabs the first one, there could be multiples. i also set it to ignore the primal transmutes since those are you know 1 day reuse. there are probably a few others that should be added because of that reuse.
    Posted in: General AddOns
  • To post a comment, please or register a new account.