Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[OpenComputers harvester create serafim http://pastebin.com/jgZNcxZp
- в 1 и 2 слот ложим семена пшеници
- ставим над сундуком, даем роботу мотыгу
- требования:робот 1-го уровня, инвентарь
- ]]--
- local com = require('component')
- local lenght = 23 --длинна грядки
- local quantity = 9 --количество грядок
- local comeback = 26 --возврат к старту
- if not com.isAvailable("robot") then
- print("только роботы могут использовать эту программу")
- os.sleep(5)
- return
- end
- local r = require("robot")
- local function forwardEx()
- if not r.forward() then
- forwardEx()
- end
- end
- local function line()
- for i = 1, lenght do
- if (r.count(1) > 1) then
- r.select(1)
- else
- r.select(2)
- end
- r.swingDown()
- r.useDown()
- r.placeDown()
- if i ~= lenght then
- forwardEx()
- end
- end
- end
- local function harvest()
- print("собираю урожай")
- r.turnRight()
- r.turnRight()
- for i = 1, quantity do
- forwardEx()
- r.turnLeft()
- line()
- r.turnRight()
- forwardEx()
- r.turnRight()
- line()
- if i ~= quantity then
- r.turnLeft()
- forwardEx()
- end
- end
- r.turnRight()
- for i = 1, comeback do
- forwardEx()
- end
- for i = 3,16 do
- r.select(i)
- r.dropDown()
- end
- r.select(1)
- end
- while true do
- harvest()
- print("спим час пока пшеница вырастит")
- for i = 1, 10 do
- os.sleep(360)
- print((10*i)..'%')
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement