- A video player running at 144p achieves around 1 million operations per second on a single ComputerCraft machine
- Audio workload is distributed across multiple speakers to split processing and reduce sound noise

Minecraft Computer Mods
A community for programming both outside and inside Minecraft, such as with mods ComputerCraft and OpenComputers.
2,355 Online
7,348 Members
computercraft
Summarized from recent messages. Can get things wrong.
- A program using `spk.speakerPlay("audio/decide.mp3",0.5)` works on one ComputerCraft PC but gives an error about file content on another, despite having identical code and audio files.
- The error message suggests passing file content rather than the path, but a direct `fs.open` approach works as a workaround.
- A key challenge is that turtles can be unloaded at any time, even between performing an action and saving its state, leading to desynchronization
- Using fuel level changes can determine if a turtle moved, but it doesn't track facing or what blocks were mined
- Using `repeat until` loops or upvalues for `while` loop conditions can help manage loop flow without `break` statements.
- A common strategy is to use an `else` branch for the remainder of the code after a conditional exit point.
- Actions that 'yield' (like `barrel.list()`) take one tick, and `parallel.waitForAll()` or `parallel.waitForAny()` allow multiple yielding actions to be processed simultaneously.
- Parallelism is useful for simultaneous world actions, not for general computation, suggesting each thread can act as an agent using global variables for communication, e.g., one thread scanning entities.
- Code execution speed in ComputerCraft (CC) is slowed down by any code, but functions that yield (like `sleep` or inventory peripheral calls) are the biggest culprits as they pause the coroutine until the next game tick.
- CC code runs on a separate thread, so performance involves both pure compute time on the server's CPU and synchronization delays with the main Minecraft world thread, especially for peripheral calls.
- A significant drop in SSD performance (from 600MT/s to 150MB/s) was observed, leading to the conclusion that the SSD was overheating.
- Recommendations included checking SMART reports for drive health or physically touching the SSD to confirm heat.
- Use `peripheral.wrap("side")` to access a peripheral (like a chest) attached to the computer, specifying the side it's on (e.g., "top", "left").
- The `chest.list()` function returns a table containing the inventory items of the wrapped peripheral.

