Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.select(16)
- side=4
- pathLength=5
- while true do
- print("welches item soll ich suchen?")
- id=io.read()
- print("wie viel davon?")
- amount=io.read()
- gotItem=false
- x=0
- while gotItem=false or x<=pathlength do
- turtle.placeDown()
- s=peripheral.wrap("bottom")
- if s.list(side)[id]>=amount then
- s.extract(side,id,1,amount)
- gotItem=true
- else
- if s.list(side)[id]>0 then
- amount=amount-s.list(side)[id]
- s.extract(side,id,1,s.list(side)[id])
- end
- end
- x=x+1
- turtle.digDown()
- turtle.forward()
- end
- while x>=0 do
- turtle.back()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment