JJC15433

Lazy ccRestitched Nether Wart Farm v1

Nov 5th, 2021 (edited)
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.41 KB | None | 0 0
  1. local i, found, slotItem, oneRemaining, present, entity = 1, false, nil, false, turtle.inspectDown();
  2. while true do
  3.     present, entity = turtle.inspectDown();
  4.     while present do
  5.         if entity.state.age == 3 then
  6.             if not turtle.digDown() then term.clear(); assert(false, "No tool to dig with, dummy. To think I left the assembly lines for this... Halting."); end
  7.             found, i = false, 1;
  8.             while not found and i < 16 do
  9.                 slotItem = turtle.getItemDetail(i);
  10.                 if slotItem and slotItem.name == "minecraft:nether_wart" then
  11.                     found = true;
  12.                 else
  13.                     i = i + 1;
  14.                 end
  15.             end
  16.             if found then
  17.                 turtle.select(i);
  18.                 turtle.placeDown();
  19.                 oneRemaining = false;
  20.                 for i = 1, 16 do
  21.                     turtle.select(i);
  22.                     if oneRemaining then turtle.dropUp(); end
  23.                     while not oneRemeaining and turtle.getItemCount() > 1 do
  24.                         turtle.dropUp((turtle.getItemCount() - 1));
  25.                         oneRemaining = true;
  26.                     end
  27.                 end
  28.             else
  29.                 assert(false, "No Nether Wart in inventory. Halting...");
  30.             end
  31.         else
  32.             term.clear();
  33.             print("Not mature yet.");
  34.             --print(entity);
  35.             print(textutils.serialize(entity));
  36.         end
  37.         present, entity = turtle.inspectDown();
  38.     end
  39. end
Add Comment
Please, Sign In to add comment