Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component=require("component")
- local robot=require("robot")
- function treelogic()
- logic = robot.compare()
- if logic == false then
- robot.swing(forward, 10)
- robot.swing(up, 10)
- moveforward(1)
- robot.suck()
- robot.up()
- for i=1,4 do
- robot.swing(forward, 10)
- robot.suck()
- robot.turnLeft()
- end
- robot.up()
- for i=1,4 do
- robot.swing(forward, 10)
- robot.suck()
- robot.turnLeft()
- end
- robot.up()
- for i=1,4 do
- robot.swing(forward, 10)
- robot.suck()
- robot.turnLeft()
- end
- robot.down()
- robot.down()
- robot.down()
- robot.turnLeft()
- moveforward(1)
- robot.turnLeft()
- moveforward(1)
- robot.turnLeft()
- moveforward(2)
- robot.turnLeft()
- moveforward(2)
- robot.turnLeft()
- moveforward(1)
- robot.turnLeft()
- robot.suck()
- robot.place()
- robot.turnAround()
- else
- robot.suck()
- robot.turnLeft()
- robot.forward()
- robot.turnRight()
- moveforward(2)
- robot.turnRight()
- moveforward(1)
- robot.turnLeft()
- end
- end
- function moveforward(n)
- for i=1,n do
- robot.suck()
- robot.turnRight()
- robot.suck()
- robot.turnLeft()
- robot.forward()
- end
- end
- function iloop()
- while true do
- robot.turnLeft()
- moveforward(3)
- robot.turnRight()
- moveforward(2)
- treelogic()
- moveforward(3)
- treelogic()
- moveforward(3)
- treelogic()
- robot.turnLeft()
- moveforward(5)
- robot.turnLeft()
- treelogic()
- moveforward(3)
- treelogic()
- moveforward(3)
- treelogic()
- robot.turnRight()
- moveforward(5)
- robot.turnRight()
- treelogic()
- moveforward(3)
- treelogic()
- moveforward(3)
- treelogic()
- moveforward(2)
- robot.turnRight()
- moveforward(13)
- robot.turnRight()
- moveforward(15)
- robot.turnLeft()
- robot.select(2)
- robot.drop(6)
- robot.turnRight()
- robot.forward()
- robot.turnLeft()
- --[[
- robot.select(2)
- int = robot.count(2) - 1
- component.generator.insert(int)
- print("Generator Fuel: " .. component.generator.count())
- --]]
- total = 0
- total2 = 0
- for i=2,16 do
- robot.select(i)
- items = robot.count(i)
- itemstodrop = items - 1
- robot.drop(itemstodrop)
- end
- print("Compelete")
- robot.turnRight()
- robot.select(1)
- print("-----------------------------------------")
- robot.use(front)
- os.sleep(1*6)
- robot.use(front)
- robot.turnAround()
- os.sleep(20*60)
- end
- end
- iloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement