Create Aeronautics: Thrusters and Things 图标

Create Aeronautics: Thrusters and Things

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 0.1.17
本资源为搬运资源,原资源地址: https://modrinth.com/mod/create-aeronautics-thrusters-and-things
资源信息

Minecraft 版本: 1.21.1

平台: neoforge

标签: game-mechanics transportation utility

资源介绍

title_text

? NOW WITH PONDERS!

Showcase

Spoiler

Take your Create Aeronautics contraptions to the next level.

Join the Discord!

Realtime live Issue Tracker!

Realtime Roadmap for planned features and what I'm currently working on!

Create Thrusters and Things adds propulsion, steering, power, and control systems built for ships, aircraft, and advanced moving machines. Build anything from a simple hover platform to a fully scriptable flight rig.


? What you can build now

? Fuel-powered and energy-powered thruster systems
? Steerable propulsion setups with specialised bearings
?️ Manual flight controls with joystick input and controller channels
⚙️ Smart mechanical routing with dual-lane gearbox behavior
Full power loops with generation, transfer, and motor output
? Utility systems for docking, grabbing, and automation

? New Blocks

Block Block Block
Thruster Thruster Bearing Analogue Joystick
Contraption Controller Industrial Alternator Smart Gearbox
Advanced Data Link Andesite Cable Industrial Motor
Variable Transmission Claw Physics Gantry
Powered Zipline Fuel Oxidizer Entity Launcher
Shipping Manifest

? New Items

Upgrades

  • Processing Upgrades — Smoking, Smelting, Haunting (Tiers 1–4)
  • Propulsion Upgrades (Tiers 1–4)

Tools & Accessories

  • Thruster Lens
  • Physics Staff
  • Physics Goggles
  • Contraption Network Linker
  • Configuration Clipboard

✨ Feature Highlights

  • ? Color your thruster plume/beam with dyes for custom builds.
  • ? Run thrusters in quieter Peaceful mode for cleaner visuals and reduced noise.
  • ? Switch between classic fuel and Focused FE beam operation with the Thruster Lens.
  • ? Feed fuel and FE through mounted bearing/gimbal assemblies for distributed propulsion setups.
  • ? Use Smart Gearbox in passthrough or servo workflows for advanced control layouts.
  • ?️ Flip face output direction on Smart Gearbox with simple right-click interaction.
  • ? Slow down rotation with redstone using the Variable Transmission.
  • ? Bulk process faster and more efficiently by placing depots or belts along the sides of the thruster plume/beam and in front of it to process everything around it!
  • ?️ Add and store up to 15 maps inside the Navigation table at once, and pick one to set the table's navigation to at any time!
  • ? Use the Physics Goggles to see real-time physics information and contraption diagrams for any contraption you look at!
  • ? Use the Contraption Network Linker to wirelessly control redstone capable blocks from the Contraption Controller without needing redstone links!
  • ? Tom's Simple Storage Wireless terminal compatibility with Aeronautics has been added!
  • And so much more!

? Automation Ready

CC:Tweaked peripheral support for major systems, including thrusters, bearings, gearbox, joystick, controller, and more. Control single devices or orchestrate attached thruster groups from code.

? Bundled in-game docs browser at /rom/thrusters/docs.lua — browse with keyboard on any computer, or use mouse and search on Advanced Computers
? Runnable example scripts included for joysticks, thrusters, bearings, controllers, navigation, claws, and more

? ComputerCraft peripheral snippets for all you programmers!


Build bigger. Fly farther. Automate everything.

