Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local PORT = 666
- local COMP = "586ce2fa-dd5f-4b3f-b2a7-235f6fb921e3"
- ---
- local com = require("component")
- local inv = com.inventory_controller
- local modem = com.modem
- local ser = require("serialization")
- ---
- print("Программа сканирования рецептов")
- print("Убедитесь, что принимающий компьютер готов")
- os.sleep(1)
- io.write("\nСканирование...")
- local recipe = {}
- for i = 1, 9, 1 do
- local slot = i + (math.floor(i - 1) / 3)
- local stack = inv.getStackInInternalSlot(slot)
- if stack == nil then stack = "" end
- table.insert(recipe, stack)
- end
- table.insert(recipe, inv.getStackInInternalSlot(8))
- print(" [OK]")
- io.write("Передача данных...")
- local toSend = ser.serialize(recipe)
- modem.send(COMP, PORT, toSend)
- print(" [OK]")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement