Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.select(16)
- side=4
- pathLength=5
- while true do
- print("Welche ID hat das Item")
- id=tonumber(io.read())
- print("Wie viel davon soll ich suchen?")
- amount=tonumber(io.read())
- gotItem=false
- x=0
- while gotItem==false and x<=pathLength do
- turtle.placeDown()
- s=peripheral.wrap("bottom")
- if s.list(side)~=nil then
- if s.list(side)[id]~=nil then
- 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
- end
- end
- x=x+1
- turtle.digDown()
- turtle.forward()
- end
- while x>=1 do
- turtle.back()
- x=x-1
- end
- if gotItem==false then print("Nicht genug Items") end
- if gotItem==true then print("Bitte sehr") end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement