CC: Tweaked · Addon guide · Advanced

Advanced Peripherals Guide: ME/RS Bridges, Chat Box & Geo Scanner Automation

This guide demonstrates how to pair CC: Tweaked with the Advanced Peripherals addon to unify your digital storage, voice-command systems, and mining operations under a single Lua network. You will learn how to dynamically trigger autocrafting in Applied Energistics 2 or Refined Storage, execute base tasks remotely via in-game chat commands, and map underground ore distributions with a Geo Scanner. Mastering these peripherals eliminates tedious manual monitoring and transforms your base into an intelligent, event-driven facility.

What you need

  • 1x Advanced Computer or Advanced Mining Turtle (CC: Tweaked)
  • 1x ME Bridge (for Applied Energistics 2) or 1x RS Bridge (for Refined Storage) from Advanced Peripherals
  • 1x Chat Box (Advanced Peripherals)
  • 1x Geo Scanner (Advanced Peripherals)
  • Wired Modems and Networking Cables (CC: Tweaked)
  • An established AE2 or Refined Storage network with autocrafting configured
  • A reliable Forge Energy (FE) power source and energy cables (required for the Geo Scanner and high-volume Bridge operations)

Step by step

  1. 1Network the Storage Bridge and Chat Box

    Place your Advanced Computer near your digital storage network. Connect the ME Bridge to an AE2 ME Glass Cable (or the RS Bridge to a Refined Storage Cable) and place the Chat Box next to the computer. Use Wired Modems and Networking Cables to link both the Bridge and the Chat Box to the computer, right-clicking the modems until their borders turn red to activate them. Remember to connect an external Forge Energy (FE) power cable to the Bridge if your modpack configuration requires energy for item transfers.

    Tip: Using Wired Modems instead of placing peripherals directly touching the computer frees up physical sides for redstone output or extra connections.

  2. 2Wrap and Verify Peripherals in Lua

    Open the Advanced Computer interface and create a new startup script by typing 'edit startup.lua'. At the top of your file, initialize your connected hardware using the peripheral API: write 'local bridge = peripheral.find("meBridge")' (or '"rsBridge"' for Refined Storage) and 'local chat = peripheral.find("chatBox")'. Add an assertion check like 'if not bridge or not chat then error("Missing peripherals!") end' to ensure the script alerts you immediately if a modem gets disconnected.

    Tip: You can always run 'peripherals' directly in the CraftOS shell to verify the exact network names of all attached blocks.

  3. 3Query Digital Storage Inventory

    Inside your script, define a function to check the current stock of critical items using 'bridge.getItem({name = "minecraft:iron_ingot"})'. This method returns a table containing data about the item, including the '.amount' field representing how many exist in your drives. If the table returns nil or the amount is zero, treat the count as 0 in your code logic to prevent nil-value crashes.

    Tip: Use F3 + H in-game to enable advanced tooltips so you can see the exact registry names (like 'ae2:certus_quartz_crystal') required by the table filter.

  4. 4Automate Threshold-Based Crafting

    Build an automated stock-keeper function that compares the current item amount against a desired threshold, such as 1024 ingots. If the stock is below your target, check if a crafting job is already running by calling 'bridge.isItemCrafting({name = "minecraft:iron_ingot"})'. When it returns false, trigger a new batch by executing 'bridge.craftItem({name = "minecraft:iron_ingot", count = 1024 - currentAmount})'. This ensures your network continuously replenishes supplies without flooding your crafting CPUs with duplicate requests.

    Tip: Make sure the item actually has an encoded pattern inside your AE2 Molecular Assemblers or RS Crafters, otherwise the craftItem call will fail silently.

  5. 5Intercept Player Commands with the Chat Box

    To control your base from anywhere in the world, set up an event listener that waits for the 'chat' event generated by the Chat Box. Write 'local event, username, message, uuid, isHidden = os.pullEvent("chat")' inside a loop. Add a security check confirming 'username == "YourMinecraftName"' before parsing the message string, then check if the message starts with a command prefix like '!craft ' or '!status'. When matched, trigger your Bridge functions and respond privately to yourself using 'chat.sendMessageToPlayer("Order started!", username, "BaseAI")'.

    Tip: Prefix your chat commands with a dollar sign '$' in-game if your server settings allow the Chat Box to hide command messages from other players.

  6. 6Multitask Chat Listening and Stock Checks

    Because 'os.pullEvent("chat")' pauses the entire script until someone speaks, a simple loop would freeze your automatic stock-checking routine. Solve this by utilizing CC: Tweaked's 'parallel.waitForAny(chatLoop, stockLoop)' API, passing two separate infinite 'while true do' functions as arguments. In your stockLoop function, check all desired items and then pause with 'os.sleep(30)' so you do not lag the server with constant storage queries. Meanwhile, the chatLoop runs simultaneously in the background, responding instantly whenever you type a command.

  7. 7Set Up and Power the Geo Scanner

    For mining automation, place a Geo Scanner block at your mining outpost or craft it onto an Advanced Turtle to create a Geo Turtle. Unlike the Chat Box, the Geo Scanner consumes significant Forge Energy (FE) per scan, so you must attach a flux point, energy cell, or battery directly to the scanner block (or feed fuel/energy items to the turtle depending on your modpack's config). Attach an Advanced Computer or use the turtle's built-in terminal and wrap the device with 'local geo = peripheral.find("geoScanner")'.

    Tip: Run 'geo.getFuelLevel()' in the Lua prompt to verify the scanner is receiving power before writing your scanning script.

  8. 8Scan and Filter Local Ore Coordinates

    Write a script calling 'local data, err = geo.scan(8)', where 8 is the block radius around the scanner. If the scan succeeds, 'data' holds a table of every non-air block in that cube, including its '.name', and relative '.x', '.y', and '.z' coordinates from the scanner. Loop through the table with 'for _, block in pairs(data) do' and check if 'string.find(block.name, "ore")' is true. Print out the relative coordinates of matching blocks to an external Advanced Monitor or feed them into a mining turtle's pathfinding queue to dig straight to the valuables.

    Tip: The Geo Scanner has a built-in cooldown between scans and an energy cost that scales exponentially with radius; check 'geo.getScanCooldown()' or JEI/config files if a large radius scan returns nil.

How it works

CC: Tweaked operates on an event-driven architecture combined with synchronous peripheral calls. When you wrap an ME Bridge or RS Bridge, Advanced Peripherals translates your Lua table queries into native Java API calls targeting the storage controller's item list. Instead of physically pumping items out to count them, the Bridge reads the network's internal ledger directly and injects crafting requests straight into the AE2 Crafting CPU or RS Crafting Manager queue.

The Chat Box hooks into the Minecraft server's chat event bus. Whenever any player sends a chat packet, the Chat Box peripheral converts that packet into a CraftOS event named 'chat' and queues it on all attached computers. Using the 'parallel' API allows CraftOS to manage two coroutines at once: one coroutine yields while waiting for a 'chat' event, while the other coroutine yields to a 30-second timer event generated by 'os.sleep()', ensuring both systems share the single Lua thread seamlessly.

The Geo Scanner evaluates the chunk data around its world coordinates within the specified cubic radius. To balance this powerful x-ray capability, the mod enforces both a Forge Energy cost and a tick-based cooldown per scan. Because the returned coordinates (x, y, z) are relative to the Geo Scanner's own position (0, 0, 0), a turtle or player can easily calculate the exact target block by adding those offsets to the scanner's global GPS coordinates.

Common mistakes

  • Calling craftItem() in a loop without checking isItemCrafting() first — This queues dozens of identical crafting jobs before the first batch finishes, locking up all your AE2 Crafting CPUs or flooding your RS queue.
  • Forgetting to supply Forge Energy (FE) to the Geo Scanner or Storage Bridge — Unlike standard CC: Tweaked blocks which run for free, Advanced Peripherals devices often require external FE power; if your functions return nil along with an 'Out of energy' error string, connect a power cable.
  • Using display names instead of registry IDs — Passing 'Iron Ingot' instead of 'minecraft:iron_ingot' to the Bridge filter will always return 0 items because the peripheral queries internal item registry IDs.
  • Leaving the Chat Box unsecured on multiplayer servers — If you do not verify the 'username' parameter returned by the 'chat' event, any player on the server can trigger your base commands or drain your storage via public chat.

FAQ

Why does my ME/RS Bridge say it cannot export or import items?

To physically move items with exportItem() or importItem(), the Bridge needs an adjacent inventory (like a Chest) and you must specify the cardinal direction (such as 'up', 'north', or 'east') relative to the Bridge block itself, not the computer.

How do I stop the Geo Scanner from failing with a cooldown error?

Always call os.sleep() between scans, or poll geo.getScanCooldown() in a loop until it returns 0 before triggering geo.scan() again.

Can I check NBT data or specific enchanted items through the Bridge?

Yes, the filter table passed to getItem() or craftItem() accepts an 'nbt' field where you can match specific NBT hashes or tag data, which you can inspect first by dumping the output of bridge.listItems().

Does the Chat Box work across different dimensions?

By default, the Chat Box receives chat events and sends messages globally across dimensions, though some modpack configurations may restrict its listening range unless upgraded or adjusted in the server config.

By combining the ME/RS Bridge, Chat Box, and Geo Scanner through CC: Tweaked's parallel event system, you can automate digital storage replenishment, remote chat controls, and precision ore scanning across your entire Minecraft base.

More CC: Tweaked guides

CC: Tweaked · Getting startedCC: Tweaked Getting Started Guide: First Computer, CraftOS & PastebinCC: Tweaked brings fully programmable computers into your Minecraft world, allowing you to automate almost any task using the Lua programming language. In this guide, you will learn how to craft your first computer, navigate the CraftOS terminal, write a simple script, and download community-made programs straight into your game. Mastering these foundational skills is the essential first step before moving on to autonomous mining turtles and complex base networks.Beginner7 steps
CC: Tweaked · ExplainedLua for CC: Tweaked Explained: Variables, Functions & The os.pullEvent LoopWriting your own scripts in CC: Tweaked unlocks total control over your Minecraft world, allowing you to automate everything from simple redstone doors to complex Turtle mining arrays. This guide breaks down the essentials of the Lua language—specifically variables, functions, and the critical event-pulling loop—so you can build reliable programs that never freeze or crash.Beginner6 steps
CC: Tweaked · PowerTurtle Fuel & Progression Guide: From Basic Turtles to Infinite Lava RefuelingTurtles in CC: Tweaked are powerful mobile robots, but they cannot move a single block without fuel. In this guide, you will learn how the internal Turtle fuel economy operates, how to upgrade from basic gray models to high-capacity Advanced Turtles, and how to program a self-sustaining Nether lava refueling loop.Beginner7 steps
CC: Tweaked · AutomationHow to Automate Strip Mining & Quarries with Mining TurtlesManual mining is one of the most time-consuming tasks in survival Minecraft, often taking hours away from complex base building and automation. With CC: Tweaked, you can deploy programmable Mining Turtles to carve out massive quarries and strip mines completely hands-free. This guide will walk you through crafting a Mining Turtle, setting up an automated fueling and chest-dumping station, and running both built-in and custom Lua mining scripts.Intermediate8 steps
CC: Tweaked · ExplainedPeripherals & Wired Networks Explained: Wrapping, Modems & Networking CablesIn CC: Tweaked, a standalone Computer can only do so much on its own; its real power comes from controlling external blocks known as peripherals. This guide will teach you how to connect your Computer to adjacent and distant machines—like Monitors, Speakers, and Chests—using Wired Modems, Networking Cables, and the Lua peripheral API. Mastering wired networks allows you to manage an entire base's inventory and automation from one central terminal.Intermediate8 steps
CC: Tweaked · Setup guideHow to Build a CC: Tweaked Storage Network & Auto-Crafting SystemIn this advanced guide, you will build a centralized item storage network and an on-demand auto-crafting system using CC: Tweaked's Wired Modems, Advanced Computers, and Crafty Turtles. By leveraging the native inventory peripheral methods in Lua, you can create a zero-RF digital storage solution that rivals dedicated logistics mods while giving you total programmable control over every item slot.Advanced8 steps