SHOW:
|
|
- or go back to the newest paste.
1 | write("1. Slot: Cobblestone\n") | |
2 | - | write("2. Slot: Fackeln\n\n") |
2 | + | write("2. Slot: Torch\n\n") |
3 | ||
4 | - | write("Laenge: ") |
4 | + | l = 100 |
5 | - | l = io.read() |
5 | + | b = 4 |
6 | w = 100 | |
7 | - | write("Breite: ") |
7 | + | |
8 | - | b = io.read() |
8 | + | write("Left(1) or Right(2): ") |
9 | d = read() | |
10 | - | write("Wiederholungen: ") |
10 | + | |
11 | - | w = io.read() |
11 | + | if d == "1" then |
12 | d = 1 | |
13 | - | write("Rechts oder links: ") |
13 | + | else |
14 | d = 2 | |
15 | end | |
16 | ||
17 | local f = 0 | |
18 | local fa = 11 | |
19 | local z = 0 | |
20 | ||
21 | function vorne() | |
22 | while not turtle.forward() do | |
23 | turtle.dig() | |
24 | end | |
25 | turtle.digUp() | |
26 | turtle.placeDown() | |
27 | end | |
28 | ||
29 | function laenge() | |
30 | for i=1,l do | |
31 | vorne() | |
32 | fackel() | |
33 | end | |
34 | end | |
35 | ||
36 | function breite() | |
37 | for j=1,b do | |
38 | vorne() | |
39 | z = z+1 | |
40 | fackel() | |
41 | end | |
42 | end | |
43 | ||
44 | - | if d=="rechts" then |
44 | + | |
45 | if d == 1 then | |
46 | turtle.turnLeft() | |
47 | breite() | |
48 | - | d = "links" |
48 | + | |
49 | d = 2 | |
50 | else | |
51 | turtle.turnRight() | |
52 | breite() | |
53 | - | d = "rechts" |
53 | + | |
54 | d = 1 | |
55 | end | |
56 | end | |
57 | ||
58 | function fackel() | |
59 | if f>=fa then | |
60 | turtle.turnRight() | |
61 | turtle.turnRight() | |
62 | turtle.select(2) | |
63 | turtle.place() | |
64 | turtle.select(1) | |
65 | turtle.turnRight() | |
66 | turtle.turnRight() | |
67 | f = 0 | |
68 | else | |
69 | f = f+1 | |
70 | end | |
71 | end | |
72 | ||
73 | function voll() | |
74 | if turtle.getItemCount(13)>0 then | |
75 | while not turtle.up() do | |
76 | turtle.digUp() | |
77 | end | |
78 | if d=="rechts" then | |
79 | turtle.turnLeft() | |
80 | else | |
81 | turtle.turnRight() | |
82 | end | |
83 | for m=1,z do | |
84 | while not turtle.forward() do | |
85 | turtle.dig() | |
86 | end | |
87 | end | |
88 | if d=="rechts" then | |
89 | turtle.turnRight() | |
90 | else | |
91 | turtle.turnLeft() | |
92 | end | |
93 | while not turtle.down() do | |
94 | turtle.digDown() | |
95 | end | |
96 | abladen() | |
97 | while not turtle.up() do | |
98 | turtle.digUp() | |
99 | end | |
100 | nachfuellen() | |
101 | if d=="rechts" then | |
102 | turtle.turnRight() | |
103 | else | |
104 | turtle.turnLeft() | |
105 | end | |
106 | for m=1,z do | |
107 | while not turtle.forward() do | |
108 | turtle.dig() | |
109 | end | |
110 | end | |
111 | if d=="rechts" then | |
112 | turtle.turnLeft() | |
113 | else | |
114 | turtle.turnRight() | |
115 | end | |
116 | while not turtle.down() do | |
117 | turtle.digDown() | |
118 | end | |
119 | end | |
120 | end | |
121 | ||
122 | function abladen() | |
123 | turtle.drop(48) | |
124 | for n=3,16 do | |
125 | turtle.select(n) | |
126 | turtle.drop() | |
127 | end | |
128 | turtle.select(1) | |
129 | end | |
130 | ||
131 | function nachfuellen() | |
132 | turtle.select(2) | |
133 | turtle.drop() | |
134 | turtle.suck() | |
135 | turtle.suck() | |
136 | turtle.select(3) | |
137 | turtle.drop() | |
138 | turtle.select(1) | |
139 | end | |
140 | ||
141 | for k=1,w do | |
142 | laenge() | |
143 | drehen() | |
144 | laenge() | |
145 | voll() | |
146 | drehen() | |
147 | end |