Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Factory OS (CC:Tweaked)

A small set of ComputerCraft: Tweaked programs for running a factory control room.

This repo is designed to be a mini framework to be forked and extended according to your own needs. See the Workflows section below for info.

Workflows

All the below workflows are to be run in a CraftOS environment.

Prerequesite: fetch deployment scripts.

Fetch deployment script installer

wget https://raw.githubusercontent.com/jclicodes/factory/refs/heads/main/install.lua

Then run it:

install

Deploy Manager or Wall

First, ensure deployment scripts are available:

list deploy

Then, use the manager or wall script depending on which you are deploying:

deploy/deploy_manager

or

deploy/deploy_wall

Deploy endpoint

First, ensure deployment scripts are available:

list deploy

Then, use the endpoint deployment script:

deploy/deploy_endpoint

Edit the resulting config.lua with a unique system hostname, and any other relevant configuration.

Creating a new endpoint

Right now, I'm only controlling some mob spawners with this system, but it's built to be easily extensible.

To onboard a new endpoint, fork this repo and create a new directory under endpoints/. E.g. endpoints/reactor/

You can copy the contents of mob_farm and edit them based on your needs for your new endpoint. Ensure you specify startup and shutdown handlers and use the configuration file to manage differences between deployments (e.g. hostnames, redstone directions, etc.). Use the mob farm as an example.

You will also want to create a new panel for controlling how the status information of your endpoint is displayed on the Wall. Simply add a new .lua file under wall/panels - e.g. wall/panels/reactor.lua. Then register the new panel in wall/wall.lua.

No need to modify the deployment scripts to support your new endpoint - it is supported automatically. Just do:

deploy/deploy_endpoint <your-endpoint>

to deploy it across different computers!

IDE Setup

I highly recommend VS Code (I know, I know) for working with ComputerCraft as there are many great development tools for quickly iterating - such as mounting the virtual filesystem and emulating/forwarding the in-game terminal.

https://marketplace.visualstudio.com/items?itemName=lemmmy.computercraft-extension-pack

If you're on another editor that supports the Language Server Protocol (LSP) e.g. Neovim or Zed - please at least install lua-language-server (sumneko)! It makes implementing your own endpoints and panels much easier since my custom types will be picked up.

About

Modded Minecraft Factory Management System built with ComputerCraft!

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages