Issued some rework so that those of you who can't/won't learn how to use profiles can continue doing things semi-manual or whatever you're doing now.
@Underwhelp, to help explain why you're not getting the results you want, let me explain this section of code you're looking at.
The important part of this, is not the loop counter, it is the last 2 lines. 1-15 is simply the counter to concatenate the number onto the GUI variables we have created in the UIInit(). Without these GUI variables being in existence, you could count to a million, but only 1-15 will do anything.
In the UIInit() we have to create these variables as such.
Note that the only thing the collectibles table is even used for is default values for these GUI items.
Here, the (47,120) basically means we want all UI items that are 47 (seafood), which have an item level of 120 or higher. If you wanted to produce items lower than this, you will need to adjust this number or it will not appear in the combobox.
For the rest of the loop, it simply checks each value-pair in the GUI items using the information we pulled in the first part up top.
TL;DR - The table is just a reference for defaults, the GUI is what is being read.
@Underwhelp, to help explain why you're not getting the results you want, let me explain this section of code you're looking at.
Code:
for i = 1,15 do
local var = _G["gFishCollectibleName"..tostring(i)]
local valuevar = _G["gFishCollectibleValue"..tostring(i)]
The important part of this, is not the loop counter, it is the last 2 lines. 1-15 is simply the counter to concatenate the number onto the GUI variables we have created in the UIInit(). Without these GUI variables being in existence, you could count to a million, but only 1-15 will do anything.
In the UIInit() we have to create these variables as such.
Note that the only thing the collectibles table is even used for is default values for these GUI items.
Code:
for i = 1,15 do
Settings.FFXIVMINION["gFishCollectibleName"..tostring(i)] = IsNull(Settings.FFXIVMINION["gFishCollectibleName"..tostring(i)],ffxiv_task_fish.collectibles[i].name)
Settings.FFXIVMINION["gFishCollectibleValue"..tostring(i)] = IsNull(Settings.FFXIVMINION["gFishCollectibleValue"..tostring(i)],ffxiv_task_fish.collectibles[i].minimum)
end
Here, the (47,120) basically means we want all UI items that are 47 (seafood), which have an item level of 120 or higher. If you wanted to produce items lower than this, you will need to adjust this number or it will not appear in the combobox.
Code:
local group = "Collectible"
local uistring = IsNull(AceLib.API.Items.BuildUIString(47,120),"")
for i = 1,15 do
GUI_NewComboBox(winName,"Collectible","gFishCollectibleName"..tostring(i),group,uistring)
GUI_NewField(winName,"Min Value","gFishCollectibleValue"..tostring(i),group)
end
Code:
for i = 1,15 do
_G["gFishCollectibleName"..tostring(i)] = Settings.FFXIVMINION["gFishCollectibleName"..tostring(i)]
_G["gFishCollectibleValue"..tostring(i)] = Settings.FFXIVMINION["gFishCollectibleValue"..tostring(i)]
end
For the rest of the loop, it simply checks each value-pair in the GUI items using the information we pulled in the first part up top.
Code:
if (var and var ~= "" and tonumber(valuevar) > 0) then
local itemid = AceLib.API.Items.GetIDByName(var,47)
if (itemid) then
if (info.itemid == itemid) then
if (info.collectability >= tonumber(valuevar)) then
validCollectible = true
else
fd("Collectibility was too low ["..tostring(info.collectability).."].")
end
else
fd("Collectible was not the item we are looking for.")
fd("Looking for ["..tostring(itemid).."], got ["..tostring(info.itemid).."]")
end
else
fd("Could not find an item ID for:" .. var)
end
end
end
TL;DR - The table is just a reference for defaults, the GUI is what is being read.