SHOW:
|
|
- or go back to the newest paste.
| 1 | --[[ | |
| 2 | 2013 (c) psychedelixx | |
| 3 | - | Minecraft Turtle: Rescue Stairs |
| 3 | + | Minecraft Turtle: Pyramid |
| 4 | - | 2013-05-24 |
| 4 | + | 2013-06-14 |
| 5 | ||
| 6 | - | Digs a 2x2 rescue stair straight up. |
| 6 | + | desc |
| 7 | ||
| 8 | Usage: | |
| 9 | - use turtle and type "label set <name>" | |
| 10 | (to give your turtle an unique name so it remembers its programs) | |
| 11 | - | - type "pastebin get qL9nfNc0 rescue" |
| 11 | + | - type "pastebin get <code> pyramid" |
| 12 | - | - place solid blocks in slot 16 (lower right corner) |
| 12 | + | - type "pyramid <length>" (32 for full 4x4x64 chest) |
| 13 | - | - type "rescue" |
| 13 | + | |
| 14 | ||
| 15 | slot = 0 | |
| 16 | ||
| 17 | - | if turtle.getFuelLevel() < 2 then |
| 17 | + | |
| 18 | - | turtle.refuel() |
| 18 | + | if turtle.getFuelLevel() < 5 then |
| 19 | - | end |
| 19 | + | turtle.refuel() |
| 20 | - | if fillGround and not turtle.detectDown() then |
| 20 | + | end |
| 21 | - | turtle.select(16) |
| 21 | + | if turtle.getItemCount(slot%16+1)==0 then |
| 22 | - | turtle.placeDown() |
| 22 | + | slot = slot+1 |
| 23 | - | end |
| 23 | + | turtle.select(slot%16+1) |
| 24 | - | |
| 24 | + | end |
| 25 | - | while not turtle.forward() do |
| 25 | + | turtle.placeDown() |
| 26 | - | turtle.dig() |
| 26 | + | turtle.forward() |
| 27 | - | end |
| 27 | + | |
| 28 | - | repeat |
| 28 | + | |
| 29 | - | turtle.digUp() |
| 29 | + | local args = { ... }
|
| 30 | - | until not turtle.detectUp() |
| 30 | + | if #args < 1 then |
| 31 | print( "Usage: pyramid <length> [32 for full 4x4x64 chest]" ) | |
| 32 | error() | |
| 33 | end | |
| 34 | x = tonumber(args[1]) | |
| 35 | odd = x%2==1 | |
| 36 | ||
| 37 | if turtle.getFuelLevel() == 0 then | |
| 38 | turtle.refuel() | |
| 39 | end | |
| 40 | ||
| 41 | if turtle.getFuelLevel() == 0 then | |
| 42 | print("I need fuel!")
| |
| 43 | - | hollow = 0 |
| 43 | + | |
| 44 | - | move() |
| 44 | + | |
| 45 | - | while turtle.getFuelLevel() > 0 and hollow < 6 do |
| 45 | + | |
| 46 | - | print("")
|
| 46 | + | |
| 47 | - | print("Fuel: " .. turtle.getFuelLevel())
|
| 47 | + | start = true |
| 48 | dir = 1 | |
| 49 | - | move() |
| 49 | + | turtle.up() |
| 50 | - | turtle.up() |
| 50 | + | |
| 51 | - | if not turtle.detectUp() then |
| 51 | + | if dir%4 == 1 and not start then |
| 52 | - | hollow = hollow + 1 |
| 52 | + | move() |
| 53 | turtle.up() | |
| 54 | - | turtle.digUp() |
| 54 | + | |
| 55 | - | turtle.turnLeft() |
| 55 | + | block = 1 |
| 56 | - | end |
| 56 | + | if odd and x==1 then |
| 57 | move() | |
| 58 | - | turtle.down() |
| 58 | + | x=x-1 |
| 59 | - | hollow = hollow - 1 |
| 59 | + | else repeat |
| 60 | - | until hollow <=0 |
| 60 | + | move() |
| 61 | block = block+1 | |
| 62 | until block >= x end | |
| 63 | turtle.turnRight() | |
| 64 | dir = dir+1 | |
| 65 | if dir%4 == 1 or dir%4 == 0 then x = x-1 end | |
| 66 | if start then start = false end | |
| 67 | until x<=0 | |
| 68 | end |