Jump to content

Digest Jan-Feb

We talk about what was done and updated in the past month. We help keep abreast of events.

January February

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

The Addons Updater

Let us to introduce the addons updating software and to share the details

Read more Download

the new ConfigSection API

Guest Morted

Recommended Posts

Hi there,

if have a quick question about the new AP functions:

How can you save/load data in custom Config.txt files?

AddonsTools does so, and TargetManager as well.

But how the hell do you do it? (i tried understanding your code, of cause)

shouldnt this save an entry to the "local" config.txt:

local cfg = {}

cfg["test"] = "insert"


but it doesnt work.

Could anyone tell me why?

Link to comment
Share on other sites

I use:

local lConfig = userMods.GetAvatarConfigSection( common.GetAddonName().."DnD" ) or {}

This creates "lConfig" variable. If there is data in section called "addonnameDnD" then lConfig takes that data, otherwise lConfig is an empty table.

Then i use:

I change lConfig variable (for example set lConfig.DNDenabled to true) and use:

userMods.SetAvatarConfigSection( common.GetAddonName().."DnD", lConfig )

And that works fine. Do you get any errors, or can you show a little bit more of code?

The data is not saved into some custom config.txt, it's saved into user.cfg and global.cfg files.

Link to comment
Share on other sites

well how DO you save/read the custom config.txt then?^^

There must be a way of accessing those files, this is from the AddonDesc of TargetsManager:

<Item href="Scripts/Globals.luac" />

<Item href="config.txt" />

<Item href="Locales/Locales.lua" />

but how the hell do they work with the config.txt?

Link to comment
Share on other sites

They do not work with config.txt.

Her config.txt is just a lua script, you can't change it from ingame.

"They" open config.txt and change it via text editor.

Link to comment
Share on other sites

Please ask icreator about her addons and stuff, but her config.txt is just a simple lua script. Cant modify it from ingame.

It's usefull since she has all files compiled and you can't change them, but that one is not compiled and you can change it. And it's extension is txt instead of lua so ppl can edit it with notepad without explanation.

But it's still a lua script. It's executable lua script. No more.

You may have

<Item href="config.txt" />

<Item href="Documents/Mypornmovie.avi" />

But it'll (i believe) still work if it's just a lua script.

Link to comment
Share on other sites

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using our site you agree to the Terms of Use