Guest User

walls.lua

a guest
Jul 21st, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local robot = require("robot")
  2. local args,opts = require("shell").parse(...)
  3. local y = {...}
  4. local y = tonumber(y)
  5. local x = 0
  6. repeat
  7. robot.select(1)
  8. robot.turnLeft()
  9. robot.suck(1)
  10. robot.turnRight()
  11. robot.forward()
  12. robot.down()
  13. robot.select(2)
  14. robot.turnLeft()
  15. robot.suck(1)
  16. robot.select(3)
  17. robot.suck(1)
  18. robot.turnRight()
  19. robot.forward()
  20. robot.select(1)
  21. robot.place()
  22. robot.up()
  23. robot.select(2)
  24. robot.place()
  25. robot.up()
  26. robot.up()
  27. robot.up()
  28. robot.up()
  29. robot.up()
  30. robot.select(3)
  31. robot.drop()
  32. robot.down()
  33. robot.down()
  34. robot.down()
  35. robot.down()
  36. robot.down()
  37. robot.back()
  38. robot.back()
  39. x = x + 1
  40. print("Craft " .. x .. " out of " .. y .. " is done.")
  41. until x == y
Advertisement
Add Comment
Please, Sign In to add comment