SHOW:
|
|
- or go back to the newest paste.
| 1 | turtle.select(16) | |
| 2 | side=4 | |
| 3 | pathLength=5 | |
| 4 | while true do | |
| 5 | - | print("welches item soll ich suchen?")
|
| 5 | + | print("Welche ID hat das Item")
|
| 6 | - | id=io.read() |
| 6 | + | id=tonumber(io.read()) |
| 7 | - | print("wie viel davon?")
|
| 7 | + | print("Wie viel davon soll ich suchen?")
|
| 8 | - | amount=io.read() |
| 8 | + | amount=tonumber(io.read()) |
| 9 | gotItem=false | |
| 10 | x=0 | |
| 11 | - | while gotItem=false or x<=pathlength do |
| 11 | + | while gotItem==false and x<=pathLength do |
| 12 | turtle.placeDown() | |
| 13 | s=peripheral.wrap("bottom")
| |
| 14 | if s.list(side)~=nil then | |
| 15 | if s.list(side)[id]~=nil then | |
| 16 | if s.list(side)[id]>=amount then | |
| 17 | s.extract(side,id,1,amount) | |
| 18 | gotItem=true | |
| 19 | else | |
| 20 | if s.list(side)[id]>0 then | |
| 21 | amount=amount-s.list(side)[id] | |
| 22 | s.extract(side,id,1,s.list(side)[id]) | |
| 23 | end | |
| 24 | end | |
| 25 | end | |
| 26 | end | |
| 27 | - | while x>=0 do |
| 27 | + | |
| 28 | turtle.digDown() | |
| 29 | turtle.forward() | |
| 30 | end | |
| 31 | while x>=1 do | |
| 32 | turtle.back() | |
| 33 | x=x-1 | |
| 34 | end | |
| 35 | if gotItem==false then print("Nicht genug Items") end
| |
| 36 | if gotItem==true then print("Bitte sehr") end
| |
| 37 | end |