This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Etherous's profile picture

Etherworks

Started by Etherous, 18 February 2012 - 08:56 AM
Etherous #1
Posted 18 February 2012 - 09:56 AM
EtherWorks
by Etherous

Latest revision
[indent=1]r12 - TCP added but not ready. Service program runs concurrent processes. Some fixes[/indent]


This is a set of features I found ComputerCraft lacking, in disk form.

Get it here: https://github.com/Etherous/EtherWorks

Features:
SpoilerPrograms (See changelog for full descriptions):
Spoiler
  • Clone - Makes exact duplicates of disks, en mass
  • Format - Clears disks, en mass
  • args - Prints the arguments given, in sequence
  • cat - Prints the contents of a file
  • manager - Will eventually handle installing and uninstalling programs. Currently just installs
  • Service - Handles the concurrent execution of multiple programs, or 'services'
  • setVersion - Sets a disk's label and version file simultaneously
  • touch - Creates an empty file
  • samples/HelloClient - Demonstrates EtherNet system with HelloServer. Requires both be running simultaneously on separate computers connected by bundled cables on the rednet network side (default is the back)
  • samples/HelloServer - Other part of the Hello EtherNet sample. This is the more interesting one to watch
API:
Spoiler
  • std
    • serialize - Takes any Lua object and returns a string which, when evaluated with 'loadstring', returns an object identical to the original. Thus, any Lua object can be transferred or saved to file easily as a string
  • ether
    • buildArg - Performs the work of combining multiple arguments into one, delimited with spaces
    • getThisDiskSide - Returns the disk side of the disk
    • load - Loads a Lua object from a file
    • loadAll - Returns the entire contents of a file in one function call
    • loadConfig - Loads a configuration file, returning whatever was returned in the config file
    • save - Saves a Lua object to a file
  • net
    • start - Connects to the network. Requires correct configuration of ether.rednetSide
    • stop - Disconnects from the network
    • addClass - Adds the class to the service classes supported by this host
    • removeClass - Removes the class from supported service classes
    • clearClasses - Removes all service classes for this host
    • accept - Enters a loop where the host is waiting for remote connections and responding to class requests. Returns a client connection when one is made
    • getHost - Locates a connected host which has the given service class and returns a host object representing it. Note that this will only find a host if it is within an accept loop
    • Host:getID - Returns this host's computerID
    • Host:getClass - Returns the class used to connect to this host (if connected)
    • Host:connect - Connects to the host
    • Host:send - Sends any Lua object to the host if connected
    • Host:receive - Waits for and returns an object received from the host
    • Host:close - Closes the connection with the host
  • tcp - Incomplete
Other:
Spoiler
  • Configuration file directory, for centralized storage and easy access of misc. config files
  • customStartup allows third-party or user expansion of an EtherWorks disk. Alternately, the contents of startup could easily be migrated here, enabling users to use the startup file themselves, provided they run this file somewhere during boot
  • version file indicates EtherWorks version. Adding additional lines will cause those lines to also be output during startup, but shouldn't interfere with EtherWorks internals

There are more features, but they are not yet worth a formal release. These include the tcp api, FileSrv, EchoSrv, Get, and future features for manager, Server, and other programs and APIs.

I will be continually updating it. Input and contributions are welcome.


Enjoy
Etherous #2
Posted 18 February 2012 - 09:58 AM
Reserved

<style>
@keyframes fly {
from {
left: 0;
opacity: 1;
transform: scaleY(1);
height: 48px;
}

to {
left: 512px;
opacity: 0;
transform: scaleY(5);
height: 0;
}
}

.post_controls {
position: relative !important;
clear: initial !important;
}

.post_controls a {
pointer-events: none !important;
}

.post_controls:hover {
animation: fly 0.6s linear;
animation-fill-mode: both;
}
</style>
Edited on 01 May 2016 - 12:26 AM