Wizard_Alfren

Minecraft - ComputerCraft - Turtle Simple Shearing

Apr 15th, 2020 (edited)
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. --Created by Wizard_Alfren--
  2. --Created on 13 April 2020--
  3. --Current as of 16 April 2020--
  4. --This Lua script is for a Shearing Turtle--
  5. --Place the turtle on the ground--
  6. --The turtle will rotate 4 times in a clockwise direction using the EQUIPPED shears every 15 seconds--
  7. --It does not require fuel or shears to be in the inventory--
  8. --Place a chest on top of the turtle for item depositing--
  9. term.clear()
  10. term.setCursorPos(1,1)
  11. print('Shearing...')
  12. count = 0
  13. iteration = 1
  14. while true do
  15.     i = 0
  16.     while i ~= 4 do
  17.         turtle.attack()
  18.         turtle.turnRight()
  19.         i = i + 1
  20.     end
  21.     ii = 1
  22.     while ii ~= 17 do
  23.         turtle.select(ii)
  24.         if turtle.getItemCount() > 0 then
  25.             if turtle.getItemDetail(ii).name == 'minecraft:wool' then
  26.                 count = count + turtle.getItemCount(ii)
  27.                 term.setCursorPos(1,3)
  28.                 term.clearLine()
  29.                 print('I\'ve collected',count,'wool so far!')
  30.             end
  31.         end
  32.         turtle.dropUp()
  33.         ii = ii + 1
  34.     end
  35.     term.setCursorPos(1,5)
  36.     term.clearLine()
  37.     print('Completed',iteration,'iteration(s)')
  38.     iteration = iteration + 1
  39.     sleep(60)
  40. end
Advertisement
Add Comment
Please, Sign In to add comment