Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local inv = require("component").inventory_controller
- function right()
- robot.turnRight()
- go()
- robot.turnLeft()
- end
- function left()
- robot.turnLeft()
- go()
- robot.turnRight()
- end
- function up()
- while not robot.up() do
- os.sleep(.1)
- end
- end
- function down()
- while not robot.down() do
- os.sleep(.1)
- end
- end
- function go()
- while not robot.forward() do
- os.sleep(.1)
- end
- end
- function changeTool(i)
- robot.select(i)
- inv.equip()
- end
- function goToStart()
- right()
- down()
- down()
- end
- function place()
- while not robot.use() do
- os.sleep(.1)
- end
- end
- function createIs()
- place()
- up()
- left()
- place()
- right()
- place()
- right()
- place()
- up()
- changeTool(2)
- place()
- left()
- place()
- left()
- place()
- changeTool(2)
- end
- function killIs()
- changeTool(1)
- while robot.swing() do
- robot.swing()
- end
- changeTool(1)
- end
- function dropInv()
- --robot.suckUp()
- up()
- left()
- for i = 3, 16 do
- robot.select(i)
- robot.dropDown()
- end
- right()
- down()
- end
- while true do
- while robot.count(2) > 2 do
- print("начало")
- createIs()
- goToStart()
- os.sleep(5)
- killIs()
- os.sleep(1)
- if robot.count(3) > 0 then
- dropInv()
- end
- print("конец")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment