SHOW:
|
|
- or go back to the newest paste.
1 | function failsafe() | |
2 | turtle.select(1) | |
3 | - | if not turtle.compareTo(1) then |
3 | + | if not turtle.compareTo(14) then |
4 | print("Brak sadzonek") | |
5 | print("Nacisnij jakikolwiek przycisk by wylaczyc komputer...") | |
6 | os.pullEvent("key") | |
7 | stop() | |
8 | end | |
9 | turtle.select(2) | |
10 | - | if not turtle.compareTo(2) then |
10 | + | if not turtle.compareTo(15) then |
11 | print("Brak maczki kostnej") | |
12 | print("Nacisnij jakikolwiek przycisk by wylaczyc komputer...") | |
13 | os.pullEvent("key") | |
14 | stop() | |
15 | end | |
16 | turtle.select(3) | |
17 | - | if not turtle.compareTo(3) then |
17 | + | if not turtle.compareTo(16) then |
18 | print("Brak paliwa") | |
19 | print("Nacisnij jakikolwiek przycisk by wylaczyc komputer...") | |
20 | os.pullEvent("key") | |
21 | stop() | |
22 | end | |
23 | end | |
24 | function stop() | |
25 | os.shutdown() | |
26 | end | |
27 | function chop() | |
28 | turtle.dig() | |
29 | turtle.digUp() | |
30 | turtle.up() | |
31 | end | |
32 | Bonemealcount = 20 | |
33 | ||
34 | while true do | |
35 | failsafe() | |
36 | while turtle.getFuelLevel() <= 20 do | |
37 | turtle.select(3) | |
38 | turtle.refuel(1) | |
39 | end | |
40 | turtle.select(1) | |
41 | turtle.place() | |
42 | turtle.select(2) | |
43 | for i = 1, Bonemealcount do | |
44 | turtle.place() | |
45 | end | |
46 | while turtle.detect() do | |
47 | chop() | |
48 | end | |
49 | while not turtle.detectDown() do | |
50 | turtle.down() | |
51 | end | |
52 | end |