Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
-- me_autocraft.lua local fileName = "liste.txt" local meBridge = peripheral.find("meBridge") if not meBridge then error("meBridge non trouvé !") end local function autocraft(itemName, amount) local tasks = meBridge.craft(itemName, tonumber(amount)) if tasks then print("Craft lancé pour " .. itemName .. " x" .. amount) else print("Erreur lors du lancement du craft pour " .. itemName) end end local file = fs.open(fileName, "r") if not file then error("Fichier '" .. fileName .. "' non trouvé") end while true do local line = file.readLine() if not line then break end local item, qty = string.match(line, "^([^,]+),(%d+)") if item and qty then autocraft(item, qty) else print("Ligne non valide : " .. (line or "")) end end file.close() print("Tous les autocrafts ont été lancés !")
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)