Wiki 9Minecraft OpenComputers Mod Wiki

OpenComputers Mod — Guide

Robotics and Drones

Robots are mobile computers that can move through the world, use tools, and interact with blocks. Unlike static computers, they must be assembled in an Electronics Assembler.

Robot Assembly

To create a robot, you must place a Robot Case in an Assembler along with various components. The assembly process takes time and energy. * Tier 1 Robot: Limited inventory and slots. * Tier 2 Robot: Moderate capabilities. * Tier 3 Robot: Maximum upgrade slots and internal energy storage.

Drones

Drones are lightweight, flying versions of robots. They do not have an inventory for tools but are much faster and can navigate 3D space more freely. They are programmed via a Wireless Endpoint and require a Microcontroller as their brain.

Robot Upgrades

  • Inventory Upgrade: Adds slots for the robot to carry items.
  • Tank Upgrade: Allows the robot to store and manipulate fluids.
  • Crafting Upgrade: Enables the robot to craft items using its internal inventory.
  • Generator Upgrade: Allows the robot to consume fuel (like coal) to recharge its internal battery on the go.
  • Navigation Upgrade: Provides the robot with its current coordinates and orientation.

Mechanics and Programming

OpenOS

OpenOS is the primary operating system for OpenComputers. It provides a command-line interface (CLI) similar to Unix/Linux. Users can create, edit, and run scripts using the built-in edit command.

The Component API

In Lua, the computer interacts with its hardware via the component library. Example of turning on a redstone signal:

local component = require("component")
local rs = component.redstone
rs.setOutput(5, 15) -- Sets redstone output on the back side to max strength

Persistence (Eris)

OpenComputers uses the Eris library to serialize the state of the Lua VM. This means that if a computer is running a complex script and the chunk unloads, the script will be exactly where it left off when the chunk reloads. This eliminates the need for complex 'startup' scripts for every minor task.