Advertisement
timconspicuous

CC:Tweaked Mooshroom Milker

Apr 5th, 2024 (edited)
770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. --to use place inventory with oak logs or bowls above a crafty turtle, a target inventory below and a mooshroom in front
  2.  
  3. function CraftBowl(item)
  4.     --adding some additional checks in case the loop is interrupted while crafting
  5.     if item.name == "minecraft:oak_log" then
  6.         if item.count == 3 then
  7.             turtle.craft(3)
  8.         else
  9.             turtle.suckUp(3 - item.count)
  10.         end
  11.     elseif (item.name == "minecraft:oak_planks") and (item.count % 4 == 0) then
  12.         if item.count == 12 then
  13.             turtle.transferTo(3,4)
  14.         elseif item.count == 8 then
  15.             turtle.transferTo(6,4)
  16.         elseif item.count == 4 then
  17.             turtle.craft(4)
  18.         end
  19.     else
  20.         print("Something went wrong, empty inventory and try again.")
  21.     end
  22. end
  23.  
  24. while true do
  25.     item = turtle.getItemDetail(1)
  26.     if turtle.getItemCount(2) > 0
  27.         turtle.select(2)
  28.         turtle.dropDown()
  29.     end
  30.     turtle.select(1)
  31.     if item == nil then
  32.         turtle.suckUp(3)
  33.     elseif item.name == "minecraft:bowl" then
  34.         turtle.place()
  35.     elseif item.name == "minecraft:mushroom_stew" then
  36.         turtle.dropDown()
  37.     else
  38.         CraftBowl(item)
  39.     end
  40.     os.sleep(.5)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement