Advertisement
MuChT007

Turtle Test lava + surplus

Aug 25th, 2013
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. a = "ok"
  2. b = "ok"
  3. c = "ok"
  4.  
  5. function drop()
  6.         turtle.select(3)
  7.         turtle.drop()  
  8.         turtle.select(2)
  9.         turtle.drop()
  10.         turtle.select(1)
  11.         turtle.drop()
  12.     end
  13.  
  14. function verif()
  15.     turtle.select(1)
  16.     if turtle.compareTo(14) == true then
  17.         a = "ok"
  18.  
  19.     else
  20.  
  21.         a = "notok"
  22.     end
  23.     turtle.select(2)
  24.     if turtle.compareTo(15) == true then   
  25.         b = "ok"
  26.  
  27.     else
  28.  
  29.         b = "notok"
  30.     end
  31.     turtle.select(3)
  32.     if turtle.compareTo(16) == true then
  33.         c = "ok"
  34.  
  35.     else
  36.  
  37.         c = "notok"
  38.     end
  39.    end
  40.  
  41. while true do
  42.    
  43.     term.clear()
  44.     --sleep(5)
  45.     event = os.pullEvent("redstone")
  46.    
  47.     turtle.select(1) --phosphore--
  48.     turtle.suckUp()
  49.     turtle.select(2) --phosphore--
  50.     turtle.suckUp()
  51.     turtle.select(3) --cobble--
  52.     turtle.suckDown()
  53.    
  54.  
  55.    if (turtle.getItemCount(1) == 64) and (turtle.getItemCount(2) == 64) and (turtle.getItemCount(3) == 64) then
  56.     verif()
  57.    
  58.    
  59.  
  60.    if a == "ok" and b == "ok" and c == "ok" then
  61.     print("verif ok")
  62.     print("livraison")
  63.     drop()
  64.    end
  65.  
  66.    if a == "notok" or b == "notok" or c == "notok" then
  67.     print("verif not ok ")
  68.     print("nettoyage")
  69.     --turtle.turnLeft()
  70.     turtle.turnRight()
  71.     drop()
  72.     turtle.turnLeft()
  73.     --turtle.turnRight()
  74.    end
  75.  
  76.  
  77. end
  78.  
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement