There is your problem, your storing the values as a single string seperated by commas, not as indexes. So your set function is not working correctly or your Get Function is not passing the right values back.
Really you should rethink what your doing here, creating a new table on each set is classically considered bad form; so it begs the question, what are you trying to do with the config window, we might be able to tell you of a better way :)
In short I am trying to make a random mount caster
for all the dif type of area, ground, flying, and sea. I want to store the numbers of the mount ex. out of 12 on each page using the numbers say 3 are flyers, number 2 across, number 5 across and so on, would look like 2,5,...
I was using the options and acedb so i could have diff profiles for each toon. you would go into interface>addons tab and select my addon in txt boxes were numbers 2,5,... for ground mounts, and in the flying mounts was 1,3,... what ever the numbers are will randomly choose a mount and cast.
set = function(item, value) OxyAddon.db.profile[item[#item]] = value end,
This is my set function:
function OxyAddon:SetGroundMounts(info, newValue)
self.db.profile.GroundMount = { strsplit(";", newValue) }
end
This is my get:
get = function(item) return OxyAddon.db.profile[item[#item]] end,
This is my get function:
function OxyAddon:GetGroundMounts(info)
self.string = ""
for index,value in ipairs(self.db.profile.GroundMount) do
self.string = self.string..value..";"
end
return self.string
end
Yes, it is. The get function in an AceOptions table receives the options node as the first parameter. It's usually referred to as info rather than item, but the name assigned to the variable does not affect its contents.
Yes, it is. The get function in an AceOptions table receives the options node as the first parameter. It's usually referred to as info rather than item, but the name assigned to the variable does not affect its contents.
Right, my bad... sorry didn't see that variable name change. As you said, i was expecting info not item :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
When I run this it returns a hex number or similar, but mot the actual data I have entered.
Question is How do I store a array in the acedb and or fetch it for later use.
Thank you, Any help would be great.
Nevermind, i know what it's going to look like, an sequenctially indexed table...
IMO, you need to redesign your config window to be more effective. [[ { strsplit(";", newValue) } ]] this is a bad thing to use often.
The Database contents look like this.
Really you should rethink what your doing here, creating a new table on each set is classically considered bad form; so it begs the question, what are you trying to do with the config window, we might be able to tell you of a better way :)
for all the dif type of area, ground, flying, and sea. I want to store the numbers of the mount ex. out of 12 on each page using the numbers say 3 are flyers, number 2 across, number 5 across and so on, would look like 2,5,...
I was using the options and acedb so i could have diff profiles for each toon. you would go into interface>addons tab and select my addon in txt boxes were numbers 2,5,... for ground mounts, and in the flying mounts was 1,3,... what ever the numbers are will randomly choose a mount and cast.
Thanks! Any help is great.
This is my set function:
This is my get:
This is my get function:
Any help would be great, thanks again guys.
Right, my bad... sorry didn't see that variable name change. As you said, i was expecting info not item :)