Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. rednet.open("right")
  2. --!************LOCALLER****************
  3. write("Monitor ID?")
  4. local id=read()
  5. write("Uzunlugu : ")
  6. local uzunluk=read()
  7. write("Kac Sira : ")
  8. local sira=read()
  9.  
  10. local tunelx=uzunluk
  11. local sirax=sira
  12.  
  13. --Fonksiyon ileriKaz
  14. function ileriKaz()
  15. repeat
  16. turtle.dig()
  17. sleep(1)
  18. until turtle.detect()==false
  19. end
  20. --Fonksiyon yukariKaz
  21. function yukariKaz()
  22. repeat
  23. turtle.digUp()
  24. sleep(1)
  25. until turtle.detectUp()==false
  26. end
  27. --Fonkisyon sol
  28. function sol(s)
  29. repeat
  30. turtle.turnLeft()
  31. s=s-1
  32. until s==0
  33. end
  34. --Fonksiyon sag
  35. function sag(w)
  36. repeat
  37. turtle.turnRight()
  38. w=w-1
  39. until w==0
  40. end
  41. --Fonksiyon ileriGit
  42. function ileriGit(x)
  43. repeat
  44. if turtle.detect()==false then
  45. if turtle.detectUp()==true then yukariKaz() end
  46. turtle.forward()
  47. x=x-1
  48. else
  49. ileriKaz()
  50. end
  51. until x==0
  52. end
  53.  
  54. --Fonksiyon tunel
  55. function tunel()
  56. repeat
  57. ileriGit(1)
  58. tunelx=tunelx-1
  59. until tunelx==0
  60. end
  61.  
  62. repeat
  63. tunelx=uzunluk
  64. tunel()
  65. sol(2)
  66. ileriGit(uzunluk)
  67. if sirax~=sira then
  68. sag(1)
  69. ileriGit((sira-sirax)*3)
  70. sol(1)
  71. end
  72. --ENVANTER BOŞALT && YAKIT AL
  73. sol(1)
  74. ileriGit((sira-sirax+1)*3)
  75. sol(1)
  76. sirax=sirax-1
  77. until sirax==0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement