Advertisement
Flemmli97

3x3 Autocraft

Oct 20th, 2020
1,830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. --Crafts a 3x3 "compressing recipe" supplied by a container in front and drops it below
  2. if table.getn(arg) < 1 then print("How many items to craft at once?") amount = tonumber(read()) else amount = tonumber(arg[1]) end
  3. while true do
  4.   for i=1, 3 do
  5.     for j=0, 2 do
  6.       local slot = i+j*4
  7.       turtle.select(slot)
  8.       turtle.suck(math.min(amount,math.max(0,amount-turtle.getItemCount(slot))))
  9.     end
  10.   end
  11.   turtle.select(16)
  12.   turtle.craft(amount)
  13.   turtle.dropDown()
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement