Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- positionX = 0
- positionZ = 0
- fuelIndex = 7
- direction = 0
- function turnLeft()
- direction = direction + 1
- if direction >= 4 then
- direction = 0
- end
- turtle.turnLeft()
- end
- function turnRight()
- direction = direction - 1
- if direction < 0 then
- direction = 3
- end
- turtle.turnRight()
- end
- function Move()
- while turtle.getFuelLevel() <= 0 do
- turtle.select(1)
- turtle.refuel()
- end
- if turtle.forward() then
- if direction == 0 then
- positionX = positionX + 1
- elseif direction == 1 then
- positionZ = positionZ + 1
- elseif direction == 2 then
- positionX = positionX - 1
- elseif direction == 3 then
- positionZ = positionZ - 1
- else
- error("Invalid operation!")
- end
- end
- end
- function placeSetup()
- --inv1 fuel
- --inv2 chest
- --inv3 turtle
- --inv4 diskdrive
- --inv5 disk
- --inv7-16 coalstacks
- turtle.select(2)
- turtle.placeDown()
- turnLeft()
- Move()
- turnLeft()
- turtle.select(4)
- turtle.placeDown()
- turnRight()
- turtle.select(5)
- turtle.dropDown(1)
- turnRight()
- Move()
- turnLeft()
- turtle.select(3)
- turtle.placeDown()
- turtle.select(fuelIndex)
- turtle.dropDown()
- fuelIndex = fuelIndex + 1
- turnLeft()
- Move()
- sleep(5)
- turtle.select(5)
- turtle.suckDown()
- turtle.select(4)
- turtle.digDown()
- turnRight()
- turnRight()
- Move()
- turnRight()
- Move()
- turtle.select(2)
- turtle.placeDown()
- turnLeft()
- for m = 0, 4 do
- Move()
- end
- end
- function headBackRow()
- turnLeft()
- for l = 0, 5 do
- Move()
- end
- turnLeft()
- while positionX ~= 0 do
- Move()
- end
- turnLeft()
- turnLeft()
- end
- for i = 0, 2 do
- for j = 0, 2 do
- placeSetup()
- end
- headBackRow()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement