Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Wheat farming turtle by Razputin
- -- Modified and bugfixed by Pugnacious
- -- Optimized and cleaned up by Kreezxil 10/6/2013
- --[Code for the turtle to leave start position and go to farming level]--
- function start()
- turtle.forward()
- turtle.down()
- turtle.down()
- end
- -- rewrote this function to be extensible and to eliminate the m7
- function move(i)
- for j=1,i do
- turtle.forward()
- end
- end
- --[Down Command]--
- function down()
- turtle.down()
- end
- --[Code for the turtle to return toward start position]--
- function returnTurtle()
- move(7)
- turtle.up()
- end
- --[Planting code]--
- function plant()
- turtle.digDown()
- turtle.placeDown()
- end
- --[Code for returning turn depending on the 'tray' you end on. Odd/even]--
- function returningLeftTurn()
- turtle.turnLeft()
- turtle.up()
- turtle.up()
- end
- --[Ditto]--
- function returningRightTurn()
- turtle.turnRight()
- turtle.up()
- turtle.up()
- end
- --[For turning at the end of each row of plots. Odd/even]--
- function leftTurn()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- --[Ditto]--
- function rightTurn()
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- end
- --[Function for each row of plots]--
- function row()
- for i=1,5 do
- plant()
- move()
- end
- plant()
- end
- --['Tray' -the body.]--
- -- by kreezxil to make trayOdd() and trayEven() more readable
- function trayBody()
- turtle.refuel()
- for i=1,3 do
- row()
- rightTurn()
- row()
- leftTurn()
- end
- end
- --['Tray' odd.]--
- -- Added a refuel for those of us who require fuel
- function trayOdd()
- trayBody()
- row()
- rightTurn()
- down()
- end
- --['Tray' even]--
- -- Added a refuel for those of us who require fuel
- function trayEven()
- trayBody()
- row()
- leftTurn()
- down()
- end
- --[Start of the executable part of program]--
- -- Added refuel and set the order of inventory selections.
- -- Inventory box 1 is for fuel and the rest is for seeds.
- turtle.refuel()
- start()
- turtle.select (2)
- trayOdd()
- turtle.select(3)
- trayEven()
- turtle.select(4)
- trayOdd()
- turtle.select(5)
- trayEven()
- returningLeftTurn()
- returnTurtle()
- returnTurtle()
- returnTurtle()
- move(7)
- turtle.turnRight()
- turtle.back()
- turtle.up()
- turtle.up()
- turtle.back()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement