mikma.lua
1,18 → 1,97
local f = CreateFrame("Frame") |
f:RegisterEvent("MERCHANT_SHOW") |
f:SetScript("OnEvent", function() |
--if (event == "MERCHANT_SHOW") then |
-- autorepair levels over 40 |
if UnitLevel("player") > 39 then RepairAllItems() end |
-- sell grey crap |
for bag=0,4 do |
for slot=0,GetContainerNumSlots(bag) do |
local link = GetContainerItemLink(bag, slot) |
if link and select(3, GetItemInfo(link)) == 0 then |
ShowMerchantSellCursor(1) |
UseContainerItem(bag, slot) |
end |
f:RegisterEvent("PLAYER_ENTERING_WORLD") |
f:RegisterEvent("PLAYER_REGEN_ENABLED") |
f:RegisterEvent("PLAYER_REGEN_DISABLED") |
f:SetScript("OnEvent", function(self, event, ...) |
if self[event] then return self[event](self, event, ...) end |
end) |
|
function f:PLAYER_REGEN_ENABLED() |
f:RegisterEvent("SKILL_LINES_CHANGED") |
end |
|
function f:PLAYER_REGEN_DISABLED() |
f:UnregisterEvent("SKILL_LINES_CHANGED") |
end |
function f:PLAYER_ENTERING_WORLD() |
f:RegisterEvent("SKILL_LINES_CHANGED") |
f:SKILL_LINES_CHANGED() |
end |
|
function f:MERCHANT_SHOW() |
-- autorepair levels over 40 |
if UnitLevel("player") > 39 then |
RepairAllItems() |
end |
-- sell grey crap |
for bag=0,4 do |
for slot=0,GetContainerNumSlots(bag) do |
local link = GetContainerItemLink(bag, slot) |
if link and select(3, GetItemInfo(link)) == 0 then |
ShowMerchantSellCursor(1) |
UseContainerItem(bag, slot) |
end |
end |
--end |
end) |
\ No newline at end of file
+ end
+end
+
+local mikmaTooltip = CreateFrame("MessageFrame", nil, UIParent)
+mikmaTooltip:SetSize(250, 35)
+mikmaTooltip:SetPoint("BOTTOMLEFT",ChatFrame1,"BOTTOMRIGHT", 10, 0)
+mikmaTooltip:SetInsertMode("TOP")
+mikmaTooltip:SetJustifyH("LEFT")
+mikmaTooltip:SetFrameStrata("HIGH")
+mikmaTooltip:SetTimeVisible(60)
+mikmaTooltip:SetFadeDuration(10)
+mikmaTooltip:SetFont(STANDARD_TEXT_FONT, 15, "OUTLINE")
+--local background = mikmaTooltip:CreateTexture(nil,"BACKGROUND")
+--background:SetAllPoints()
+--background:SetTexture(0,0,0,0.5)
+
+function f:SKILL_LINES_CHANGED()
+ mikmaTooltip:Clear()
+ local prof1, prof2, archaeology, fishing, cooking, firstAid = GetProfessions()
+
+ local race,fromMax,extra,upgrade = UnitRace("player"),25,0
+
+ if prof1 ~= nil then
+ local name, texture, rank, maxRank, numSpells, spelloffset, skillLine, rankModifier, specializationIndex, specializationOffset = GetProfessionInfo(prof1)
+ if race == "Gnome" and name == "Engineering" then
+ fromMax = 40
+ extra = 15
+ end
+ if rank == 600+extra then
+ return
+ elseif rank > maxRank-fromMax then
+ if maxRank <= 600+extra then
+ upgrade = ""
+ else
+ upgrade = " |cFFFF0000(Upgrade available!)|r"
+ end
+ else
+ upgrade = ""
+ end
+ mikmaTooltip:AddMessage("|T"..texture..":0|t "..rank.."/"..maxRank..upgrade)
+ end
+
+ if prof2 ~= nil then
+ local name, texture, rank, maxRank, numSpells, spelloffset, skillLine, rankModifier, specializationIndex, specializationOffset = GetProfessionInfo(prof2)
+ if race == "Gnome" and name == "Engineering" then
+ fromMax = 40
+ extra = 15
+ end
+ if rank == 600+extra then
+ return
+ elseif rank > maxRank-fromMax then
+ if maxRank <= 600+extra then
+ upgrade = ""
+ else
+ upgrade = " |cFFFF0000(Upgrade available!)|r"
+ end
+ else
+ upgrade = ""
+ end
+ mikmaTooltip:AddMessage("|T"..texture..":0|t "..rank.."/"..maxRank..upgrade)
+ end
+end
\ No newline at end of file