Guest User

Untitled

a guest
Oct 22nd, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. rednet.open("right")
  2. while true do
  3.   event, id, text = os.pullEvent()
  4.   if event == "rednet_message" then
  5.     if text == "excavate" then
  6.         shell.run(""..text, "5")
  7.     elseif text == "go up" then
  8.         for x = 0, 5, 1 do
  9.         if turtle.detectUp() then
  10.             turtle.digUp()
  11.             x=x+1
  12.         else
  13.             turtle.up()
  14.         end
  15.         end
  16.     elseif text == "go right" then
  17.         turtle.turnRight()
  18.         for x = 0, 5, 1 do
  19.         if turtle.detect() then
  20.             turtle.dig()
  21.         end
  22.             turtle.forward()
  23.             x=x+1
  24.         end
  25.         end
  26.         turtle.turnLeft()
  27.     elseif text == "go left" then
  28.         turtle.turnLeft()
  29.         for x = 0, 5, 1 do
  30.         if turtle.detect() then
  31.             turtle.dig()
  32.         end
  33.             turtle.forward()
  34.             x=x+1
  35.         end
  36.         end
  37.         turtle.turnRight()
  38.     elseif text == "go down" then
  39.         for x = 0, 5, 1 do
  40.         if turtle.detectDown() then
  41.             turtle.digDown()
  42.         end
  43.             turtle.down()
  44.             x=x+1
  45.         end
  46.  
  47.     elseif text == "go back" then
  48.         turtle.turnRight()
  49.         turtle.turnRight()
  50.         for x = 0, 5, 1 do
  51.         if turtle.detect() then
  52.             turtle.dig()
  53.         end
  54.             turtle.forward()
  55.             x=x+1
  56.         end
  57.  
  58.         turtle.turnLeft()
  59.         turtle.turnLeft()
  60.    end
  61.   end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment