Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = require("robot")
- local component = require("component")
- local sides = require("sides")
- local crafting = component.crafting
- local inventory_controller = component.inventory_controller
- local filesys = component.filesystem
- print("Выберите операцию:")
- print("1) Запустить крафт")
- print("2) Записать крафт")
- print("Введите цифру операции...")
- operation = tonumber(io.read())
- list = nil
- if(operation == 1) then
- print("Не реализовано...")
- elseif(operation == 2) then
- if(io.open("/home/ListOfCrafts","r") == nil) then
- list = io.open("/home/ListOfCrafts", "w")
- else
- list = io.open("/home/ListOfCrafts", "a")
- end
- confirm = false
- print("Расставьте компоненты по рецепту\n для записи крафта...")
- while(confirm == false) do
- print("Введите ГОТОВО, если разложили все компоненты...")
- if(io.read() == "ГОТОВО") then
- confirm = true
- else
- print("Неверное подтверждение!\n")
- end
- end
- print("Введите название крафта на КИРИЛЛИЦЕ...")
- name = io.read()
- list:write(name)
- list:flush()
- for i = 1, 11,1 do
- if(i == 4 or i == 8) then
- i = i + 1
- end
- r.select(i)
- item = nil
- if(inventory_controller.getStackInInternalSlot() ~= nil) then
- item = inventory_controller.getStackInInternalSlot().label
- print(item)
- else
- item = "none"
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement