Posted 31 December 2013 - 09:02 PM
Hey, I've been fairly quiet on what I've been working on lately, so I thought I'd share what I've got, other than ac-get.
To start off with all my code is kept under my personal ac-get repository. You can add it to your ac-get install with this command:
NOTE lib-agui and it's dependencies have been moved to Project Veek and will be maintained seperately of this repo from now on.
Programs
Individual Docs
Functions
There are two functions in the library, listed below.
* strtabulate – Tabulates a table into a string, instead of printing it right out.
* pagedprint – Prints out a string incrementally, allowing you to scroll down multiple lines, or quit the printing altogether.
It also allows you to define and act on slots as objects. The functions themselves are listed below:
The move function takes one of the following commands:
Item Objects
Item objects are what's returned by
kvu-cyclic-list is a list that can only contain up to X items, where X is passed to the constructor.
kvu-set
kvu-set is a set data structure.
To start off with all my code is kept under my personal ac-get repository. You can add it to your ac-get install with this command:
ac-get run-manifest http://amanda.darkdna.net/mc/cc/ac-get/install.manifest
This is what all it contains:NOTE lib-agui and it's dependencies have been moved to Project Veek and will be maintained seperately of this repo from now on.
Programs
- agvam – Commandline shell replacement.
- agui-shell – A graphical, windowed shell.
- turtle-roomer – Digs out a room.
- turtle-plaster – Places walls in a spiral pattern
- lib-butter – Utility functions for turtles.
- ibhui – http.get/post enhansement allowing for custom protocols.
- lib-acutils – Misc. Utility functions.
Individual Docs
agui-shell
agui-shell is a graphical shell replacement for ComputerCraft. It is written ontop of the lib-agui toolkit, and supports the term.newWindow protocol I have previously defined. It's pretty beta right now, so use at your own risk. It's only been tested on advanced computers, but in thory it should run on normal computers as well.agvam
agvam is a (commandline) shell replacement. It provides tab-completion, as well as a rich API to implement additional completions. By default you get completion for- ac-get
- built-in monitor command
- cp/ls/cd/mv/etc
lib-acutils
lib-acutils is a collection of useful functions I have made / hacked together from stock scripts.Functions
There are two functions in the library, listed below.
* strtabulate – Tabulates a table into a string, instead of printing it right out.
* pagedprint – Prints out a string incrementally, allowing you to scroll down multiple lines, or quit the printing altogether.
lib-butter
lib-butter is a set of utility functions for turtles. It contains a few helpful things such as fuel-assertion, and item assertion.It also allows you to define and act on slots as objects. The functions themselves are listed below:
- butter.up / down / forward / back() – Checks that you have fuel, then moves in the given direction.
- butter.ensure_fuel(func) – Calls func only if you have fuel, if you don't it prompts the user to insert more, and then calls your func again.
- butter.ensure_stock(func, item) – Checks that you have items in the the turtle ( or the specific item stack if item is passed) then calls func() if you do. If you don't, it will halt the program and wait for user interaction to continue.
- butter.move(str) – Takes a string containing commands and executes. commands are detailed below, and may be followed by a number to indicate how many times to repeat it.
- butter.newitem(name, slotstart, slot_end) – Returns a new item object for making code a bit prettier.
The move function takes one of the following commands:
- l – Turn Left
- r – Turn Right
- u – Go Up
- d – Go Down
- f – Go Forward
- b – Go Backward
Item Objects
Item objects are what's returned by
butter.new_item
– They implement the following functions:- item:place / place_up / place_down() – Selects the slot with the item in it and places it in the specified direction.
- item:drop / drop_up / drop_down() – Selects a slot with the item in it and drops it.
- item:select() – Selects a slot with a non-zero number of this item in it.
- item:slots() – Iterates through the slots for this item, for custom item slot logic.
lib-kvutils
lib-kvutils is a utility class library for kidven-based programs. lib-kvutils currently contains:- kvu-set – Handles an array-alike with a single object type per-instance.
Documentation
kvu-cyclic-listkvu-cyclic-list is a list that can only contain up to X items, where X is passed to the constructor.
- Methods
- :clear() – Clears the list.
- :add(item) – Adds item to the list.
- :iter() – Iterates the items.
kvu-set
kvu-set is a set data structure.
- Methods
- :add(elem) – Adds elem to the set, if it's not already there.
- :remove(elem) – Removes an element from the set.
- :iter() – Returns an iterator for the elements in this set.
- :contains(elem) – Returns true if elem is in the set
Edited on 23 March 2014 - 07:59 PM