Advertisement
Guest User

quickCraft

a guest
Jan 27th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("which recipe? (1=2x2, 2=3x3")
  4. whichRecipe=read()
  5.  
  6. t.place("up","custom_chest")
  7. t.place("front","custom_chest")
  8.  
  9. print("place items to be crafted in the chest above me")
  10. read()
  11.  
  12. chestAbove=peripheral.wrap("top")
  13.  
  14. continueCrafting=true
  15. if whichRecipe=="1" then
  16.     while continueCrafting do
  17.         t.suck("up",64,1)
  18.         t.suck("up",64,2)
  19.         t.suck("up",64,5)
  20.         t.suck("up",64,6)
  21.         if turtle.getItemCount(1)>0 and turtle.getItemCount(2)>0 and turtle.getItemCount(5)>0 and turtle.getItemCount(6)>0 then continueCrafting=true else continueCrafting=false end
  22.         if continueCrafting==true then
  23.             turtle.craft(64)
  24.             for j=1,16 do
  25.                 if turtle.getItemCount(j)>0 then
  26.                     t.select(j)
  27.                     turtle.drop()
  28.                 end
  29.             end
  30.         end
  31.     end
  32. end
  33.  
  34. term.clear()
  35. term.setCursorPos(1,1)
  36. print("Crafting Complete")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement