Advertisement
Guest User

OC 3by3Tunnel

a guest
Feb 25th, 2014
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. local tArgs = {...}
  2.  
  3. function light()
  4. count = 1
  5. if count >= 10 then
  6. count = 0
  7. robot.select(14)
  8. robot.turnRight()
  9. robot.place()
  10. robot.turnLeft()
  11. else
  12. count = count+1
  13. print(count)
  14. end
  15. end
  16.  
  17. function chkFull()
  18.  
  19. end
  20.  
  21. function chkFuel()
  22. print("Fuel: "..robot.getFuelLevel())
  23. if robot.getFuelLevel() < 100 then
  24. robot.select(16)
  25. robot.refuel(10)
  26. robot.select(1)
  27. end
  28. end
  29.  
  30. function mainLoop()
  31. robot.swing()
  32. robot.forward()
  33. robot.turnLeft()
  34. robot.swing()
  35. robot.swingUp()
  36. robot.up()
  37. robot.swing()
  38. robot.swingUp()
  39. robot.up()
  40. robot.swing()
  41. robot.turnLeft()
  42. robot.turnLeft()
  43. robot.swing()
  44. robot.down()
  45. robot.swing()
  46. robot.down()
  47. robot.swing()
  48. robot.turnLeft()
  49. end
  50. turtle.select(16)
  51. if tArgs[1] == nil then tArgs[1] = 1 end
  52. for i = 1,tArgs[1] do
  53. print("Interation: "..tostring(i).." of "..tostring(tArgs[1]))
  54. chkFuel()
  55. mainLoop()
  56. light()
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement