Jump to content




[1.3+] O'Reillys Persistent Variables (Tables, Encryption, Namespaces...)

api utility lua

  • You cannot reply to this topic
1 reply to this topic

#1 oreillynz

  • New Members
  • 14 posts

Posted 05 April 2012 - 01:17 PM

Why another persistent variable api?

- Accepts table's within tables, and self referencing tables thanks to immibis' awesome serialize library
- For the paranoid, you can 'drop in' encryption and decryption functions
- Very simple to use


Requirements

- Immibis' serialize
- Tomass' String Utils


About Namespaces

Namespaces are for things like different programs, eg "Router", so you don't need to worry about multiple programs messing up each other's saved position or similar behaviour. If a namespace contains the '/' character, it will be treated like a file path, and sub directories will be created within that namespace.


Functions
Spoiler


Usage
Spoiler


Using encryption:
Spoiler


What can persistent variables be used for?

Saving and then building a blueprints via nestled tables
Remembering a computers location + messages for GPS and router systems
Letting computers remember what program they were running and what they were doing when they start,
Or having turtles remember where they are...


Code:

Spoiler


The API assumes StrUtils is find in "/strutils/StrUtils" and serialize in "/immibis/serialize" - this can easily be changed at the top of the code.

#2 Ciber

  • New Members
  • 4 posts

Posted 08 April 2012 - 06:24 AM

Nice, very usefull





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users