Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------
- -- Программа --
- -- для сушки мяса и других вещей на досках вяления --
- -- в Майнкрафт на роботе из мода OpenComputers --
- -- Автовялилка v0.1 --
- -- проект http://computercraft.ru --
- -- 2017, © Asior --
- ---------------------------------------------------------
- local com = require("component")
- local computer = require("computer")
- local ic = com.inventory_controller
- local r = require("robot")
- print('Положите в первый слот что будем вялеть/n Во второй что на выходе получится')
- os.sleep(5)
- local output = ic.getStackInInternalSlot(2).name
- local input = ic.getStackInInternalSlot(1).name
- function sortirovka()
- local size = ic.getStackInInternalSlot(1)
- if size and size.size <= 9 then
- for i = 3, r.inventorySize() do
- local info = ic.getStackInInternalSlot(i)
- if info and info.name == input then
- r.select(i)
- r.transferTo(1)
- r.select(1)
- return
- end
- end
- end
- end
- while true do
- local name = ic.getStackInSlot(1, 1)
- if name and name.name == output then
- r.suckUp()
- r.dropUp()
- elseif name == nil then
- r.dropUp()
- end
- local name = ic.getStackInSlot(0, 1)
- if name and name.name == output then
- r.suckDown()
- r.dropDown()
- elseif name == nil then
- r.dropDown()
- end
- local name = ic.getStackInSlot(3, 1)
- if name and name.name == output then
- r.suck()
- r.drop()
- elseif name == nil then
- r.drop()
- else
- os.sleep(50)
- end
- sortirovka()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement