Advertisement
psychedelixx

Minecraft Turtle: Rescue stairs

May 24th, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     2013 (c) psychedelixx
  3.     Minecraft Turtle: Rescue Stairs
  4.     2013-05-24
  5.  
  6.     Digs a 2x2 rescue stair straight up.
  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"
  12.     - place solid blocks in slot 16 (lower right corner)
  13.     - type "rescue"
  14. --]]
  15.  
  16. function move()
  17.         if turtle.getFuelLevel() < 2 then
  18.                 turtle.refuel()
  19.         end
  20.         if fillGround and not turtle.detectDown() then
  21.                 turtle.select(16)
  22.                 turtle.placeDown()
  23.         end
  24.  
  25.         while not turtle.forward() do
  26.                 turtle.dig()
  27.         end
  28.         repeat
  29.                 turtle.digUp()
  30.         until not turtle.detectUp()
  31. end
  32.  
  33. if turtle.getFuelLevel() == 0 then
  34.     turtle.refuel()
  35. end
  36.  
  37. if turtle.getFuelLevel() == 0 then
  38.     print("I need fuel!")
  39. else
  40.     print("======== 2013 (c) psychedelixx ========")
  41.     print("Let's go!")
  42.  
  43.     hollow = 0
  44.     move()
  45.     while turtle.getFuelLevel() > 0 and hollow < 6 do
  46.         print("")
  47.         print("Fuel: " .. turtle.getFuelLevel())
  48.    
  49.         move()
  50.         turtle.up()
  51.         if not turtle.detectUp() then
  52.             hollow = hollow + 1
  53.         end
  54.         turtle.digUp()
  55.         turtle.turnLeft()
  56.     end
  57.     repeat
  58.         turtle.down()
  59.         hollow = hollow - 1
  60.     until hollow <=0
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement