Advertisement
darklife06

Wither turtle

Sep 2nd, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.17 KB | None | 0 0
  1. cID = 6
  2.  
  3. if rednet.isOpen("right") == false then
  4.   rednet.open("right")
  5. end
  6.  
  7. if turtle.getFuelLevel() < 90 then
  8.   turtle.select(4)
  9.   turtle.refuel()
  10. end
  11.    
  12. function place_base()
  13.   turtle.forward()
  14.   turtle.forward()
  15.   turtle.forward()
  16.   turtle.forward()
  17.   turtle.select(1)
  18.   turtle.up()
  19.   turtle.forward()
  20.   turtle.placeDown()
  21.   turtle.turnLeft()
  22.   turtle.place()
  23.   turtle.turnRight()
  24.   turtle.turnRight()
  25.   turtle.place()
  26.   turtle.turnLeft()
  27.   turtle.up()
  28.   turtle.placeDown()
  29.   turtle.select(2)
  30.   turtle.turnLeft()
  31.   turtle.place()
  32.   turtle.turnRight()
  33.   turtle.turnRight()
  34.   turtle.place()
  35.   turtle.turnLeft()
  36.   turtle.back()
  37. end
  38.  
  39. function place_tete()
  40.   if not turtle.detectDown() then
  41.     print("MFFS not activated !")
  42.     return false
  43.   end
  44.  
  45. turtle.place()
  46. turtle.back()
  47. turtle.down()
  48. turtle.back()
  49. turtle.back()
  50. turtle.back()
  51. turtle.down()
  52.  
  53. end    
  54.  
  55. while true do
  56.  id, message = rednet.receive()
  57.  
  58.   if id == cID then
  59.    
  60.      if message == "place_base" then
  61.        place_base()
  62.        rednet.send(cID, "base_done")
  63.      end
  64.      
  65.      if message == "place_tete" then
  66.        place_tete()
  67.      end
  68.    
  69.   end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement