This repository contains Lua scripts for the CC: Tweaked mod for Minecraft. These programs let turtles automate a variety of mining tasks.
- Install CC: Tweaked and obtain a Turtle in your world.
- Copy the desired
.luafiles onto the turtle usingpastebin,wget, or a disk. - Ensure the turtle has fuel and the tools it needs (for example a diamond pickaxe and a modem for wireless features). Fuel items in the turtle's inventory count toward its fuel reserve and are only consumed when needed.
- Keep all scripts in the same directory so that helper APIs such as
flex.luaanddig.luacan be loaded by other programs.
dig.lua– movement and coordinate tracking API used by the other scripts.flex.lua– utility functions for logging, block detection, and network messaging.quarry.lua– digs out a rectangular quarry. Usage:quarry <width> [length] [depth].receive.lua– listens on modem channel6464and prints messages sent viaflex.lua.stairs.lua– digs a staircase a fixed distance (distancevariable).
From the turtle prompt run the script by name. For example:
quarry 16 16 30 -- dig a 16×16 quarry 30 blocks deep
Run receive on a computer with a modem attached to monitor messages sent with flex.lua's send function.
Turtles running quarry.lua listen for a Rednet broadcast of the string RETURN. Broadcasting RETURN causes every turtle to navigate home, unload, refuel, and then automatically resume mining. If the chest at home is missing, the turtle waits and reports an error until the chest is restored.
These scripts are intended for experimentation. Adjust the code and parameters to suit your own mining setup.