Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local modem = peripheral.find("modem")
- local sleepTime = 0.5
- modem.open(1)
- local function handleCraftingCommand()
- while true do
- local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
- if message and type(message) == "table" and message.item and message.quantity then
- local status = "error"
- if turtle.craft(math.min(message.quantity, 64)) then
- print("Craft ".. message.item .. " succeeds!")
- status = "ok"
- else
- print("Craft ".. message.item .. " error!")
- end
- local message = {status = status}
- modem.transmit(1, 1, message)
- end
- end
- end
- handleCraftingCommand()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement