This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
lua:savetbl [2014/12/24 05:32] vodur |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====savetbl==== | ||
- | Syntax: savetbl( filename, table) | ||
- | Saves 'table' in a file named according to 'filename' arg in the area directory (home area, not current area) of the mob/obj/area calling savetbl. | ||
- | |||
- | Example: | ||
- | <code lua> | ||
- | local abc={1,2,3} | ||
- | savetbl("whatev", abc) | ||
- | </code> | ||
- | |||
- | ====loadtbl==== | ||
- | Syntax: loadtbl( filename ) | ||
- | |||
- | If 'filename' file exists in the area directroy of the mob/obj/area calling loadtbl then returns the table stored in it, otherwise returns nil. | ||
- | Example: | ||
- | <code lua> | ||
- | local oink=loadtbl("whatev") | ||
- | </code> | ||
- | |||
- | |||
- | Example script: | ||
- | [[:lua:scripting:examples:sharinginfo|Sharing Info Between Progs]] |