Originally Posted by
Bobita70
Apologies for being a bit off topic here but ... does anybody has an interrupt file that can do disenchanting .. I know there is a milling one but I do not know anything about coding and dont know how to create one or modify the milling one, and it will make life so much easier
Thanks for sharing
Onya had 1.
Here is the code
Ability:
Tradeskill
Code:
local prof1,prof2 = GetProfessions()
local p1name
local p2name
haveench = 0
havejc = 0
if prof1 then p1name = GetProfessionInfo(prof1) end
if prof2 then p2name = GetProfessionInfo(prof2) end
if p1name == "Jewelcrafting" or p2name == "Jewelcrafting" then havejc = 1 end
if p1name == "Enchanting" or p2name == "Enchanting" then haveench = 1 end
--- loot open loot windows
gotloot = GetNumLootItems()
if gotloot > 0 then
for i = 1,gotloot do
LootSlot(i)
return true
end
end
if gotloot == 0 then CloseLoot() end
--- count free normal bag slots
freenormal = 0
for bag = 0,4 do
local freeSlots, bagType = GetContainerNumFreeSlots(bag)
if bagType == 0 then freenormal = freenormal + freeSlots end
end
if UnitCastingInfo("player") then return true end
next ability is Disenchant
Code:
local tode = {77109,77229, 83793,90904} --this is the item id of what you want to disenchant
if haveench == 1 and gotloot == 0 then
--- disenchant ---
for bag = 0,4 do
local w = GetContainerNumSlots(bag)
for slot=1,w do
local item = GetContainerItemLink(bag,slot)
if item then
local itemId = GetContainerItemID(bag, slot)
for _,v in ipairs(tode) do
if not
itemId == v then
CastSpellByID(13262)
if SpellIsTargeting() then UseContainerItem(bag,slot) end
return true
end
end
local _,c = GetContainerItemInfo(bag,slot)
local iname = GetItemInfo(GetContainerItemLink(bag,slot))
if c > 2 and (iname == "Lesser Celestial Essence" or iname == "Small Heavenly Shard") then
UseContainerItem(bag,slot)
return true
end
end
end
end
end