Advertisement
Wihad

Wither

Aug 30th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.55 KB | None | 0 0
  1. function moveForw()
  2.     local try=1
  3.     while not turtle.forward() do
  4.         print("I can't go forward .. try:"..try)
  5.         sleep(1)
  6.         try=try+1
  7.     end
  8. end
  9.  
  10. function moveBack()
  11.     local try=1
  12.     while not turtle.back() do
  13.         print("I can't go back .. try:"..try)
  14.         sleep(1)
  15.         try=try+1
  16.     end
  17. end
  18.  
  19. function moveUp()
  20.     local try=1
  21.     while not turtle.up() do
  22.         print("I can't go up .. try:"..try)
  23.         sleep(1)
  24.         try=try+1
  25.     end
  26. end
  27.  
  28. function moveDown()
  29.     local try=1
  30.     while not turtle.down() do
  31.         print("I can't go down .. try:"..try)
  32.         sleep(1)
  33.         try=try+1
  34.     end
  35. end
  36.  
  37. function turnL()
  38.     turtle.turnLeft()
  39. end
  40. function turnR()
  41.     turtle.turnRight()
  42. end
  43. function turn2()
  44.     for A=1,2 do
  45.         turnR()
  46.     end
  47. end
  48.  
  49.  
  50. function placeForw()
  51.     if not turtle.detect() then
  52.         local try=1
  53.         while not turtle.place() do
  54.             print("I can't place forw. a block !..Try: "..try)
  55.             try=try+1
  56.             sleep(1)
  57.         end
  58.     end
  59. end
  60.  
  61. function placeUp()
  62.     if not turtle.detectUp() then
  63.         local try=1
  64.         while not turtle.placeUp() do
  65.             print("I can't place up. a block !..Try: "..try)
  66.             try=try+1
  67.             sleep(1)
  68.         end
  69.     end
  70. end
  71.  
  72. function placeDown()
  73.     if not turtle.detectDown() then
  74.         local try=1
  75.         while not turtle.placeDown() do
  76.              print("I can't place down. a block !..Try: "..try)
  77.              try=try+1
  78.              sleep(1)
  79.         end
  80.     end
  81. end
  82.  
  83. function slctSkull()
  84.     for a=1,16 do
  85.         data=turtle.getItemDetail(a)
  86.         if data then
  87.             if data.name=="minecraft:skull" then
  88.                 turtle.select(a)
  89.                 break
  90.             end
  91.         end
  92.     end
  93. end
  94.  
  95. function slctSSand()
  96.     for a=1,16 do
  97.         data=turtle.getItemDetail(a)
  98.         if data then
  99.             if data.name=="minecraft:soul_sand" then
  100.                 turtle.select(a)
  101.                 break
  102.             end
  103.         end
  104.     end
  105. end
  106.  
  107. while true do
  108.  
  109. for a=1,4 do
  110.     turtle.suckDown()
  111. end
  112.  
  113. for a=1,16 do
  114.     local data=turtle.getItemDetail(a)
  115.     if data then
  116.         if data.name=="minecraft:coal" then
  117.             turtle.select(a)
  118.             if turtle.getFuelLevel()<80 then
  119.                 turtle.refuel()
  120.             else
  121.                 turtle.dropDown()
  122.             end
  123.         end
  124.     end
  125. end
  126.  
  127. moveUp()
  128. moveUp()
  129. moveForw()
  130. turnL()
  131. moveForw()
  132. moveForw()
  133. moveDown()
  134. slctSSand()
  135. placeDown()
  136. placeForw()
  137. moveBack()
  138. placeForw()
  139. moveUp()
  140. placeDown()
  141. moveForw()
  142. slctSkull()
  143. placeForw()
  144. moveBack()
  145. placeForw()
  146. moveBack()
  147. placeForw()
  148. turnR()
  149. moveBack()
  150. moveDown()
  151. moveDown()
  152. sleep(120)
  153.  
  154. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement