Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x,y,z=1,1,0
- dir=0
- furnaces=5
- function Forward()
- while not turtle.forward() do end
- if (dir%2)==0 then y=y-1+(dir%4)
- else x=x+2-(dir%4)
- end
- end
- function Up()
- while not turtle.up() do end
- z=z+1
- end
- function Down()
- while not turtle.down() do end
- z=z-1
- end
- function Right()
- turtle.turnRight()
- dir=(dir+1)%4
- end
- function Left()
- turtle.turnLeft()
- dir=(dir-1)%4
- end
- function EmptyInventory()
- Right() Forward() Forward() Forward() Forward()
- Left() Forward() Up() Up() Right()
- for i=1,16 do
- turtle.select(i)
- if turtle.getItemCount(i)>0 do
- local tries=0
- while not turtle.drop() do
- Up()
- tries=tries+1
- end
- for n=1,tries do Down() end
- end
- end
- turtle.select(1)
- Right() Down() Down() Forward() Right()
- Forward() Forward() Forward() Forward() Right()
- end
- function InventoryCount()
- local sum=0
- for i=1,16 do
- sum=sum+turtle.getItemCount(i)
- end
- return sum
- end
- while true do
- Right()
- turtle.suckUp()
- for i=1,furnaces-1 do
- Forward()
- turtle.suckUp()
- end
- Right() Right()
- while x>1 do Forward() end
- Right()
- if InventoryCount()>0 then EmptyInventory() end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement