Advertisement
TitanChase

Untitled

Aug 29th, 2020 (edited)
1,561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.91 KB | None | 0 0
  1. local robot = require("robot")
  2. local computer = require("computer")
  3. local shell = require("shell")
  4.  
  5.  
  6.  
  7. function reload()
  8.     robot.turnRight()
  9.     for i = 0, 2, 1 do
  10.         robot.forward()
  11.     end
  12.     robot.turnRight()
  13.     robot.select(1)
  14.     robot.suck(16)
  15.     robot.turnLeft()
  16.     robot.forward()
  17.     robot.turnRight()
  18.     robot.select(2)
  19.     robot.suck(32)
  20.     robot.turnLeft()
  21.     for i = 0, 3, 1 do
  22.         robot.back()
  23.     end
  24.     robot.turnLeft()
  25. end
  26.  
  27. function place()
  28.     robot.select(1)
  29.     robot.place()
  30.     robot.up()
  31.     robot.select(2)
  32.     robot.place()
  33.     robot.down()
  34. end
  35.  
  36. function drop()
  37.     robot.select(2)
  38.     robot.drop(1)
  39. end
  40.  
  41. local args, ops = shell.parse(...)
  42.  
  43. for i = 0, args[1] - 1 , 1 do
  44.     reload()
  45.     for i = 0, 15, 1 do
  46.         robot.forward()
  47.         place()
  48.         robot.back()
  49.         drop()
  50.         os.sleep(5)
  51.     end
  52.  
  53.     robot.back()
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement