SHOW:
|
|
- or go back to the newest paste.
| 1 | - | if turtle.getFuelLevel() == 0 then |
| 1 | + | if turtle.getFuelLevel() <= 80 then |
| 2 | turtle.select(1) | |
| 3 | - | turtle.refuel(4) |
| 3 | + | turtle.refuel(5) |
| 4 | end | |
| 5 | local fuel = turtle.getFuelLevel() | |
| 6 | print("fuel:"..tostring(fuel))
| |
| 7 | ||
| 8 | - | local function PutLine(wl) |
| 8 | + | local function PutLine(n) |
| 9 | - | for i=1, tonumber(wl) do |
| 9 | + | for i=1, tonumber(n) do |
| 10 | if not turtle.detectDown() then | |
| 11 | print("place")
| |
| 12 | turtle.placeDown() | |
| 13 | else | |
| 14 | print("skip")
| |
| 15 | end | |
| 16 | turtle.forward() | |
| 17 | end | |
| 18 | end | |
| 19 | ||
| 20 | local function MakeFloor(d, w) | |
| 21 | d = tonumber(d) | |
| 22 | - | PutLine(11) |
| 22 | + | w = tonumber(w) |
| 23 | - | turtle.turnRight() |
| 23 | + | for i=1, w do |
| 24 | - | PutLine(5) |
| 24 | + | PutLine(d) |
| 25 | - | turtle.turnRight() |
| 25 | + | if i % 2 == 1 then |
| 26 | - | PutLine(11) |
| 26 | + | turtle.turnRight() |
| 27 | - | turtle.turnRight() |
| 27 | + | turtle.forward() |
| 28 | - | PutLine(5) |
| 28 | + | turtle.turnRight() |
| 29 | - | turtle.turnRight() |
| 29 | + | |
| 30 | turtle.turnLeft() | |
| 31 | turtle.forward() | |
| 32 | turtle.turnLeft() | |
| 33 | end | |
| 34 | turtle.forward() | |
| 35 | end | |
| 36 | ||
| 37 | if w % 2 == 1 then | |
| 38 | for i=1, d do | |
| 39 | turtle.forward() | |
| 40 | end | |
| 41 | turtle.turnRight() | |
| 42 | turtle.turnRight() | |
| 43 | end | |
| 44 | turtle.turnLeft() | |
| 45 | for i=1, w do | |
| 46 | turtle.forward() | |
| 47 | end | |
| 48 | turtle.turnRight() | |
| 49 | end | |
| 50 | ||
| 51 | turtle.select(2) | |
| 52 | turtle.forward() | |
| 53 | turtle.up() | |
| 54 | MakeFloor(8, 6) | |
| 55 | turtle.back() | |
| 56 | turtle.down() | |
| 57 |