Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require "robot"
- local component = require "component"
- local inv = component.inventory_controller
- function sazjay()
- robot.select(1)
- if ({robot.detect()})[2] ~= "solid" then
- if robot.count(1)<1 then
- print("недостаточно саженцев")
- upload()
- elseif not robot.detect() then
- print("ставлю саженец")
- os.sleep(0.5)
- robot.place()
- print("поставил")
- poct()
- end
- else
- print("передомной блок, точно не саженец")
- robot.swing()
- print("что бы это ни было, ему пизда")
- end
- end
- function poct()
- robot.select(2)
- inv.equip()
- print("одел мотыгу")
- if robot.durability()>0.3 then
- print("мотыга годная")
- for i=1,5 do
- robot.use()
- print("рости трава большой и шторящей")
- end
- inv.equip()
- print("снял мотыгу, одел пилу")
- chopchop()
- else
- inv.equip()
- print("ваша мотыга говно, снял мотыгу, одел пилу")
- os.exit()
- end
- end
- function chopchop()
- if robot.durability()>0.3 then
- print("пила годная")
- while robot.detect() do
- robot.swing()
- print("рубим рубим трынь траву")
- end
- os.sleep(20)
- cbop()
- else
- print("ваша пила говно")
- os.exit()
- end
- end
- function cbop()
- for i=1,3 do
- component.tractor_beam.suck()
- print("все мое! руки убрал! засосу!")
- end
- if robot.count(15)>1 then
- unload()
- else
- sazjay()
- end
- end
- function unload()
- print("надо облегчиться")
- for i=3,15 do
- robot.select(i)
- robot.dropDown()
- end
- print("с пустым багажем и жизнь веселее")
- sazjay()
- end
- function upload()
- print("кончились саженцы, загружаю")
- os.exit()
- robot.select(1)
- robot.suckUp()
- print("взял саженцы")
- sazjay()
- end
- while true do
- sazjay()
- os.sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement