Advertisement
CelticCoder

turtleDupe

Aug 10th, 2024 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. function craftPlanks()
  2.     turtle.suck(15)
  3.     print("count: " .. turtle.getItemCount(1))
  4.     if turtle.getItemCount(1) ~= 15 then
  5.         turtle.suck(15 - turtle.getItemCount(1))
  6.         if turtle.getItemCount(1) ~= 15 then
  7.             turtle.drop()
  8.             print("PLANK ERROR")
  9.             os.exit(1)
  10.         end
  11.     end
  12.     turtle.craft()
  13.     turtle.turnRight()
  14.     turtle.drop()
  15. end
  16.  
  17. function craftSlabs()
  18.     turtle.suck(30)
  19.     if turtle.getItemCount(1) ~= 30 then
  20.         turtle.suck(30 - turtle.getItemCount(1))
  21.         if turtle.getItemCount(1) ~= 30 then
  22.             turtle.drop()
  23.             print("SLAB ERROR")
  24.             os.exit(1)
  25.         end
  26.     end
  27.     turtle.transferTo(2, 10)
  28.     turtle.transferTo(3, 10)
  29.     turtle.craft()
  30.     turtle.turnRight()
  31.     turtle.drop()
  32. end
  33.  
  34. function craftLogs()
  35.     turtle.suck(60)
  36.     if turtle.getItemCount(1) ~= 60 then
  37.         turtle.suck(60 - turtle.getItemCount(1))
  38.         if turtle.getItemCount(1) ~= 60 then
  39.             turtle.drop()
  40.             print("LOG ERROR 1")
  41.             os.exit(1)
  42.         end
  43.     end
  44.     turtle.transferTo(2, 60)
  45.     turtle.suck(60)
  46.     if turtle.getItemCount(1) ~= 60 then
  47.         turtle.suck(60 - turtle.getItemCount(1))
  48.         if turtle.getItemCount(1) ~= 60 then
  49.             turtle.drop()
  50.             print("LOG ERROR 2")
  51.             os.exit(1)
  52.         end
  53.     end
  54.     turtle.craft()
  55.     turtle.turnLeft()
  56.     turtle.turnLeft()
  57. end
  58.  
  59. function depositProfits()
  60.     turtle.drop(15)
  61.     turtle.turnLeft()
  62.     turtle.drop()
  63.     turtle.turnRight()
  64. end
  65.  
  66. turtle.turnLeft()
  67. while true do
  68.     turtle.select(1)
  69.     craftPlanks()
  70.    
  71.     craftSlabs()
  72.     turtle.turnLeft()
  73.     craftSlabs()
  74.     craftLogs()
  75.     depositProfits()
  76. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement