SHOW:
|
|
- or go back to the newest paste.
| 1 | - | local s = 1 -- Slot numer |
| 1 | + | |
| 2 | ||
| 3 | - | function place() |
| 3 | + | local s = 1 -- Slot numer |
| 4 | - | if turtle.detectDown() == true then |
| 4 | + | |
| 5 | - | turtle.digDown() |
| 5 | + | function place() |
| 6 | - | turtle.placeDown() |
| 6 | + | if turtle.detectDown() == true then |
| 7 | - | else |
| 7 | + | turtle.digDown() |
| 8 | - | turtle.placeDown() |
| 8 | + | turtle.placeDown() |
| 9 | - | end |
| 9 | + | else |
| 10 | - | end |
| 10 | + | turtle.placeDown() |
| 11 | end | |
| 12 | - | function forward() |
| 12 | + | end |
| 13 | - | if turtle.detect() == true then |
| 13 | + | |
| 14 | - | repeat |
| 14 | + | function forward() |
| 15 | - | turtle.dig() |
| 15 | + | if turtle.detect() == true then |
| 16 | - | until turtle.detect() == false |
| 16 | + | repeat |
| 17 | - | turtle.forward() |
| 17 | + | turtle.dig() |
| 18 | - | else |
| 18 | + | until turtle.detect() == false |
| 19 | - | turtle.forward() |
| 19 | + | turtle.forward() |
| 20 | - | end |
| 20 | + | else |
| 21 | - | end |
| 21 | + | turtle.forward() |
| 22 | end | |
| 23 | - | turtle.select(s) |
| 23 | + | end |
| 24 | ||
| 25 | - | term.write("Wie lange soll eine Zaunseite sein: ")
|
| 25 | + | turtle.select(s) |
| 26 | - | local length = read()-1 |
| 26 | + | |
| 27 | term.write("Wie lange soll eine Zaunseite sein: ")
| |
| 28 | local length = read()-1 | |
| 29 | - | print() |
| 29 | + | |
| 30 | - | write("ben�B6tige Z�A4une: ")
|
| 30 | + | |
| 31 | - | print(length*4) |
| 31 | + | print() |
| 32 | - | print("Bitte in Slot 16 einen Zaun extra legen!")
|
| 32 | + | write("ben�B6tige Z�A4une: ")
|
| 33 | print(length*4) | |
| 34 | - | if turtle.getFuelLevel() >= length then |
| 34 | + | print("Bitte in Slot 16 einen Zaun extra legen!")
|
| 35 | - | print() |
| 35 | + | |
| 36 | - | print("Treibstoff Ok")
|
| 36 | + | if turtle.getFuelLevel() >= length then |
| 37 | - | print() |
| 37 | + | print() |
| 38 | - | term.write("Zum Starten - go - eintippen: ")
|
| 38 | + | print("Treibstoff Ok")
|
| 39 | - | local start = read() |
| 39 | + | print() |
| 40 | - | if start == "go" then |
| 40 | + | term.write("Zum Starten - go - eintippen: ")
|
| 41 | - | for j = 0, 3, 1 do |
| 41 | + | local start = read() |
| 42 | - | for i = 1, length, 1 do |
| 42 | + | if start == "go" then |
| 43 | - | if turtle.getItemCount(s) >= 1 and turtle.compareTo(16) == true then |
| 43 | + | for j = 0, 3, 1 do |
| 44 | - | place() |
| 44 | + | for i = 1, length, 1 do |
| 45 | - | forward() |
| 45 | + | if turtle.getItemCount(s) >= 1 and turtle.compareTo(16) == true then |
| 46 | - | else |
| 46 | + | place() |
| 47 | - | repeat |
| 47 | + | forward() |
| 48 | - | s = s + 1 |
| 48 | + | else |
| 49 | - | turtle.select(s) |
| 49 | + | repeat |
| 50 | - | until turtle.compareTo(16) == true |
| 50 | + | s = s + 1 |
| 51 | - | place() |
| 51 | + | turtle.select(s) |
| 52 | - | forward() |
| 52 | + | until turtle.compareTo(16) == true |
| 53 | - | end |
| 53 | + | place() |
| 54 | - | end |
| 54 | + | forward() |
| 55 | - | turtle.turnRight() |
| 55 | + | end |
| 56 | - | end |
| 56 | + | end |
| 57 | - | term.clear() |
| 57 | + | turtle.turnRight() |
| 58 | - | print("Fertig")
|
| 58 | + | end |
| 59 | - | else |
| 59 | + | term.clear() |
| 60 | - | print("falsche Eingabe")
|
| 60 | + | print("Fertig")
|
| 61 | - | end |
| 61 | + | else |
| 62 | - | else |
| 62 | + | print("falsche Eingabe")
|
| 63 | - | print() |
| 63 | + | end |
| 64 | - | print("zu wenig Treibstoff! Bitte erst nachladen!")
|
| 64 | + | else |
| 65 | - | end |
| 65 | + | print() |
| 66 | print("zu wenig Treibstoff! Bitte erst nachladen!")
| |
| 67 | end |