Yes, a lot of the docs here are AI generated. Sorry.
A professional collection of utility modules for ComputerCraft that makes building complex programs easier, cleaner, and more maintainable.
Install any library with a single command:
wget run https://raw.githubusercontent.com/Twijn/cc-misc/main/util/installer.luaThis launches an interactive installer where you can:
- β¨ Browse all available libraries
- π View detailed information (press RIGHT arrow)
- π Automatically resolve dependencies
- π¦ Install to your computer
Or install specific libraries directly:
wget run https://raw.githubusercontent.com/Twijn/cc-misc/main/util/installer.lua formui persist logπ¨ FormUI - Interactive Form Builder
Stop wrestling with terminal I/O - create beautiful UIs in seconds
local FormUI = require("formui")
local form = FormUI.new("Server Config")
local nameField = form:text("Server Name", "MyServer")
local portField = form:number("Port", 8080)
local enabledField = form:checkbox("Enabled", true)
local modemField = form:peripheral("Modem", "modem")
form:addSubmitCancel()
local result = form:run()Features: Text/number/select fields, checkboxes, multi-select, lists, validation, peripheral detection, keyboard navigation
πΎ Persist - Data Persistence
Save and load data with zero boilerplate
local persist = require("persist")
local config = persist("config.json")
config.setDefault("port", 8080)
config.set("name", "MyServer")
print(config.get("port")) -- 8080Features: JSON/Lua serialization, auto-save, deep copy, automatic file creation
π Log - Logging System
Professional logging with color-coded output and daily rotation
local log = require("log")
log.info("Server started")
log.warn("High memory usage")
log.error("Connection failed")Features: Color-coded console output, daily log files, timestamped entries
β±οΈ TimeUtil - Interval Management
Run tasks on schedules that persist across reboots
local timeutil = require("timeutil")
timeutil.every(function()
print("Running backup...")
end, 600, "backup_last_run")
timeutil.run()Features: Absolute and runtime-based intervals, persistent state, pretty formatting
π§ Tables - Table Utilities
Common table operations you always end up reimplementing
local tables = require("tables")
tables.includes(myTable, value)
tables.recursiveCopy(myTable)
tables.recursiveEquals(table1, table2)βοΈ Settings (s) - Interactive Settings
User-friendly configuration with validation and peripheral detection
local s = require("s")
local modem = s.peripheral("modem", "modem", true)
local port = s.number("port", 1, 65535, 8080)
local name = s.string("server_name", "MyServer")π₯οΈ CMD - Command Interface
Build REPL-style command processors with history and autocompletion
local cmd = require("cmd")
local commands = {
hello = {
description = "Say hello",
execute = function(args, context)
context.succ("Hello, " .. (args[1] or "World") .. "!")
end
}
}
cmd("MyApp", "1.0.0", commands)π° ShopK - Kromer API Client
WebSocket client for Kromer cryptocurrency integration
local shopk = require("shopk")
local client = shopk({ privatekey = "your_key" })
client.on("transaction", function(tx)
print("Received:", tx.value)
end)
client.run()π Updater - Package Management
Keep your libraries up to date programmatically
local updater = require("updater")
-- Check for updates
local updates = updater.checkUpdates()
-- Update all packages
updater.updateAll()- Writing terminal UIs is painful
- Data persistence requires boilerplate
- No standard library for common tasks
- Managing dependencies manually
- Updating code across multiple computers
- β One-line installation - wget and go
- β Dependency resolution - Installer handles it automatically
- β Beautiful UIs - FormUI makes it easy
- β Professional docs - Full API reference with examples
- β Version management - Update with a single command
- β Battle-tested - Used in production servers
Full documentation with API references, examples, and guides:
π ccmisc.twijn.dev
Each library includes:
- Detailed API documentation
- Function signatures with types
- Usage examples
- Version information
- Dependency information
wget run https://raw.githubusercontent.com/Twijn/cc-misc/main/util/installer.luawget run https://raw.githubusercontent.com/Twijn/cc-misc/main/util/installer.lua formui persist logwget https://raw.githubusercontent.com/Twijn/cc-misc/main/util/formui.lua formui.lualocal updater = require("updater")
updater.install("formui")local updater = require("updater")
updater.updateAll()local updater = require("updater")
updater.update("formui")local updater = require("updater")
local updates = updater.checkUpdates()
for _, update in ipairs(updates) do
print(update.name .. ": " .. update.current .. " -> " .. update.latest)
endCombine formui, persist, and log for a complete configuration system:
local FormUI = require("formui")
local persist = require("persist")
local log = require("log")
-- Load existing config
local config = persist("server_config.json")
-- Create configuration form
local form = FormUI.new("Server Configuration")
local nameField = form:text("Server Name", config.get("name") or "MyServer")
local portField = form:number("Port", config.get("port") or 8080)
local enabledField = form:checkbox("Auto-start", config.get("autostart") or true)
form:addSubmitCancel()
-- Run form and save results
local result = form:run()
if result then
config.set("name", nameField())
config.set("port", portField())
config.set("autostart", enabledField())
log.info("Configuration saved: " .. nameField() .. " on port " .. portField())
print("Configuration saved!")
else
log.warn("Configuration cancelled")
endUse timeutil and log for automated tasks:
local timeutil = require("timeutil")
local log = require("log")
-- Backup every 10 minutes
timeutil.every(function()
log.info("Running backup...")
-- Your backup code here
log.info("Backup complete")
end, 600, "backup_timer")
-- Status report every hour
timeutil.every(function()
log.info("System status: OK")
end, 3600, "status_timer")
log.info("Task manager started")
timeutil.run()Build a command-line admin interface:
local cmd = require("cmd")
local log = require("log")
local commands = {
status = {
description = "Show server status",
execute = function(args, context)
context.succ("Server running on port 8080")
end
},
restart = {
description = "Restart the server",
execute = function(args, context)
log.warn("Server restart requested")
context.mess("Restarting...")
os.reboot()
end
}
}
cmd("Admin Panel", "1.0.0", commands)cc-misc/
βββ util/ # Core utility libraries
β βββ formui.lua # Form builder
β βββ persist.lua # Data persistence
β βββ log.lua # Logging system
β βββ timeutil.lua # Interval management
β βββ tables.lua # Table utilities
β βββ s.lua # Settings management
β βββ cmd.lua # Command interface
β βββ shopk.lua # Kromer API client
β βββ installer.lua # Interactive installer
β βββ updater.lua # Update manager
βββ farm/ # Example: Farming automation
βββ docs/ # Generated documentation
Contributions are welcome! Please feel free to:
- π Report bugs
- π‘ Suggest new features
- π Improve documentation
- π§ Submit pull requests
MIT License - see LICENSE for details
Copyright (c) 2025 Tyler Twining
- Documentation: ccmisc.twijn.dev
- GitHub: github.com/Twijn/cc-misc
- Issues: github.com/Twijn/cc-misc/issues
Made with β€οΈ for the ComputerCraft community