Advertisement
Spatzenhirn123

clear room advanced

Oct 22nd, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. local args = {...}
  2. vor = args[1]-1
  3. rechts = args[2]-1
  4. hoch = args[3]
  5. ---nur 1/2 bei rechts
  6. ---nur 1/3 bei "hoch" eingeben
  7. --------------
  8. function dig()
  9. while turtle.detect() do
  10. turtle.dig()
  11. os.sleep(0.5)
  12. end
  13. end
  14. function digUp()
  15. while turtle.detectUp() do
  16. turtle.digUp()
  17. os.sleep(0.5)
  18. end
  19. end
  20. function forward()
  21. while turtle.forward()==false do
  22. os.sleep(1)
  23. dig()
  24. end
  25. end
  26. function up()
  27. while turtle.up()==false do
  28. os.sleep(1)
  29. digUp()
  30. end
  31. end
  32. function down()
  33. while turtle.down()==false do
  34. os.sleep(1)
  35. turtle.digDown()
  36. end
  37. end
  38. -----------------------
  39.  
  40. function line()
  41. for i=1,vor,1 do
  42. digUp()
  43. turtle.digDown()
  44. dig()
  45. forward()
  46. end
  47. digUp()
  48. turtle.digDown()
  49. end
  50.  
  51. function R()
  52. turtle.turnRight()
  53. dig()
  54. forward()
  55. turtle.turnRight()
  56. end
  57.  
  58. function L()
  59. turtle.turnLeft()
  60. dig()
  61. forward()
  62. turtle.turnLeft()
  63. end
  64. ---------------------
  65. function ebene()
  66. for t=1,rechts,2 do
  67. line()
  68. R()
  69. line()
  70. L()
  71. end
  72. line()
  73. turtle.turnRight()
  74. turtle.turnRight()
  75. end
  76. -----------------------------------------------------------------------------------
  77. for h=1,hoch,3 do
  78. ebene()
  79. for b=1,3,1 do
  80. up()
  81. end
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement