Advertisement
CreeperNukeBoom

CC Salt maker turtle

Feb 1st, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. --Salt maker startup
  2.  
  3. term.clear()
  4. term.setCursorPos(1,1)
  5. print("Salt Maker V1")
  6.  
  7. local chest = peripheral.find("minecraft:chest")
  8. local turtleDir = "south" --Can also be turtle network name
  9.  
  10. assert(chest,"Chest not found, check that the chest name is correct")
  11.  
  12. if turtle.getItemCount(3)~=0 and chest.pullItems(turtleDir,3,64) == 0 then --Because the turtle more than likely has something at start.
  13.   print("Chest Full, Shutting down!")
  14.   return
  15. end
  16. turtle.select(1)
  17.  
  18.  
  19. --assert(chest)
  20. while true do
  21.   turtle.select(1)
  22.   turtle.place()
  23.   turtle.select(3)
  24.   turtle.craft(1)
  25.   if turtle.getItemCount(3)~=0 and chest.pullItems(turtleDir,3,64) == 0 then --resets turtle facing before ending the program
  26.     print("Chest Full, Shutting down!")
  27.     return
  28.   end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement