Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Request for Project: Always revert back to previous selected slot after changing it
- x=14
- z=16
- CounterTrees = 0
- function hugoCutTree()
- CounterTrees = CounterTrees + 1
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- PlaceDownSafe(1)
- local counter = 0
- while turtle.detectUp() do
- turtle.digUp()
- if turtle.up() then counter = counter + 1 end
- end
- while counter > 0 do
- if turtle.down() then counter = counter - 1 end
- end
- end
- function PlaceDownSafe( Min )
- if turtle.getItemCount( 16 ) > Min then
- turtle.placeDown()
- return true
- else
- return false
- end
- end
- function TreeTile()
- turtle.forward()
- turtle.suckDown()
- end
- function CobbleTile()
- if turtle.detect() then hugoCutTree() else turtle.forward(); PlaceDownSafe(1) end
- turtle.suckDown()
- end
- function Tile()
- if TileSwitch == true then
- TreeTile()
- TileSwitch = false
- else
- CobbleTile()
- TileSwitch = true
- end
- end
- while true do
- --print("Let me chop chop trees!")
- --os.pullEvent("char")
- --print("CHOP CHOP nom nom nom....")
- TileSwitch = false
- turtle.up()
- turtle.turnLeft()
- turtle.select(16) -- Careful!
- Tile()
- for i=1,z do
- for j=1,x do Tile() end
- if i < z then
- if i%2 == 0 then turtle.turnLeft() else turtle.turnRight() end
- Tile()
- if i%2 == 0 then turtle.turnLeft() else turtle.turnRight() end
- else
- Tile()
- if i%2 == 1 then turtle.turnLeft() else turtle.turnRight() end
- for j=1,z-1 do Tile() end
- end
- end
- turtle.down()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,15 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(16)
- term.clear()
- print("Finished, Master, chopped ", CounterTrees, " trees :)")
- CounterTrees = 0
- print()
- end
- function ReadChest( _Side, ... )
- end
Advertisement
Add Comment
Please, Sign In to add comment