Spoiler # Create Thrusters & Things — ComputerCraft API This document covers every ComputerCraft peripheral exposed by this addon. ## Getting Started ComputerCraft peripherals let you control mod blocks from Lua scripts running on a Computer or Pocket Computer. To connect to a block, place the computer next to it (or use a Wired Modem) and use `peripheral.find()` or `peripheral.wrap()`: ```lua local t = peripheral.find("thruster") if t then t.setEnabled(true) t.setThrottle(0.5) end ``` Blocks default to `"auto"` mode, which means they'll respond to whatever input is present — redstone, computer, or manual. You can lock a block to a specific control mode through its GUI or via `setControlMode()` if you want to prevent other inputs from interfering. --- ## Peripherals | Type string | Block | |---|---| | `thruster` | Thruster | | `thruster_bearing` | Thruster Bearing | | `bidirectional_gearbox` | Smart Gearbox | | `analogue_contraption_controller` | Contraption Controller | | `analogue_joystick` | Analogue Joystick | | `claw` | Claw | | `rope_winch_cable` | Rope Winch Cable (when a Claw is attached) | --- ## 1. Thruster **Type:** `"thruster"` ### Methods | Method | Returns | Description | |---|---|---| | `setThrottle(throttle)` | — | Sets throttle. Range `0.0` to `1.0`. Throws if out of range. | | `getThrottle()` | `number` | Returns current throttle. | | `clearThrottleOverride()` | — | Removes the computer throttle override, returning control to redstone or auto. | | `setEnabled(enabled)` | — | Enables or disables the thruster. | | `isEnabled()` | `boolean` | | | `isActive()` | `boolean` | Whether the thruster is actively firing. | | `getFuel()` | `number` (mB) | Current fuel level. | | `getFuelCapacity()` | `number` (mB) | Maximum fuel capacity. | | `getFuelType()` | `string` | Fluid ID of current fuel, or empty string. | | `getBurnTimeSeconds()` | `number` | Estimated burn time remaining. | | `getThrust()` | `number` | Target thrust value. | | `getRealThrust()` | `number` | Actual thrust being applied. | | `getLiftCapacity()` | `number` | Max lift this thruster can provide. | | `getAirflow()` | `number` | Current airflow value. | | `getRedstoneSignal()` | `number` (`0`–`15`) | Incoming redstone signal strength. | | `getControlMode()` | `string` | Current mode: `auto`, `redstone`, or `computer`. | | `setControlMode(mode)` | — | Set control mode. | | `getName()` | `string` | Custom display name. | | `setName(name)` | — | Set a custom display name. | | `isSoulMode()` | `boolean` | Whether soul mode (peaceful/quiet operation) is enabled. | | `setSoulMode(enabled)` | — | Toggle soul mode. | | `getStatus()` | `table` | Full status snapshot (see below). | ### `getStatus()` return shape ```lua { enabled = boolean, throttle = number, computerThrottle = number, controlMode = string, fuel = number, fuelCapacity = number, fuelType = string, burnTimeSeconds = number, thrust = number, realThrust = number, liftCapacity = number, airflow = number, active = boolean, soulMode = boolean, redstoneSignal = number, } ``` ### Example ```lua local t = peripheral.find("thruster") if t then t.setControlMode("computer") t.setEnabled(true) t.setThrottle(0.75) print("Real thrust:", t.getRealThrust()) end ``` --- ## 2. Thruster Bearing **Type:** `"thruster_bearing"` Controls the bearing's pivot angle and steering mode, and manages any thrusters attached to it as a group. Most thruster methods accept either a specific thruster ID or `"all"` to target every attached thruster at once. ### Bearing control | Method | Returns | Description | |---|---|---| | `getName()` / `setName(name)` | `string` / — | Custom display name. | | `getFacing()` / `setFacing(direction)` | `string` / — | Facing direction. | | `getPivotAngle()` | `number` (degrees) | Current pivot angle. | | `setPivotAngle(angleDeg)` | — | Set pivot angle directly (servo/computer mode). | | `clearPivotOverride()` | — | Remove computer pivot override. | | `getServoInputAngle()` | `number` (degrees) | Target angle from servo input. | | `getBearingControlMode()` | `string` | Current mode: `auto`, `redstone`, `computer`, or `servo`. | | `setBearingControlMode(mode)` | — | Set bearing control mode. | | `getMinAngle()` / `setMinAngle(angleDeg)` | `number` / — | Minimum allowed pivot angle. | | `getMaxAngle()` / `setMaxAngle(angleDeg)` | `number` / — | Maximum allowed pivot angle. | | `getForwardSignal()` | `number` | Redstone signal on forward face. | | `getBackwardSignal()` | `number` | Redstone signal on backward face. | ### Thruster discovery | Method | Returns | Description | |---|---|---| | `listThrusters()` | `table` | All attached thrusters keyed by ID (see below). | | `getThrusterCount()` | `number` | How many thrusters are attached. | | `getOwnedThrusters()` | `string[]` | List of thruster IDs. | | `ids()` | `string[]` | List of thruster aliases. | | `thrusterAlias(idOrAlias, alias)` | — | Assign an alias to a thruster for easier targeting. | | `getNetworkInfo()` | `table` | Full network summary. | `listThrusters()` return shape: ```lua { ["id"] = { alias = string, pos = {x, y, z}, fuelType = string, controlMode = string, enabled = boolean, throttle = number, } } ``` ### Per-thruster control All of these accept a thruster ID, an alias, or `"all"`. When `"all"` is used, read methods return a table keyed by thruster ID. | Method | Returns | |---|---| | `setThrottle(id, throttle)` | — (accepts `0.0`–`1.0` or `0`–`100`) | | `getThrottle(id)` | `number` or map | | `getThrottleMap(id)` | always a map | | `setEnabled(id, enabled)` | — | | `isEnabled(id)` | `boolean` or map | | `getFuel(id)` | `number` or map | | `getFuelCapacity(id)` | `number` or map | | `getFuelType(id)` | `string` or map | | `getBurnTimeSeconds(id)` | `number` or map | | `getControlMode(id)` | `string` or map | | `setControlMode(id, mode)` | — (`auto`, `redstone`, or `computer`) | | `getThrust(id)` | `number` or map | | `getRealThrust(id)` | `number` or map | | `getLiftCapacity(id)` | `number` or map | | `getAirflow(id)` | `number` or map | | `isActive(id)` | `boolean` or map | | `isSoulMode(id)` | `boolean` or map | | `setSoulMode(id, enabled)` | — | | `clearThrottleOverride(id)` | — | | `getRedstoneSignal(id)` | `number` or map | | `getThrusterStatus(id)` | telemetry table, or map of tables for `"all"` | ### Assembly totals | Method | Returns | |---|---| | `getTotalRealThrust()` | `number` | | `getTotalLiftCapacity()` | `number` | | `getStatus()` | Full bearing + thruster snapshot (see below) | `getStatus()` return shape: ```lua { facing = string, forwardSignal = number, backwardSignal = number, controlMode = string, servoInputAngle = number, pivotAngle = number, targetAngle = number, minAngle = number, maxAngle = number, totalRealThrust = number, totalLiftCapacity = number, thrusterCount = number, thrusters = table, -- same shape as listThrusters() } ``` ### Example ```lua local b = peripheral.find("thruster_bearing") if b then b.setBearingControlMode("servo") b.setPivotAngle(22.5) b.setThrottle("all", 80) local net = b.getNetworkInfo() print("Thrusters:", net.thrusterCount) end ``` --- ## 3. Smart Gearbox **Type:** `"bidirectional_gearbox"` The Smart Gearbox has two operating modes. In **passthrough** mode it routes two independent rotation speeds through its lanes. In **servo** mode it drives each output face to a precise angle. ### Methods | Method | Returns | Description | |---|---|---| | `getMode()` / `setMode(mode)` | `string` / — | Current operating mode. | | `isServoMode()` | `boolean` | | | `hasGyroSource()` | `boolean` | Whether a Gyroscope Link is providing input. | | `getLaneMode(axis)` / `setLaneMode(axis, mode)` | `string` / — | Get or set mode for a lane. Axis accepts `x`, `east_west`, `east-west`, `ew`, `z`, `north_south`, `north-south`, or `ns`. | | `isReverseMode()` | `boolean` | | | `getSpeed()` | `number` | | | `getLaneSpeed(axis)` | `number` | Speed of a specific lane. | | `getSignal(face)` | `number` | Redstone signal on a face. Accepts `north`, `south`, `east`, `west`. | | `getFaceAngle(face)` / `setFaceAngle(face, angle)` | `number` / — | Get or set the target angle for a face. | | `getFaceMaxAngle(face)` / `setFaceMaxAngle(face, angle)` | `number` / — | Get or set the maximum angle limit for a face. | | `clearFaceAngle(face?)` | — | Clear the angle override for a face, or all faces if omitted. | | `clearFaceMaxAngle(face?)` | — | Clear the max angle limit for a face, or all faces if omitted. | | `getStatus()` | `table` | Full status snapshot (see below). | `getStatus()` return shape: ```lua { servoMode = boolean, gyroSource = boolean, mode = string, reverseMode = boolean, speed = { north_south = number, east_west = number }, laneModes = { north_south = string, east_west = string }, signals = { north = number, south = number, east = number, west = number }, angles = { north = number, south = number, east = number, west = number }, maxAngles = { north = number, south = number, east = number, west = number }, } ``` ### Example ```lua local gb = peripheral.find("bidirectional_gearbox") if gb then gb.setMode("servo") gb.setFaceAngle("north", 30) gb.setFaceMaxAngle("north", 60) end ``` --- ## 4. Contraption Controller **Type:** `"analogue_contraption_controller"` The Contraption Controller manages named channels, each of which can be configured with different input behaviors like latching, stepping, or momentary press. Channels output a value from `0.0` to `1.0` that maps to a redstone signal strength. ### Methods | Method | Returns | Description | |---|---|---| | `getName()` / `setName(name)` | `string` / — | Custom display name. | | `listChannels()` | `string[]` | Names of all configured channels. | | `getChannel(name)` | `table` | Current state of a channel. | | `setChannel(name, value)` | — | Set a channel value directly. Range `0.0`–`1.0`. | | `getChannelMode(name)` / `setChannelMode(name, mode)` | `string` / — | Get or set the channel's behavior mode. | | `getChannelConfig(name)` | `table` | Full channel configuration. | | `setChannelConfig(name, configTable)` | — | Update channel configuration (see keys below). | | `press(name)` | — | Simulate pressing a channel. | | `release(name)` | — | Simulate releasing a channel. | | `tap(name)` | — | Simulate a quick press and release. | | `reset(name)` | — | Reset a channel to its default state. | | `resetAll()` | — | Reset all channels. | | `getAxis(name)` | `table` | State of a named axis. | | `getAllSignals()` | `table` | Current output values for all channels. | ### `setChannelConfig` keys | Key | Type | Description | |---|---|---| | `mode` | `string` | Channel behavior mode. | | `min`, `max` | `number` | Output range. | | `riseRate`, `fallRate` | `number` | How fast the value ramps up or down. | | `stepAmount` | `number` | Step size for step mode. | | `deadzone`, `smoothing` | `number` | Input filtering. | | `debounceTicks`, `repeatIntervalTicks` | `number` | Timing values (integer). | | `resetToZero` | `boolean` | Whether to return to zero on release. | | `repeatWhileHeld` | `boolean` | Whether to keep firing while held. | | `value` | `number` | Sets the channel value directly. | | `frequencyA`, `frequencyB` | `string` | Item IDs for wireless link frequencies (e.g. `"minecraft:iron_nugget"`). Blank string to clear. | ### Example ```lua local c = peripheral.find("analogue_contraption_controller") if c then c.setChannelMode("throttle_up", "latch") c.setChannel("throttle_up", 1.0) print(textutils.serialize(c.getAllSignals())) end ``` --- ## 5. Analogue Joystick **Type:** `"analogue_joystick"` The joystick outputs tilt values to redstone links and can be wrapped as a peripheral for naming. For reading live tilt values in code, wrap the bound redstone links as peripherals or read their outputs via the Contraption Controller. ### Methods | Method | Returns | |---|---| | `getName()` | `string` | | `setName(name)` | — | ### Example ```lua local j = peripheral.find("analogue_joystick") if j then j.setName("Pilot Stick") end ``` --- ## 6. Claw **Type:** `"claw"` The Claw grips and releases physics sub-levels. Signal strength controls grip — `15` means the claw will never drop its load, `0` means fully open. The drop chance scales with how low the signal is. The Claw can also detect and target nearby connector blocks for precise docking. ### Methods | Method | Returns | Description | |---|---|---| | `setSignal(signal)` | — | Set grip strength. Range `0`–`15`. | | `clearSignalOverride()` | — | Remove computer signal override. | | `open()` | — | Fully open the claw (signal 0). | | `close()` | — | Fully close the claw (signal 15). | | `release()` | — | Release the held sub-level. | | `getSignal()` | `number` | Current effective signal. | | `getComputerSignal()` | `number` | Computer override value. `-1` means no override. | | `isHolding()` | `boolean` | Whether the claw is holding a sub-level. | | `getHeldConnectorPos()` | `{x,y,z}` or `nil` | Position of the connector being held. | | `getSelectedConnectorPos()` | `{x,y,z}` or `nil` | Position of the targeted connector. | | `getNearestConnector()` | `{x,y,z}` or `nil` | Nearest connector within default range. | | `getNearestConnectorInRange(range)` | `{x,y,z}` or `nil` | Nearest connector within a given range. | | `getConnectorsInRange(range)` | `[{x,y,z}, ...]` | All connectors within range. | | `getConnectorsInRangeLimited(range, limit)` | `[{x,y,z}, ...]` | All connectors within range, up to a limit. | | `isConnectorInRange(x,y,z)` | `boolean` | Whether a connector is within default range (3). | | `isConnectorInRangeWithRadius(x,y,z,range)` | `boolean` | Whether a connector is within a given range. | | `selectConnector(x,y,z)` | `boolean` | Target a specific connector for gripping. | | `clearSelectedConnector()` | — | Clear the targeted connector. | | `getStatus()` | `table` | Full status snapshot (see below). | `getStatus()` return shape: ```lua { signal = number, computerSignal = number, holding = boolean, heldPos = {x=number, y=number, z=number} | nil, selectedPos = {x=number, y=number, z=number} | nil, } ``` ### Example ```lua local claw = peripheral.find("claw") if claw then local p = claw.getNearestConnectorInRange(5) if p then claw.selectConnector(p.x, p.y, p.z) end claw.close() end ``` --- ## 7. Rope Winch Cable (Claw passthrough) **Type:** `"rope_winch_cable"` Only registered when the Rope Winch has a Claw attached. Exposes the same control surface as the Claw peripheral directly, so you can control the claw through the winch cable without needing a direct connection to the claw itself. All claw methods throw `"no claw connected to this rope winch"` if the attachment is missing. ### Methods | Method | Returns | |---|---| | `isConnected()` | `boolean` | | `getRemoteType()` | `"claw"` or `"none"` | Plus all Claw methods listed in section 6. Note that position methods return `{}` instead of `nil` when there is no result, unlike the direct Claw peripheral which returns `nil`. ### Example ```lua local rw = peripheral.find("rope_winch_cable") if rw and rw.isConnected() then rw.open() local s = rw.getStatus() print("Holding:", s.holding) end ``` # Create Thrusters & Things — External Compat ComputerCraft API This document covers native ComputerCraft peripherals that this addon exposes for external Simulated and Aeronautics block entities. ## Getting Started Wrap or find a peripheral by its type string: ```lua local burner = peripheral.find("hot_air_burner") if burner then print("Signal:", burner.getSignal()) print("Gas output:", burner.getGasOutput()) end ``` Most peripherals below use a shared reflection-backed helper surface. `directional_gearshift` is the exception: it now has its own purpose-built API with gearshift-specific methods instead of the generic signal/range/color set. ## Peripherals | Type string | External block entity id(s) | Block | |---|---|---| | `laser_pointer` | `simulated:laser_pointer` | Simulated Laser Pointer | | `laser_sensor` | `simulated:laser_sensor`, `simulated:ir_sensor` | Simulated Laser Sensor | | `analogue_transmission` | `simulated:analogue_transmission`, `simulated:simple` | Simulated Analogue Transmission | | `redstone_accumulator` | `simulated:redstone_accumulator` | Simulated Redstone Accumulator | | `redstone_inductor` | `simulated:redstone_inductor` | Simulated Redstone Inductor | | `redstone_magnet` | `simulated:redstone_magnet` | Simulated Redstone Magnet | | `optical_sensor` | `simulated:optical_sensor` | Simulated Optical Sensor | | `docking_connector` | `simulated:docking_connector` | Simulated Docking Connector | | `altitude_sensor` | `simulated:altitude_sensor` | Simulated Altitude Sensor | | `hot_air_burner` | `aeronautics:adjustable_burner` | Aeronautics Hot Air Burner | | `steam_vent` | `aeronautics:steam_vent` | Aeronautics Steam Vent | | `mounted_potato_cannon` | `aeronautics:mounted_potato_cannon` | Aeronautics Mounted Potato Cannon | ### `directional_gearshift` ```lua local gearshift = peripheral.find("directional_gearshift") if gearshift then gearshift.setOutputs(true, false) print("Left:", gearshift.isLeftPowered(), "Right:", gearshift.isRightPowered()) end ``` | Method | Returns | Description | |---|---|---| | `setLeft(powered)` | — | Set the left-side gearshift input/output state. | | `setRight(powered)` | — | Set the right-side gearshift input/output state. | | `setOutputs(left, right)` | — | Set both left and right states together. | | `clear()` | — | Clears both gearshift states back to off. | | `isLeftPowered()` | `boolean` | Current left state. | | `isRightPowered()` | `boolean` | Current right state. | | `getRotationModifier(face)` | `number` | Returns the rotation modifier for a face name like `north`, `south`, `east`, or `west`. | | `getStatus()` | `table` | Returns `leftPowered`, `rightPowered`, `sourceFacing`, `blockPos`, and `className`. | `directional_gearshift` is now the recommended pattern for blocks that have distinct left/right behavior; the controller and CC layers both map to those explicit sides rather than a generic `setSignal()` call. --- ## Common Method Surface Every non-gearshift type above exposes the methods below. | Method | Returns | Description | |---|---|---| | `getName()` | `string` | Custom name if exposed by target block entity, otherwise empty string. | | `setName(name)` | — | Sets custom name when supported. | | `getSignal()` | `number` (`0`-`15`) | Reads signal-like value from the block entity. | | `setSignal(signal)` | — | Writes signal-like value when writable (`0`-`15`). Throws if unsupported. | | `isPowered()` | `boolean` | Whether block is currently powered/active. | | `getRange()` | `number` | Laser/sensor range for compatible blocks. | | `setRange(range)` | — | Set range for compatible blocks. Throws if unsupported. | | `hasHit()` | `boolean` | Sensor hit status for compatible sensor blocks. | | `getDistance()` | `number` | Hit distance / blocked distance when available; `-1` if unavailable. | | `getColor()` | `number` | Laser color as RGB integer when available. | | `setColor(color)` | — | Set RGB laser color (`0x000000` to `0xFFFFFF`). Throws if unsupported. | | `isRainbow()` | `boolean` | Rainbow laser mode for compatible blocks. | | `setRainbow(enabled)` | — | Toggle rainbow mode. Throws if unsupported. | | `getAirPressure()` | `number` | Atmospheric pressure for altitude-capable devices; `-1` if unavailable. | | `getWorldHeight()` | `number` | World height from block sensor API when exposed. | | `getGasOutput()` | `number` | Gas output for burner/vent blocks; `0` if unavailable. | | `getState()` | `string` | Machine state enum/string if present, else `"unknown"`. | | `isBlocked()` | `boolean` | Blocked-state indicator for cannon-style devices. | | `getBlockedLength()` | `number` | Blocked penetration distance where exposed. | | `getFacing()` | `string` | Facing direction if available from API or block state. | | `getPosition()` | `table` | `{ x, y, z }` block position. | | `getClassName()` | `string` | Runtime Java class name backing this peripheral. | | `getStatus()` | `table` | Full merged status snapshot (see below). | | `methods()` | `string[]` | Human-readable list of method signatures. | | `help(method?)` | `table` or `string` | Documentation map, or single method help string. | ### `getStatus()` return shape ```lua { type = string, name = string, signal = number, powered = boolean, range = number, hasHit = boolean, distance = number, worldHeight = number, airPressure = number, gasOutput = number, state = string, facing = string, blocked = boolean, blockedLength = number, color = number, rainbow = boolean, position = { x = number, y = number, z = number }, className = string, } ``` --- ## Block-Specific Notes ### Laser devices `laser_pointer`, `laser_sensor`, and `optical_sensor` are the best fit for: - `getRange()` / `setRange(range)` - `hasHit()` / `getDistance()` - `getColor()` / `setColor(color)` - `isRainbow()` / `setRainbow(enabled)` ### Altitude and atmospheric devices `altitude_sensor`, `hot_air_burner`, and `steam_vent` provide the most useful results for: - `getWorldHeight()` - `getAirPressure()` - `getGasOutput()` ### Mounted Potato Cannon `mounted_potato_cannon` is the primary user of: - `isBlocked()` - `getBlockedLength()` - `getState()` ### Redstone machines `analogue_transmission`, `redstone_accumulator`, `redstone_inductor`, and `redstone_magnet` primarily expose: - `getSignal()` - `isPowered()` - `getState()` - `getStatus()` --- ## Example Scripts ### 1) Laser Pointer Control ```lua local p = peripheral.find("laser_pointer") if p then p.setSignal(15) p.setColor(0x00FF66) p.setRainbow(false) print(textutils.serialize(p.getStatus())) end ``` ### 2) Altitude Monitoring ```lua local a = peripheral.find("altitude_sensor") if a then while true do print("Height:", a.getWorldHeight(), "Pressure:", a.getAirPressure()) sleep(0.5) end end ``` ### 3) Burner + Vent Snapshot ```lua local burner = peripheral.find("hot_air_burner") local vent = peripheral.find("steam_vent") if burner then print("Burner gas:", burner.getGasOutput()) end if vent then print("Vent gas:", vent.getGasOutput()) end ``` ### 4) Cannon Safety Polling ```lua local c = peripheral.find("mounted_potato_cannon") if c then print("Blocked:", c.isBlocked(), "Length:", c.getBlockedLength(), "State:", c.getState()) end ``` --- ## Error Behavior Write operations that are unsupported by a specific block throw a Lua error rather than silently failing. Examples: - `setSignal()` on a block without writable signal fields/methods - `setRange()` on a non-range block - `setColor()` on a non-laser block - `setRainbow()` on a non-rainbow block Use `getClassName()` and `help()` in scripts to dynamically adapt behavior for mixed block fleets.
📥 下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
TiersPlus

价格:0 墨喵币
下载量:0

查看详情
Sciophobia

价格:0 墨喵币
下载量:0

查看详情
Basket

价格:0 墨喵币
下载量:0

查看详情
Serverpack Priority

价格:0 墨喵币
下载量:0

查看详情