Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

pilotofsomething

Members
  • Content Count

    1
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by pilotofsomething

  1. An API that makes creating and reading configuration files easier. Any line starting with a '#' is ignored in config files.

    Documentation:
    
    loadConfig(string: path)
    	Returns a stream of the file the path points to.
    
    saveConfig(string: path)
    	Creates a config file at the given path. If a config file with the same name already exists it will be overwritten.
    
    flush()
    	Clears all properties currently in memory.
    
    addProperty(string: name, value)
    	Adds a property to the config. Note that the order properties appear in the config is the same order that the functions are called in.
    
    addComment(string: text)
    	Adds a comment to the config. Comments are lines that start with '#', you could do this with addProperty, but this saves memory and doesn't add an '=' at the end of the line.
    
    getNumber(stream: file, string: name): number
    	Returns the value of property 'name' as a number.
    
    getBoolean(stream: file, string: name): boolean
    	Returns the value of property 'name' as a boolean.
    
    getString(stream: file, string: name): string
    	Returns the value of property 'name' as a string.

    Download:

    pastebin get wE9xT51N /lib/config.lua

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.