Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com = require("component")
- local inv = com.inventory_controller
- local r = require("robot")
- local function go() while not r.forward() do r.swing() end end
- while true do
- print('опустошаю инвентарь')
- for i=1, r.inventorySize() do
- r.select(i)
- r.dropDown(64)
- end
- r.select(1)
- local num = 64
- print('поиск руды в нижнем сундуке')
- for i=1, inv.getInventorySize(0) do
- local a = inv.getStackInSlot(0,i)
- if a then
- if a.label == "Coal Ore" and a.size >= num then
- inv.suckFromSlot(0, i, num)
- num = 0
- print('руда найдена и перемещена')
- break
- end
- end
- end
- if num == 64 then
- print('нет руды!')
- os.exit()
- end
- print('Расставляю руду')
- for i=1,64 do
- r.placeUp()
- os.sleep(0)
- r.swingUp()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement