### Install mkdocs Dependencies with Poetry Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/README.md Use this command to install mkdocs dependencies if you are using Poetry. Ensure you are in the directory containing the pyproject.toml file. ```zsh poetry install ``` -------------------------------- ### Install mkdocs Dependencies with Pip Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/README.md Use this command to install mkdocs dependencies if you are using pip. Ensure you are in the directory containing the requirements.txt file. ```zsh pip install -r requirements.txt ``` -------------------------------- ### Example Entity Output Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md This is an example of the table structure returned by the `scanEntities` function, detailing properties of a detected entity. ```lua { canFreeze = true, uuid = "380df991-f603-344c-a090-369bad2a924a", tags = {}, id = 158, y = 0.99835407917146, x = 2.3657836835311, name = "Dev", isGlowing = false, z = 1.2416321248782, isInWall = false, maxHealth = 20, health = 20, } ``` -------------------------------- ### Get All Matching Fluids from Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every fluid that matches the filter or an empty table if none could be found. An empty filter can be provided to get every resource. Returns nil if there was an issue parsing your table. The item argument accepts our item/fluid/chemical filters. ```lua getFluids(filter: table) -> table | nil, string ``` -------------------------------- ### Get All Matching Items from Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every item that matches the filter or an empty table if none could be found. An empty filter can be provided to get every resource. Returns nil if there was an issue parsing your table. The item argument accepts our item/fluid/chemical filters. ```lua getItems(filter: table) -> table | nil, string ``` -------------------------------- ### Get All Matching Mekanism Chemicals from Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every Mekanism chemical that matches the filter or an empty table if none could be found. An empty filter can be provided to get every resource. Returns nil if there was an issue parsing your table. The item argument accepts our item/fluid/chemical filters. ```lua getChemicals(filter: table) -> table | nil, string ``` -------------------------------- ### craftItem Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/rs_bridge.md Tries to craft the provided item. Returns true if it successfully starts crafting. ```APIDOC ## craftItem ### Description Tries to craft the provided `item`, returns true if it successfully starts crafting. ### Method `craftItem(item: table) -> boolean` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **item** (table) - Required - An item filter table. Can contain `name`, `count`, `nbt`, or `fingerprint`. - **name** (string) - The registry name of the item or a tag. - **count** (number?) - The amount of the item to craft. - **nbt** (string?) - NBT to match the item on. - **fingerprint** (string) - A unique fingerprint which identifies the item to craft. ### Request Example ```lua rsBridge.craftItem({ name = "minecraft:diamond", count = 1 }) rsBridge.craftItem({ fingerprint = "some_fingerprint", count = 5 }) ``` ### Response #### Success Response (boolean) - **true**: Crafting successfully started. - **false**: Crafting failed to start. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Redstone Integrator Example Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/redstone_integrator.md Demonstrates finding a redstone integrator and using its functions to read redstone levels and set outputs. ```lua local integrator = peripheral.find("redstoneIntegrator") print("Left redstone level: ".. integrator.getAnalogInput("left")) -- prints the level of the redstone at the left side. print("Right redstone: ".. integrator.getOutput("right")) -- prints whether there is a redstone output on the right side. integrator.setOutput("top", true) -- Sets the redstone level to 15 for the top side. ``` -------------------------------- ### Get All Crafting Tasks Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every crafting task that is currently running. ```lua getCraftingTasks() -> table ``` -------------------------------- ### Get Energy Usage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the current energy usage of the grid. ```lua getEnergyUsage() -> int ``` -------------------------------- ### Configuration and Detection Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/weak_automata.md Functions to get the automata's configuration and detect blocks or entities. ```APIDOC ## getConfiguration ### Description Returns the configuration values for this automata. ### Method APICALL ### Endpoint getConfiguration() ### Returns - table: A table containing the automata's configuration. ``` ```APIDOC ## lookAtBlock ### Description Returns a table containing information about the block in front of the turtle. ### Method APICALL ### Endpoint lookAtBlock() ### Returns - table | nil, string: A table with block information, or nil and an error message if the operation fails. ``` ```APIDOC ## lookAtEntity ### Description Returns a table containing information about the entity in front of the turtle. ### Method APICALL ### Endpoint lookAtEntity() ### Returns - table | nil, string: A table with entity information, or nil and an error message if the operation fails. ``` -------------------------------- ### Get All Craftable Fluids Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every craftable fluid that matches the filter even if there is currently no fluid stored or an empty table if none could be found. An empty filter can be provided to get every resource. Returns nil if there was an issue parsing your table. The item argument accepts our item/fluid/chemical filters. ```lua getCraftableFluids(filter: table) -> table | nil, string ``` -------------------------------- ### Get Crafting CPUs Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of all connected crafting CPUs, including their storage, coprocessor count, and busy status. ```lua local cpus, err = bridge.getCraftingCPUs() if err then print(err) else for _, cpu in ipairs(cpus) do print(string.format("CPU: Storage=%d, Co-Processors=%d, Busy=%s", cpu.storage, cpu.coProcessors, tostring(cpu.isBusy))) end end ``` -------------------------------- ### Get Fluid Tank Info Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/fluidtank.md Use this function to retrieve information about the fluid tank's current state, including its capacity, fluid amount, fluid type, and whether it's part of a boiler. Requires the Create mod to be installed. ```lua local tankInfo = peripheral.call("fluidTank", "getInfo") print(tankInfo.capacity) print(tankInfo.amount) print(tankInfo.fluid) print(tankInfo.isBoiler) ``` -------------------------------- ### Get All Craftable Items Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every craftable item that matches the filter even if there is currently no item stored or an empty table if none could be found. An empty filter can be provided to get every resource. Returns nil if there was an issue parsing your table. The item argument accepts our item/fluid/chemical filters. ```lua getCraftableItems(filter: table) -> table | nil, string ``` -------------------------------- ### Get Player Inventory Contents Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/inventory_manager.md Returns a table representing the entire contents of the player's inventory, with each item detailed. ```lua local manager = peripheral.find("inventoryManager") local items = manager.getItems() -- Process the items table here ``` -------------------------------- ### Get All Craftable Mekanism Chemicals Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every craftable Mekanism chemical that matches the filter even if there is currently no chemical stored or an empty table if none could be found. An empty filter can be provided to get every resource. Returns nil if there was an issue parsing your table. The item argument accepts our item/fluid/chemical filters. ```lua getCraftableChemicals(filter: table) -> table | nil, string ``` -------------------------------- ### Get Average Power Injection Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the average power being injected into the system. Currently only supported by the ME Bridge. ```lua getAvgPowerInjection() -> int ``` -------------------------------- ### craftFluid Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/rs_bridge.md Tries to craft the provided fluid of the given amount. Returns true if it successfully starts crafting. ```APIDOC ## craftFluid ### Description Tries to craft the provided `fluid` of the given `amount`, returns true if it successfully starts crafting. ### Method `craftFluid(fluid: table, amount: number) -> boolean` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **fluid** (table) - Required - A fluid filter table. Can contain `name`, `count`, `nbt`, or `fingerprint`. - **name** (string) - The registry name of the fluid or a tag. - **count** (number?) - The amount of the fluid to craft. - **nbt** (string?) - NBT to match the fluid on. - **fingerprint** (string) - A unique fingerprint which identifies the fluid to craft. - **amount** (number) - Required - The amount of fluid to craft. ### Request Example ```lua rsBridge.craftFluid({ name = "minecraft:water" }, 1000) rsBridge.craftFluid({ fingerprint = "some_fluid_fingerprint" }, 500) ``` ### Response #### Success Response (boolean) - **true**: Crafting successfully started. - **false**: Crafting failed to start. #### Response Example ```json { "success": true } ``` ``` -------------------------------- ### Get Energy Capacity Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the maximum energy capacity of the grid. ```lua getEnergyCapacity() -> int ``` -------------------------------- ### Get Weak Automata Configuration Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/weak_automata.md Retrieves the current configuration settings for the Weak Automata. This table contains various operational parameters. ```lua getConfiguration() ``` -------------------------------- ### Get Input Fluids from Basin Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/basin.md Retrieves information about all fluids currently in the input tank of the Basin. Requires the Create mod. ```lua getInputFluids() -> table ``` -------------------------------- ### Get All Buildings Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/colony_integrator.md Returns a table detailing all buildings within the colony, including their type, level, and location. ```lua getBuildings() -> table ``` -------------------------------- ### Initiate Draconic Reactor Charging Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/draconic_evolution/reactor.md Use this function to start the charging process for a disabled Draconic Reactor. Returns true if successful. ```lua chargeReactor() -> boolean ``` -------------------------------- ### Get Output Fluids from Basin Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/basin.md Retrieves information about all fluids currently in the output tank of the Basin. Requires the Create mod. ```lua getOutputFluids() -> table ``` -------------------------------- ### Get ME System Energy Usage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves the current energy consumption rate of the ME system in AE per tick. ```lua local usage, err = bridge.getEnergyUsage() if err then print(err) else print("Energy Usage: " .. usage .. " AE/t") end ``` -------------------------------- ### Get Basin Inventory Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/basin.md Retrieves a list of information about all items currently stored within the Basin. Requires the Create mod. ```lua getInventory() -> table ``` -------------------------------- ### Serve mkdocs Documentation with Poetry Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/README.md Run this command to serve the mkdocs documentation locally after installing dependencies with Poetry. Open the provided URL in your browser to view the changes. ```zsh poetry run mkdocs serve ``` -------------------------------- ### Get Radiation Level (Mekanism) Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md Retrieves the current radiation level and its unit. Requires the Mekanism mod to be installed. ```lua local detector = peripheral.find("environmentDetector") local radiationInfo = detector.getRadiation() print("Radiation: " .. radiationInfo.radiation .. " " .. radiationInfo.unit) ``` -------------------------------- ### Serve mkdocs Documentation with Pip Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/README.md Run this command to serve the mkdocs documentation locally after installing dependencies with pip. Open the provided URL in your browser to view the changes. ```zsh python -m mkdocs serve ``` -------------------------------- ### Get Mana Amount Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/botania/spreader.md Retrieves the current mana stored in the Mana Spreader. No setup is required beyond having the peripheral attached. ```lua local mana = manaSpreader.getMana() print('Mana in spreader: ' .. mana) ``` -------------------------------- ### Get Raw Radiation Level (Mekanism) Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md Retrieves the current raw radiation level in Sv/h. Requires the Mekanism mod to be installed. ```lua local detector = peripheral.find("environmentDetector") -- e.g. prints "Raw Radiation: 0.000005 Sv/h" print(string.format("Raw Radiation: %.6f Sv/h", detector.getRadiationRaw())) ``` -------------------------------- ### Get Block Data Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/block_reader.md Retrieves the data of a block if it is a tile entity. This function is available starting from version 1.19.2-0.7.33r / 1.20.1-0.7.37r. Iterate through the returned table to access individual data fields. ```lua local reader = peripheral.find("blockReader") --Prints the contents of the data for k, v in pairs(reader.getBlockData()) do print(k, v) end ``` -------------------------------- ### Get Blaze Burner Info Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/blazeburner.md Retrieves information about the Blaze Burner's current state, including fuel type, heat level, remaining burn time, and whether creative fuel is in use. Ensure the Create mod is installed. ```lua local blazeBurnerInfo = blazeBurner.getInfo() print('Fuel Type: ' .. blazeBurnerInfo.fuelType) print('Heat Level: ' .. blazeBurnerInfo.heatLevel) print('Remaining Burn Time: ' .. blazeBurnerInfo.remainingBurnTime) print('Is Creative Fuel: ' .. tostring(blazeBurnerInfo.isCreative)) ``` -------------------------------- ### Item Filter Syntax Examples Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/changelogs/0.7.24r.md Demonstrates the new syntax for item filters, including searching by tag or exact name. Note that multiple items or tags cannot be searched simultaneously. This filter system is also used for fluids. ```lua { name="#minecraft:wool" -- searches for the wool tag -- OR name="#forge:ores/gold" -- searches for the forge gold tag -- OR name="minecraft:white_wool" -- searches for white wool } ``` -------------------------------- ### Display Date and Time on AR Controller Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/ar_controller.md This example demonstrates how to find the AR controller, enable relative mode, and continuously display the current date and time in the top-right corner of the screen, updating every second. It clears previous text to prevent overlap. ```lua local controller = peripheral.find("arController") -- Finds the peripheral if one is connected if controller == nil then error("arController not found") end controller.setRelativeMode(true, 1600, 900) -- Convenient Aspect ratio for most screens while true do local timer = os.startTimer(1) local event, id repeat event, id = os.pullEvent("timer") until id == timer controller.clear() -- If you don't do this, the texts will draw over each other controller.drawRightboundString(os.date(), -10, 10, 0xffffff) end ``` -------------------------------- ### isOnline Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Checks if the storage grid is currently online and available. ```APIDOC ## isOnline ### Description Returns true if the grid is currently online and available. ### Method APICall ### Parameters None ### Response #### Success Response (boolean) - `true` if online, `false` otherwise. ``` -------------------------------- ### getMaxEnergy Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/ender_cell.md Gets the maximum energy capacity of the Ender Cell. ```APIDOC ## getMaxEnergy ### Description Returns the maximum quantity of storable energy inside the cell. ### Method ``` getMaxEnergy() -> number ``` ``` -------------------------------- ### List All Items in ME System Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of information about all items currently present in the ME system. Returns a table of item data or an error string. ```lua bridge.listItems() ``` -------------------------------- ### getRedstoneForChannel Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/immersive_engineering/connector.md Gets the redstone signal strength for a specific channel. ```APIDOC ## getRedstoneForChannel ### Description Returns the redstone signal strength for the given `color` channel. ### Method `getRedstoneForChannel(color: string)` ### Parameters #### Arguments - **color** (string) - Required - The name of the redstone channel to query. ### Returns - **number**: The redstone signal strength (0-15) for the specified channel. ``` -------------------------------- ### Initialize Giscus Theme Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/overrides/partials/comments.html Sets the Giscus theme on initial load based on the current site palette. Requires the Giscus script to be present. ```javascript var giscus = document.querySelector("script[src*=giscus]") // Set palette on initial load var palette = __md_get("__palette") if (palette && typeof palette.color === "object") { var theme = palette.color.scheme === "slate" ? "transparent_dark" : "light" // Instruct Giscus to set theme giscus.setAttribute("data-theme", theme) } ``` -------------------------------- ### getMaxChannels Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/ender_cell.md Gets the maximum number of channels configurable for the Ender Cell. ```APIDOC ## getMaxChannels ### Description Returns the maximum number of channels of the Ender Cell set in the Powah config file. ### Method ``` getMaxChannels() -> number ``` ``` -------------------------------- ### Handle Crafting Events with RS Bridge Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md This example demonstrates how to listen for and process crafting update events from the RS Bridge. It prints the job ID and details about the error or the new task state. ```lua local event, error, id, message = os.pullEvent("rs_crafting") print("A crafting update occurred for Job #" .. id) if error then print("There was an error while calculating or crafting the resource with the message " .. message) else print("The new state of the task is " .. message) end ``` -------------------------------- ### getCraftingCPUs Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of all connected crafting CPUs and their properties. ```APIDOC ## getCraftingCPUs ### Description Returns a list of all connected crafting cpus. ### Method ``` getCraftingCPUs() ``` ### Returns - **table** - A table containing information about each crafting CPU. #### CPU Properties | cpu | Description | | ---------------------- | -------------------------------------- | | storage: `number` | The amount of storage the CPU has | | coProcessors: `number` | The number of coprocessors the CPU has | | isBusy: `boolean` | If the cpu is currently crafting | ``` -------------------------------- ### getEnergy Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/ender_cell.md Gets the current stored energy within the Ender Cell. ```APIDOC ## getEnergy ### Description Returns the quantity of stored energy inside the cell. ### Method ``` getEnergy() -> number ``` ``` -------------------------------- ### List All Fluids in ME System Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of information about all fluids currently present in the ME system. Returns a table of fluid data or an error string. ```lua bridge.listFluid() ``` -------------------------------- ### Get Stored Energy Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the amount of energy currently stored in the grid. ```lua getStoredEnergy() -> int ``` -------------------------------- ### Get Warp Cooldown Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/end_automata.md Retrieves the current cooldown period for warp operations. ```APIDOC ## getWarpCooldown ### Description Returns the current cooldown for warp operations. ### Returns - `number`: The current warp cooldown in ticks. ``` -------------------------------- ### Get Saved Points Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/end_automata.md Retrieves a list of all saved warp points and their names. ```APIDOC ## points ### Description Returns a list of all saved points and their names. ### Returns - `table`: A table containing saved points and their names. - `nil, string`: If an error occurs, returns nil and an error message. ``` -------------------------------- ### Filter by Slots Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/filters.md Use `toSlot` and `fromSlot` to specify target and source inventory slots. Note that storage systems may ignore these fields for system slots. ```lua {toSlot = 6, -- Tries to move the item to this slot of the target inventory fromSlot = 36, -- Tries to remove the item from the offhand } ``` -------------------------------- ### List Craftable Items with ME Bridge Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Finds the ME bridge peripheral and iterates through all craftable items, printing their registry names. Ensure the 'meBridge' peripheral is available. ```lua local bridge = peripheral.find("meBridge") -- print out all craftable items craftableItems = bridge.listCraftableItems() for _, item in pairs(craftableItems) do print(item.name) end ``` -------------------------------- ### getTime Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md Returns the current daytime of the world. (Work in Progress) ```APIDOC ## getTime ### Description Returns the daytime of the current world. ### Method ``` getTime() -> number ``` ### Warning This function is currently a Work in Progress. ``` -------------------------------- ### Get Dimension Name Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md Retrieves the name of the current dimension. Ensure the peripheral is correctly identified. ```lua local detector = peripheral.find("environmentDetector") -- e.g. prints "Dimension: the_nether" print("Dimension: " .. detector.getDimension()) ``` -------------------------------- ### Import Item to Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Imports an item from the specified target. The filter can be empty to import every item. One call imports 64 of resources by default, can be set using the count filter key. The target can be a cardinal or relative direction, or a peripheral on the CC network. ```lua importItem(filter: table, target: string) -> table | nil, string ``` -------------------------------- ### Get Current Biome Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md Retrieves the current biome name. Ensure the peripheral is correctly identified. ```lua local detector = peripheral.find("environmentDetector") -- e.g. prints "Biome: minecraft:plains" print("Biome: " .. detector.getBiome()) ``` -------------------------------- ### getBlockStates Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/block_reader.md Returns the properties and state of the block. ```APIDOC ## getBlockStates ### Description Returns the properties of a block and its state. ### Signature `getBlockStates() -> table | nil` ``` -------------------------------- ### Get Digital Redstone Output Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/redstone_integrator.md Checks if a digital redstone signal is being output on a specified side. ```lua integrator.getOutput("right") ``` -------------------------------- ### getName Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/furnator.md Retrieves the name of the peripheral. ```APIDOC ## getName ### Description Returns the name of the peripheral. ### Returns - **string**: The name of the peripheral. ``` -------------------------------- ### Get ME System Energy Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves the current amount of stored energy in the ME system in AE units. ```lua local stored, err = bridge.getEnergyStorage() if err then print(err) else print("Stored Energy: " .. stored .. " AE") end ``` -------------------------------- ### Listen for Player Leaves Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/player_detector.md Use this to detect when a player leaves the server. It logs the player's username and the dimension they were in. ```lua local event, username, dimension = os.pullEvent("playerLeave") print("Player " .. username .. " left the server in the dimension " .. dimension) ``` -------------------------------- ### listItems Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of all items currently present in the ME system. ```APIDOC ## listItems ### Description Returns a list of information about all items in the ME System. ### Returns - `table`: A table containing information about items. - `err`: `string` - An error message if the operation failed. ``` -------------------------------- ### Set Redstone Integrator Output with Directions Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/changelogs/0.7r.md Demonstrates setting the output of a redstone integrator using both cardinal and relative directions. Ensure the redstoneIntegrator object is properly initialized before use. ```lua -- Both of these will work redstoneIntegrator.setOutput("north", true) redstoneIntegrator.setOutput("right", true) ``` -------------------------------- ### Get Analog Redstone Output Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/redstone_integrator.md Retrieves the current analog redstone level being output on a specified side. ```lua integrator.getAnalogOutput("left") ``` -------------------------------- ### getInventory Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/basin.md Returns a list of information about all of the items in the Basin. ```APIDOC ## getInventory ### Description Returns a list of information about all of the items in the Basin. ### Method `getInventory() -> table` ``` -------------------------------- ### Get Block States Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/block_reader.md Retrieves the properties and state of a block. This function was added in version 1.19.2-0.7.33r / 1.20.1-0.7.37r. ```lua local reader = peripheral.find("blockReader") -- Example usage (actual code not provided in source, only function signature) -- print(reader.getBlockStates()) ``` -------------------------------- ### Get Ender Cell Name Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/ender_cell.md Retrieves the name of the Ender Cell peripheral. This function does not require any arguments. ```lua enderCell.getName() ``` -------------------------------- ### Get Basin Filter Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/basin.md Retrieves the currently set item filter for the Basin. Requires the Create mod. ```lua getFilter() -> table ``` -------------------------------- ### Import Item from Peripheral Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/rs_bridge.md Imports an item from a specified container peripheral on the network. The container must be directly connected to the peripheral network. ```lua local bridge = peripheral.find("rsBridge") -- Example: Import 1 diamond from a chest named "MyChest" on the network -- bridge.importItemFromPeripheral({name="minecraft:diamond", count=1}, "MyChest") ``` -------------------------------- ### list() Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/integrated_dynamics/variable_store.md Returns a list of information about all variables stored in the Variable Store block. Each variable entry includes its ID, label, type, and whether it's dynamic. ```APIDOC ## list() ### Description Returns a list of information about all of the variables stored inside the Variable Store block. ### Returns - `table`: A table containing information about each stored variable. - `id` (string): The variable's id. - `label` (string): The label name for the variable. - `type` (string): The type of the variable. - `dynamic` (boolean): If the variable is dynamic. ``` -------------------------------- ### getItem Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/rs_bridge.md Returns a table with information about the item type in the system. ```APIDOC ## getItem ### Description Returns a table with information about the item type in the system. ### Method `getItem(item: table) -> table` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **item** (table) - Required - An item filter table. Can contain `name`, `nbt`, or `fingerprint`. - **name** (string) - The registry name of the item or a tag. - **nbt** (string?) - NBT to match the item on. - **fingerprint** (string) - A unique fingerprint which identifies the item. ### Request Example ```lua local itemInfo = rsBridge.getItem({ name = "minecraft:diamond" }) print(itemInfo.amount) ``` ### Response #### Success Response (table) - **name** (string) - The registry name of the item. - **fingerprint** (string?) - A unique fingerprint which identifies the item to craft. - **amount** (number) - The amount of the item in the system. - **displayName** (string) - The display name for the item. - **isCraftable** (boolean) - Whether the item has a crafting pattern or not. - **nbt** (string?) - NBT to match the item on. - **tags** (table) - A list of all of the item tags. #### Response Example ```json { "name": "minecraft:diamond", "fingerprint": "some_fingerprint", "amount": 64, "displayName": "Diamond", "isCraftable": true, "nbt": null, "tags": ["forge:gems", "forge:gems/diamond"] } ``` ``` -------------------------------- ### Get ME System Max Energy Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves the maximum energy storage capacity of the ME system in AE units. ```lua local max_stored, err = bridge.getMaxEnergyStorage() if err then print(err) else print("Max Storage: " .. max_stored .. " AE") end ``` -------------------------------- ### Get Distance to Point Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/end_automata.md Calculates the Manhattan distance from the turtle's current location to a specified warp point. ```APIDOC ## distanceToPoint ### Description Returns the distance from the turtle's current location to the location of the point using the [Manhattan distance formula](https://en.wikipedia.org/wiki/Taxicab_geometry). If the operation fails or the point does not exist then nil and an error message will be returned. ### Parameters #### Path Parameters - **name** (string) - Required - The name of the target warp point. ### Returns - `number`: The calculated distance. - `nil, string`: If the operation fails or the point does not exist, returns nil and an error message. ``` -------------------------------- ### Get Memory Card Owner Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/inventory_manager.md Retrieves the username of the player who owns the Memory Card inserted into the Inventory Manager. ```lua local manager = peripheral.find("inventoryManager") local owner = manager.getOwner() if owner then print("Memory card owner: " .. owner) else print("No memory card or owner found.") end ``` -------------------------------- ### List All Gases in ME System Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of information about all gases (from Applied Mekanistics) present in the ME system. Returns a table of gas data or an error string. ```lua bridge.listGas() ``` -------------------------------- ### Scroll Behaviour Entity Functions Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/create/scrollbehaviour.md Provides functions to get and set the target speed for scroll behaviour blocks. ```APIDOC ## getTargetSpeed ### Description Returns the target behaviour value of the block. ### Method ``` getTargetSpeed() -> number ``` ## setTargetSpeed ### Description Sets the target behaviour value of the block to the given `value`. Returns whether or not the value was successfully set. ### Method ``` setTargetSpeed(value: number) -> boolean ``` ``` -------------------------------- ### getItems Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/inventory_manager.md Retrieves the entire contents of the player's inventory. ```APIDOC ## getItems ### Description Returns the contents of the player's inventory as a list of items. ### Method `getItems() -> table` ### Response #### Success Response (table) - Returns a table where each element represents an item stack with properties like `name`, `count`, `maxStackSize`, `slot`, `displayName`, `tags`, and `nbt`. ``` -------------------------------- ### Get Redstone Channel Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/immersive_engineering/connector.md Retrieves the current redstone channel the connector is set to. Requires the Immersive Engineering mod. ```lua redstoneConnector.getRedstoneChannel() ``` -------------------------------- ### listCells Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of all cells in the disk drives of the ME system. This function is available starting from version 1.18.2-0.7.24r | 1.19.2-0.7.23b. ```APIDOC ## listCells ### Description Returns a list of information about all cells in the disk drives of the ME System. ### Returns - `table`: A table containing information about cells. - `cell`: `string` - The name of the cell. e.g. `ae2:64k_storage_cell` - `cellType`: `string` - The type of the cell. `item` or `fluid` - `bytesPerType`: `int` - The bytes per type - `totalBytes`: `int` - Total available bytes of the cell - `err`: `string` - An error message if the operation failed. ``` -------------------------------- ### Magmator Functions Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/magmator.md Provides a list of functions available for interacting with the Magmator peripheral. ```APIDOC ## Magmator Peripheral Functions ### `getName()` Returns the name of the peripheral. **Returns:** - `string`: The name of the peripheral. ### `getEnergy()` Returns the quantity of stored energy inside the Magmator. **Returns:** - `number`: The current stored energy. ### `getMaxEnergy()` Returns the maximum quantity of storable energy inside the Magmator. **Returns:** - `number`: The maximum energy capacity. ### `isBurning()` Returns true if the Magmator is currently burning (generating energy from the fluid heat source). **Returns:** - `boolean`: `true` if burning, `false` otherwise. ### `getTankCapacity()` Returns the overall capacity of the Magmator tank. **Returns:** - `number`: The total capacity of the fluid tank. ### `getFluidInTank()` Returns the stored volume (mb) of fluid inside the Magmator tank. **Returns:** - `number`: The current volume of fluid in the tank (in millibuckets). ``` -------------------------------- ### Import Fluid Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Imports a fluid from a specified target. By default, one call imports 1000mB of resources, which can be adjusted using the 'count' filter key. The filter can be empty to import all fluids. ```lua importFluid(filter: table, target: string) -> table | nil, string ``` -------------------------------- ### Get Used Fluid Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the total used internal fluid storage. For RS, this is in millibuckets; for AE2, this is in bytes. ```lua getUsedFluidStorage() -> int ``` -------------------------------- ### getItems Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/botania/pool.md Retrieves a list of all items currently placed on the Mana Pool. ```APIDOC ## getItems ### Description Returns a table with the items lying on the Mana Pool. ### Method `getItems()` ### Returns - **table**: A table containing the items on the Mana Pool. ``` -------------------------------- ### getBuildings Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/colony_integrator.md Returns a list of details about every building in the colony. ```APIDOC ## getBuildings ### Description Returns a list of details about every building in the colony. ### Method ``` getBuildings() -> table ``` ### Parameters None ### Response #### Success Response (table) - **building** (table) - A list of building objects. Each building object contains details about its type, level, and location. ### Request Example ```lua local buildings = colonyIntegrator.getBuildings() print(textutils.serialize(buildings)) ``` ### Response Example ```json { "example": "[building table]" } ``` ``` -------------------------------- ### Get Used Item Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the total used internal item storage. For RS, this is in items; for AE2, this is in bytes. ```lua getUsedItemStorage() -> int ``` -------------------------------- ### Get Energy Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/rs_bridge.md Returns the currently stored energy in the entire RS system, measured in Forge Energy (FE). ```lua local bridge = peripheral.find("rsBridge") local storedEnergy = bridge.getEnergyStorage() print("Stored energy: " .. storedEnergy .. " FE") ``` -------------------------------- ### Get Total Fluid Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the total available internal fluid storage. For RS, this is in millibuckets; for AE2, this is in bytes. ```lua getTotalFluidStorage() -> int ``` -------------------------------- ### List all stored variables Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/integrated_dynamics/variable_store.md Use the `list()` function to get information about all variables currently stored in the Variable Store block. This is useful for inventory management or debugging. ```lua variableStore.list() ``` -------------------------------- ### Get Total Item Storage Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns the total available internal item storage. For RS, this is in items; for AE2, this is in bytes. ```lua getTotalItemStorage() -> int ``` -------------------------------- ### Get Dig Operation Cooldown Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/weak_automata.md Returns the current cooldown duration for dig operations. This indicates how long until the turtle can dig again. ```lua getDigCooldown() ``` -------------------------------- ### importItem Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Imports an item from a specified target into the storage system. ```APIDOC ## importItem ### Description Imports an item from the specified target. The filter can be empty to import every item. One call imports 64 of resources by default, can be set using the count filter key. ### Method APICall ### Parameters #### Query Parameters - **filter** (table) - Required - Our item/fluid/chemical filters. See [here](/../guides/filters) for syntax. - **target** (string) - Required - The direction or peripheral name to import from. ### Response #### Success Response (table | nil, string) - Returns a table with information about the imported item, or nil with a debug message if the import failed. ``` -------------------------------- ### Get Turtle Fuel Level Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/weak_automata.md Retrieves the current fuel points stored in the turtle. Useful for monitoring energy levels. ```lua getFuelLevel() ``` -------------------------------- ### playerJoin Event Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/player_detector.md Fires when a player joins the world or a server. Provides the username and the dimension the player joined in. ```APIDOC ## Event: playerJoin ### Description Fires when a player joins the world/a server. ### Values - `username` (string): The username of the player who joined - `dimension` (string): The resource id of the dimension the player is in ### Example ```lua local event, username, dimension = os.pullEvent("playerJoin") print("Player " .. username .. " joined the server in the dimension " .. dimension) ``` ``` -------------------------------- ### Get Warp Cooldown Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/turtles/metaphysics/end_automata.md Retrieves the current cooldown duration for warp operations. This indicates how long until the next warp can be initiated. ```lua getWarpCooldown() -> number ``` -------------------------------- ### List All Craftable Items Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Retrieves a list of all items that have crafting patterns available in the ME system. ```lua local craftable_items, err = bridge.listCraftableItems() if err then print(err) else print("Craftable Items:") for _, item_info in ipairs(craftable_items) do print("- " .. item_info.name) end end ``` -------------------------------- ### Import Item into ME System Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/me_bridge.md Imports a specified item from a container in a given direction into the ME system. Ensure the item and direction are valid. ```lua local bridge = peripheral.find("meBridge") -- Imports 32 dirt from the container above into the system bridge.importItem({name="minecraft:dirt", count=1}, "up") ``` -------------------------------- ### Get Player Armor Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/inventory_manager.md Retrieves a table containing information about the items currently equipped in the player's armor slots. ```lua local manager = peripheral.find("inventoryManager") local armor = manager.getArmor() print("First armor piece is: " .. armor[1].displayName) ``` -------------------------------- ### Get Ender Cell Max Energy Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/ender_cell.md Retrieves the maximum energy capacity of the Ender Cell. This function does not require any arguments. ```lua enderCell.getMaxEnergy() ``` -------------------------------- ### getVisitors Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/colony_integrator.md Returns a list of information about all visitors in the colony's tavern. This includes recruit cost information. ```APIDOC ## getVisitors ### Description Returns a list of information about all of the visitors in your colony's tavern. This information is the same as the `citizen` table but there is an additional `recruitCost` table. ### Method ``` getVisitors() -> table ``` ### Parameters None ### Response #### Success Response (table) - **visitor** (table) - A list of visitor objects, each with the following properties: - **id**: `string` - The visitor's id - **name**: `string` - The visitor's name - **age**: `string` - The age of the visitor, either "child" or "adult" - **gender**: `string` - The visitor's gender, either "male" or "female" - **location**: `table` - The current location of the visitor (has `x`, `y`, `z`) - **bedPos**: `table` - The position of the visitor's bed (has `x`, `y`, `z`) - **saturation**: `number` - The visitor's food saturation - **happiness**: `number` - An indicator of how happy the visitor is - **health**: `number?` - The visitor's current health - **maxHealth**: `number?` - The visitor's max health - **armor**: `number?` - The visitor's current number of armor points - **toughness**: `number?` - The visitor's armor toughness - **betterFood**: `boolean` - Whether the visitor needs better food - **isAsleep**: `boolean` - If the visitor is currently asleep - **isIdle**: `boolean` - If the visitor is currently idle - **state**: `string` - A string representing the visitor's current state - **children**: `table` - A list of the ids of this visitor's children - **skills**: `table` - A table of skill names to skills where each skill has a `level` and `xp` number - **work**: `table?` - A table of info about the visitor's job: - **name**: `string` - The name of the work building - **job**: `string` - The name of the job - **location**: `table` - The work location (has `x`, `y`, `z`) - **type**: `string` - The building type - **level**: `number` - The building's level - **home**: `table?` - A table of info about the visitor's house: - **location**: `table` - The home location (has `x`, `y`, `z`) - **type**: `string` - The building type - **level**: `number` - The building's level - **recruitCost**: `table` - A table detailing the cost to recruit the visitor: - **name**: `string` - The registry name of the item - **count**: `number` - The amount of the item - **maxStackSize**: `number` - Maximum stack size for the item type - **displayName**: `string` - The item's display name - **tags**: `table` - A list of item tags - **nbt**: `table` - The item's nbt data ### Request Example ```lua local visitors = colonyIntegrator.getVisitors() print(textutils.serialize(visitors)) ``` ### Response Example ```json { "example": "[visitor table]" } ``` ``` -------------------------------- ### Get Ender Cell Energy Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/powah/ender_cell.md Retrieves the current amount of energy stored in the Ender Cell. This function does not require any arguments. ```lua enderCell.getEnergy() ``` -------------------------------- ### Listen for Chat Messages Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/chat_box.md This snippet demonstrates how to listen for the 'chat' event, which fires when a player sends a message. The event provides the sender's username, message content, UUID, and whether the message was hidden. ```lua local event, username, message, uuid, isHidden, messageUtf8 = os.pullEvent("chat") print("The 'chat' event was fired with the username " .. username .. " and the message " .. message) ``` -------------------------------- ### Get Maximum Mana Capacity Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/botania/spreader.md Returns the maximum mana capacity of the Mana Spreader. This value is constant for a given spreader. ```lua local maxMana = manaSpreader.getMaxMana() print('Max mana capacity: ' .. maxMana) ``` -------------------------------- ### Get Draconic Reactor Information Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/integrations/draconic_evolution/reactor.md Call this function to retrieve a table containing the current status and details of the Draconic Reactor. ```lua getReactorInfo() -> table ``` -------------------------------- ### isRaining Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/peripherals/environment_detector.md Checks if it is currently raining. ```APIDOC ## isRaining ### Description Returns true if it is raining. ### Method ``` isRaining() -> boolean ``` ``` -------------------------------- ### getCraftingTasks Source: https://github.com/intelligencemodding/advanced-peripherals-documentation/blob/0.7/docs/guides/storage_system_functions.md Returns every crafting task that is currently running. ```APIDOC ## getCraftingTasks ### Description Returns every crafting task that is currently running. ### Returns - **table** - A table containing all currently running crafting tasks. ```