Advertisement
Guest User

IFTEST.lua

a guest
Jul 16th, 2017
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. --[[
  2. Ok so heres how this works.
  3. You must place the control blocks in robot slots
  4. 1-5. 1: Forward, 2: Right, 3: Left, 4: Up,
  5. 5: Down.
  6. ]]--
  7.  
  8.  
  9.  
  10.  
  11.  
  12. local robot = require("robot")
  13. while true do
  14. robot.select(1)
  15. if robot.compareDown() == true then
  16. robot.forward()
  17. end
  18. robot.select(2)
  19. if robot.compareDown() == true then
  20. robot.turnRight()
  21. robot.forward()
  22. end
  23. robot.select(3)
  24. if robot.compareDown() == true then
  25. robot.turnLeft()
  26. robot.forward()
  27. end
  28. robot.select(4)
  29. if robot.compareDown() == true then
  30. robot.up()
  31. robot.forward()
  32. end
  33. robot.select(5)
  34. if robot.compareDown() == true then
  35. robot.forward()
  36. robot.down()
  37. end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement