/
RanchGameTip:CreateFontString( "$parentTextLeft1", nil, "GameTooltipText" ), |
RanchGameTip:CreateFontString( "$parentTextRight1", nil, "GameTooltipText" ) |
); |
ranch_temp = {} |
function Ranch_Command(slashargs) |
local startPos, endPos, firstWord, restOfString = string.find(slashargs, "(%w+)[%s%p]*(.*)"); |
firstWord = strlower(firstWord) |
if firstWord == "track" then |
ranchtrack = restOfString |
if restOfString == "" or restOfString == nil then |
ranchtrack = nil |
else |
ranchtrack = restOfString |
end |
elseif firstWord == "temp" then |
ranch_temp[Ranch_ItemID(restOfString)] = true |
elseif firstWord == "add" then |
if restOfString ~= nil and restOfString ~= "" then |
local itemID = Ranch_ItemID(restOfString) |
ranch_perm[ItemID] = true |
end |
elseif firstWord == "remove" then |
if restOfString ~= nil and restOfString ~= "" then |
local itemID = Ranch_ItemID(restOfString) |
local temptable = {} |
local k,v |
for k,_ in pairs(ranch_perm) do |
if k ~= itemID then |
temptable[k] = true |
end |
end |
ranch_perm = temptable |
temptable = nil |
end |
elseif firstWord == "removeall" then |
ranch_perm = {} |
end |
end |
function Ranch_ItemID(itemLink) |
local found, _, itemString = string.find(itemLink, "^|c%x+|H(.+)|h%[.*%]") |
if itemString == nil then |
found, _, itemString = string.find(itemLink, "^c%x+|H(.+)|h%[.*%]") |
end |
if itemString == nil then |
return nil |
else |
local _, itemId, enchantId, jewelId1, jewelId2, jewelId3, jewelId4, suffixId, uniqueId = strsplit(":", itemString) |
return itemId |
end |
end |
SLASH_RANCH1 = "/ranch" |
SlashCmdList["RANCH"] = Ranch_Command; |
local ContainerItemLink = GetContainerItemLink(i,j) |
if ContainerItemLink ~= nil then |
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture = GetItemInfo(ContainerItemLink) |
local itemId = Ranch_ItemID(itemLink) |
if itemType == "Trade Goods" then |
if ranch_items[itemSubType] == nil then |
ranch_items[itemSubType] = {} |
end |
local found, _, itemString = string.find(itemLink, "^|c%x+|H(.+)|h%[.*%]") |
local _, itemId, enchantId, jewelId1, jewelId2, jewelId3, jewelId4, suffixId, uniqueId = strsplit(":", itemString) |
if ranch_items[itemSubType][itemId] == nil then |
ranch_items[itemSubType][itemId] = GetItemCount(itemLink) |
end |
ranch_boe[itemLink] = GetSellValue(itemLink) |
end |
end |
if ranch_temp[itemId] ~= nil then |
ranch_temp[itemId] = GetItemCount(itemLink) |
end |
end |
end |
end |
self:AddDoubleLine(itemLink,itemCount) |
end |
end |
if Ranch_tcount(ranch_perm) > 0 then |
self:AddLine(" ") |
self:AddLine("Custom") |
local i,v |
for i,v in pairs(ranch_perm) do |
if v then |
local _, itemLink = GetItemInfo(i) |
self:AddDoubleLine(itemLink, GetItemCount(itemLink)) |
end |
end |
end |
if Ranch_tcount(ranch_temp) > 0 then |
self:AddLine(" ") |
self:AddLine("Temporary") |
local i,v |
for i,v in pairs(ranch_temp) do |
local _, itemLink = GetItemInfo(i) |
self:AddDoubleLine(itemLink, GetItemCount(itemLink)) |
end |
end |
if ranch_junk then |
self:AddLine(" ") |
local textcash |
end |
self:AddDoubleLine("Junk:", textcash) |
end |
if ranchtrack ~= nil then |
dataobj.text = ranchtrack.." - "..GetItemCount(ranchtrack) |
end |
end |
function Ranch_FormatCash(cash) |
end |
textcash = textcash.."|cFFFFFFFF"..copper.."|r|cffeda55fc|r" |
return gold, silver, copper, textcash |
end |
## Notes: Keeps track of items you've farmed. |
## Author: Sekrin@Argent Dawn-EU |
## Version: 1.0.wowi:revision |
## SavedVariablesPerCharacter: ranch_items, ranch_options |
## SavedVariablesPerCharacter: ranch_perm, ranch_options |
ranch.lua |