richie3366

wauto (côté turtle)

Aug 23rd, 2013
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. cID = 185 -- id du computer qui donne les instructions
  2.  
  3. if not rednet.isOpen("right") then
  4.   rednet.open("right")
  5. end
  6.  
  7. function placeBase()
  8.   turtle.select(2)
  9.   for i = 0,2 do
  10.     turtle.forward()
  11.   end
  12.  
  13.   turtle.down()
  14.   turtle.placeDown()
  15.   turtle.turnLeft()
  16.   turtle.place()
  17.   turtle.turnRight()
  18.   turtle.turnRight()
  19.   turtle.place()
  20.   turtle.up()
  21.   turtle.placeDown()
  22.   turtle.select(1)
  23.   turtle.place()
  24.   turtle.turnLeft()
  25.   turtle.turnLeft()
  26.   turtle.place()
  27.   turtle.turnRight()
  28.   turtle.back()
  29.  
  30.   rednet.send(cID, "place_done")
  31.  
  32. end
  33.  
  34. function placeHead()
  35.  
  36.   if not turtle.detectDown() then
  37.     print("MFFS Not activated !")
  38.     return false
  39.   end
  40.  
  41.   turtle.place()
  42.   turtle.back()
  43.   turtle.back()
  44. end
  45.  
  46. while true do
  47.   id, message = rednet.receive()
  48.  
  49.   if id == cID then
  50.     if message == "place_base" then
  51.       placeBase()
  52.     end
  53.    
  54.     if message == "place_head" then
  55.       placeHead()
  56.       dofile("golem")
  57.       rednet.send(cID, "star_picked")
  58.     end
  59.   end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment