Advertisement
0xSRK6

Untitled

Jan 22nd, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. local chars = {"-", "\\", "|", "/"}
  2. local cC = 1
  3.  
  4. term.clear()
  5. term.setCursorPos(1, 1)
  6. print("Processing... ")
  7. turtle.select(1)
  8.  
  9.  
  10. function process()
  11.     while true do
  12.         turtle.suckDown()
  13.         if turtle.getItemDetail() ~= nil then
  14.             if turtle.getItemDetail().name == "minecraft:dried_kelp_block" then turtle.drop() end
  15.         end
  16.         if turtle.getItemCount() >= 9 then
  17.             local ninth = math.floor(turtle.getItemCount(1) / 9)
  18.             for i = 1, 8 do
  19.                 if i < 3 then turtle.transferTo(i + 1, ninth) end
  20.                 if i > 2 and i < 6 then turtle.transferTo(i + 2, ninth) end
  21.                 if i > 5 then turtle.transferTo(i + 3, ninth) end
  22.             end
  23.             turtle.craft()
  24.             for i = 1, 16 do
  25.                 turtle.select(i)
  26.                 if turtle.getItemCount() > 0 and turtle.getItemDetail().name ~= "minecraft:dried_kelp_block" then turtle.transferTo(1) end
  27.                 turtle.drop()
  28.             end
  29.             turtle.select(1)
  30.         end
  31.     end
  32. end
  33.  
  34. function draw()
  35.     while true do
  36.         term.clearLine()
  37.         term.setCursorPos(1, 4)
  38.         cC = cC + 1
  39.         if cC > 4 then cC = 1 end
  40.         term.write(chars[cC])
  41.         os.sleep(0.1)
  42.     end
  43. end
  44.  
  45. parallel.waitForAll(process, draw)
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement