Posted 17 May 2015 - 05:19 PM
Hello! If you are reading this, I presume your looking for a ComputerCraft Registry API!
Well, your in luck! I have invented a registry API for you to replace separate configuration files and just have keys! (AKA this is some sort of configuration API, but a bit better as it hides the files ;)/> ) Let me show you how it works.
I have loaded the API as "Registry".
Registry.openReg()
This opens the registry, allowing access to the Keys table.
Registry.closeReg()
This closes the registry, wiping the Keys table.
Registry.createKey( keyName, value )
This creates a key in the registry, where keyName is the key's name and value is anything.
Registry.deleteKey( keyName )
This deletes a key in the registry, where keyName is the key's name.
Registry.getKeyAmount()
Returns the amount of keys currently inside the registry.
Registry.Keys[ keyName ]
Gets the value of the key, where keyName is the key's name.
Registry,modifyKey( keyName, value )
Changes the value of a key, where keyName is the key's name and value is the value.
All functions return true and false respectively if they succeeded or failed (except for getKeyAmount() and Keys[]).
To download, simply run:
pastebin get MRRGbq76 Registry
in shell.
Edited on 04 August 2015 - 06:41 AM