Advertisement
Guest User

strip

a guest
Apr 6th, 2020
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1. print("Laenge?")
  2. l = tonumber(read())
  3.  
  4. i = 20
  5.  
  6. local list =
  7.   {
  8.       ["minecraft:diamond_ore"] = true,
  9.       ["minecraft:gold_ore"] = true,
  10.       ["minecraft:iron_ore"] = true,
  11.       ["minecraft:emerald_ore"] = true,
  12.       ["minecraft:lapis_ore"] = true,
  13.       ["denseores:block0:3"] = true,
  14.       ["denseores:block0:1"] = true,
  15.       ["denseores:block0"] = true,
  16.       ["denseores:block0:2"] = true
  17.   }
  18. function forward()
  19.   while(not turtle.forward()) do
  20.     turtle.dig()
  21.   end
  22. end
  23.  
  24. function down()
  25.   while(not turtle.down()) do
  26.     turtle.digDown()
  27.   end
  28. end
  29.  
  30. function up()
  31.   while(not turtle.up()) do
  32.     turtle.digUp()
  33.   end
  34. end
  35.  
  36. function back()
  37.   while(not turtle.back()) do
  38.     turtle.turnRight()
  39.     turtle.turnRight()
  40.     forward()
  41.     turtle.turnRight()
  42.     turtle.turnRight()
  43.   end
  44. end  
  45.  
  46. function small()
  47.    for y=1,i do
  48.      search()
  49.      forward()
  50.    end
  51. end
  52.  
  53. function large()
  54.   for y=1,(2*i) do
  55.     search()
  56.     forward()
  57.   end
  58. end
  59.  
  60. function sDown()
  61.   turtle.turnRight()
  62.   search()
  63.   down()
  64.   search()
  65.   down()
  66.   search()
  67.   down()
  68.   search()
  69.   forward()
  70.   search()
  71.   forward()
  72.   search()
  73.   turtle.turnRight()
  74. end
  75.  
  76. function sUp()
  77.   turtle.turnRight()
  78.   search()
  79.   up()
  80.   search()  
  81.   up()
  82.   search()
  83.   up()
  84.   search()
  85.   forward()
  86.   search()
  87.   forward()
  88.   search()
  89.   turtle.turnRight()
  90. end
  91. function coal()
  92.   turtle.select(1)
  93.   a = turtle.getItemCount(1)
  94.   while(a >= 2) do
  95.     turtle.refuel(1)
  96.     a = turtle.getItemCount(1)
  97.   end
  98. end
  99.  
  100. function walk()
  101.   for w=1,4 do
  102.     turtle.digUp()
  103.     forward()
  104.     search()
  105.   end
  106. end
  107.  
  108. function searchFront()
  109.   success, data = turtle.inspect()
  110.   if success and list[data.name] then
  111.     forward()
  112.     search()
  113.     back()
  114.   end
  115. end
  116.  
  117. function searchUp()
  118.   success, data = turtle.inspectUp()
  119.   if success and list[data.name] then
  120.     up()
  121.     search()
  122.     down()
  123.   end
  124. end
  125.  
  126. function searchDown()
  127.   success, data = turtle.inspectDown()
  128.   if success and list[data.name] then
  129.     down()
  130.     search()
  131.     up()
  132.   end
  133. end
  134.    
  135. function search()
  136.   for s=1,4 do
  137.     searchFront()
  138.     turtle.turnRight()
  139.   end
  140.   searchUp()
  141.   searchDown()
  142. end
  143.  
  144. for x=1,l do
  145.   coal()
  146.   search()
  147.   turtle.turnRight()
  148.   small()
  149.   sDown()
  150.   large()
  151.   sUp()
  152.   small()
  153.   turtle.turnLeft()
  154.   walk()
  155. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement