Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r = require("robot")
- local com = require("component")
- local g = com.generator
- local isR = true
- local c = require("computer")
- is=com.inventory_controller
- dp=0
- r.select(1)
- function d()
- s=2
- r.select(48)
- r.back()
- r.placeDown()
- for i2 =1, 47 do
- r.select(s)
- r.dropDown()
- s=s+1
- end
- r.select(1)
- r.forward()
- end
- function f()
- if c.energy() < 1000 then
- g.insert()
- end
- end
- function check()
- for i=1,47 do
- r.select(i) scans = is.getStackInInternalSlot()
- if scans~=nil then
- a = scans["label"]
- if a=="Cobblestone" or a=="Dirt" or a=="Gravel" or a=="Sand" or a=="Flint" then
- r.select(i) r.dropDown()
- elseif a=="Coal" then
- r.transferTo(1)
- end
- end
- end
- r.select(1)
- end
- while isR do
- io.write("Введите длину: ")
- a=io.read()
- dp = dp + 1
- if dp == 16 then
- check()
- dp=0
- end
- for i=1, a do
- r.swingUp()
- r.swing()
- r.swingDown()
- r.forward()
- dp = dp + 1
- if dp == 50 then
- check()
- dp=0
- end
- end
- io.write("Освободить инвентарь?[Y/n]: ")
- b = io.read()
- if b == "y" then
- f()
- d()
- elseif b =="n" then
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement