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

BrisingrAerowing

Members
  • Content Count

    153
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by BrisingrAerowing

  1. MapUtils is a utility library for Adventure/Puzzle/Parkour/etc map makers that want to use OpenComputers to handle the logic behind the map. It is currently being developed, and is intended to have a large number of methods for easing the burden of map making.

    Methods include:

    • Checking whether the player is within certain (cuboid) bounds
    • Managing a player's inventory
    • Placing/removing blocks
    • Moving the player around
    • More to come...

    This utility is currently being developed, and is not ready for use yet. I will post a link when I get further along with it.

    Also, submit your ideas for methods for this library.

  2. A quick way to get the documentation of a function is to use the component.doc method.

    Here is a quick (and untested) script to use this function.

    local component = require("component")
    
    local args = {...}
    
    if #args ~= 2 then
    	print("USAGE: getdoc <component address> <method name>")
    	return
    end
    
    print(component.doc(args[1], args[2]))

    The script needs the UUID address of the component.

    There are other projects on these forums that allow viewing documentation. Take a look around for them.

  3. Well, the error says the syntax is invalid, and it is. If you want to execute the message, then you need to do something like this:

     

    load(message1)()

     

    This loads the code and compiles it, then the empty parenthesis afterwards executes it.

  4. OpenKVS is a basic Key-Value store for OpenComputers, based off of the Tincan library.

     

    API:

    kvs.set(key, value) -- Sets a key-value pair. Returns the set value
    kvs.get(key) -- Gets the value for the specified key. Returns that value
    kvs.delete(key) -- Deletes the specified key-value pair. Returns nil
    kvs.exists(key) -- Returns true if the specified key exists.
    kvs.decr(key, amount) -- Decrements the specified numeric key by the specified amount, or 1 if not specified.
    kvs.incr(key, amount) -- Increments the specified numeric key by the specified amount, or 1 if not specified.
    kvs.load(file) -- Loads the specified file into the store
    kvs.save(file) -- Saves the store into the specified file

     

    Download:

    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/openkvs/openkvs.lua /lib/openkvs.lua

     

  5. Is it possible to create and send custom events? I would like to do so in my proximity door daemon so that people can act on allowed or denied entities (like triggering a lockdown and alarm for an intruder).

  6. This program is a service/daemon that automatically opens doors based on input from motion sensors.

    Features:

    • Any arbitrary number of doors, each with its own configuration
    • Events on entity allowed/denied
    • Logging of access attempts
    • Plugin support

    Installation:

    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/gryphonlib/gryphonlib.lua /lib/gryphonlib.lua
    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/inifile/inifile.lua /lib/inifile.lua
    mkdir /etc/proxdoor.d
    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/proxdoord/proxdoord.lua /etc/rc.d/proxdoord.lua
    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/proxdoord/proxdoor.cfg /etc/proxdoor.cfg
    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/proxdoord/proxdoor.d/example.cfg.noload /etc/proxdoor.d/example.config.noload
    mkdir /lib/proxdoor/plugins
    wget -f https://github.com/BrisingrAerowing/OC-Programs/raw/master/proxdoord/plugins/example_plugin.lua /lib/proxdoor/plugins/example_plugin.lua

     

    The last two files are an example door configuration and an example plugin.

     

    Configuration file outline:

    Main Configuration File:

    [general]
    config_dir = /etc/proxdoor.d # Door Configuration Directory
    plugin_dir = /lib/proxdoor/plugins # Plugin directory
    event_on_entity_denied = true # Fire an event (proxdoor_access) on denying an entity
    event_on_entity_allowed = true # Fire an event (proxdoor_access) on allowing an entity
    
    [logging]
    log_file_path = /var/log/proxdoord # The directory log files are written to
    general_log_file_name = general.log # The name of the general log file (Initialization stuff)
    general_log_enabled = true # Whether the general log is enabled
    access_log_file_name = access.log # The name of the access log file (access attempts)
    access_log_enabled = true # Whether the access log is enabled

    Door Configuration File:

    [general]
    name = Proxdoor 1 # The name of the door. Used to identity it in events and access logs
    range = 3 # The range used to detect entities
    side = top # The side to output the redstone on
    open_time = 3 # The time (in seconds) the door stays open
    inverted = false # Whether to initially power the redstone
    
    [addresses]
    motion_sensor = # The address of the motion sensor for this door. Required.
    redstone = # The address for the redstone IO for this door. Required.
    
    [users]
    user_list = # A space-separated list of entity names
    is_blacklist = false # Whether the above list is a blacklist
    allow_all = false # Whether to allow all entities. Overrides the above user configuration.

     

    The configuration files MUST have the extension .cfg, otherwise they won't be loaded.

     

    Changelog:

    • 1/11/2017
      • Added plugin support
  7. Hey. Could I get an OpenPrograms Repo set up? My Github username is the same as my username here.

     

    I have a few things I am working on that I want to share.

×
×
  • Create New...

Important Information

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