How to save?

Here you can find plenty of help with your general coding needs and projects
If it is about a specific program, use the corresponding forum
DO NOT ask basic questions such as "How do I print a variable", use Google for that

How to save?

Postby pulsum » Wed Jul 19, 2006 12:02 am

Hi,
after some work I managed it to extract the informations I need.
Now I habe some problems saving the information.
In my .toc file I inserted: ## SavedVariables: varA,varB

In my addOn.lua file I collect information into an array.
How do I write the complete array-content into varA, so that it appears in my savingVariables\addOn.lua file?
I can write single strings into my varibles and they appear in the save-file after exiting the game, but with my array-content I have some problems.
Maybe someone can help me or giving me a hint?

Regards...
User avatar
pulsum
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Sat Jul 08, 2006 1:56 am

Re: How to save?

Postby zeryl » Wed Jul 19, 2006 12:29 am

This would be better asked in the UI & Macro forum over at worldofwarcraft.com

Sorry I can't give much more than that :(
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

Re: How to save?

Postby pulsum » Wed Jul 19, 2006 7:28 pm

zeryl wrote:This would be better asked in the UI & Macro forum over at worldofwarcraft.com

Sorry I can't give much more than that :(


well, ehm...did I use the wrong board? I thought in here we're talking about coding, including LUA and PHP for using characterProfiler and/or guildRoster ;-)
Sorry for posting this in here. :-) I will try this in the wow forum and if someone in here's interested in the answer, leave me a message ;-)

Regards...
User avatar
pulsum
WR.net Apprentice
WR.net Apprentice
 
Posts: 7
Joined: Sat Jul 08, 2006 1:56 am

Re: How to save?

Postby zeryl » Wed Jul 19, 2006 7:51 pm

Well, the only unfortunate thing is that I only modify other addon's to my taste, and I can't write one from the ground up.

I'm not sure that we have many people here that are up to speed on LUA and addon coding. I just think you'll get an answer quicker if you were to post it on the WoW forums.
User avatar
zeryl
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 194
Joined: Tue Jul 04, 2006 12:59 pm
Location: Saint Louis

How to save?

Postby zanix » Thu Jul 20, 2006 3:19 am

The only one around here that has even made a wow addon was hannah, author of the "Shopping" addon which is posted here
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: How to save?

Postby Hannah » Tue Aug 15, 2006 1:30 pm

Ups sry, better late than never :)

Try this:

Code: Select all

varA 
= {}

local datastore = {}
datastore.data1 "Hello"
datastore.data2 10
datastore
.callitwhatever "Test"

table.insert(varAdatastore)

-- 
This is how you retrieve the data
local n 
table.getn(varA)

for 
t,q in varA do
    -- 
t is a numberthe index for the value in the table
    
-- q is 'datastore'egyou can use q.data1 and q.callitwhatever
end


If you set varA as SavedVariable in .toc file WoW saves this data
if you leave/logout

Nice link:
http://www.wowwiki.com/HOWTO:_Save_Variables_Between_Game_Sessions

Hope this helps...

Cu

Hannah
User avatar
Hannah
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 142
Joined: Tue Jul 04, 2006 1:41 pm
Location: Germany, Cologne


Return to General Code Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron