Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Shearman 2.0
- -- by MCKerrnel
- --
- -- A ComputerCraft program to shear
- -- sheep.
- function goForward(blocks)
- for count = 1, blocks, 1 do
- turtle.forward()
- turtle.suck()
- end
- end
- function turn(direction)
- if direction == "left" then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- function shearCycle(direction)
- if direction == "left" then
- returndir = "right"
- else
- returndir = "left"
- end
- -- Chest to Start of Row
- turn(direction)
- goForward(3)
- turn(direction)
- -- Shear Row
- for count = 1, 8, 1 do
- shearPen(direction)
- end
- -- Return to Chest
- turtle.turnLeft()
- turtle.turnLeft()
- goForward(23)
- turn(returndir)
- goForward(3)
- turn(returndir)
- -- Unload
- for slot = 2, 16, 1 do
- turtle.select(slot)
- turtle.drop()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function shearPen(direction)
- turtle.select(1)
- for count = 1, 2, 1 do
- turtle.forward()
- turn(direction)
- turtle.place()
- os.sleep(2)
- turtle.suck()
- if direction == "left" then
- turtle.turnRight()
- else
- turtle.turnLeft()
- end
- end
- turtle.forward()
- end
- -- MAINLINE
- -- This is where it all happens.
- while true do
- -- Shear North Row
- shearCycle("left")
- -- Shear South Row
- shearCycle("right")
- -- Wait 2 minutes to allow
- -- sheep to regrow wool.
- os.sleep(120)
- end
Advertisement
Add Comment
Please, Sign In to add comment