Advertisement
Muzze77

Smooth Crafty 2

Feb 13th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. -----------------------------------------------------
  2. -- Turtle SmoothCraft2-- (c) Muzze77 ----------------
  3. -----------------------------------------------------
  4. anz = 0
  5. schlaf = 0.04
  6. suckTime = schlaf
  7. count = 64
  8. side = "back"
  9. function cut()
  10.         sleep(schlaf)
  11.         shell.run("clear")
  12.         sleep(schlaf)
  13. end
  14. ----------------------------------------
  15. function suck()
  16.    
  17.         turtle.select(num)            
  18.     sleep(suckTime)
  19.         turtle.suckDown()
  20.     sleep(suckTime)
  21.     m = turtle.getItemCount(num)
  22.     sleep(suckTime)
  23.  
  24.     if m == 0 then
  25.     start()
  26.     else
  27.     m1 = m - 1
  28.     turtle.drop(m1)
  29.    
  30.     sleep(0.2)
  31.     anz = anz+1
  32.  
  33.     end
  34. end
  35.  
  36. function pull()
  37.     turtle.select(num)
  38.     sleep(suckTime)
  39.     turtle.drop()
  40. end
  41. ----------------------------------------
  42. function doIt()
  43.    
  44.     turtle.select(16)
  45.     sleep(suckTime)
  46.     turtle.craft()
  47.     sleep(suckTime)
  48.     turtle.dropUp()
  49.     print(" Gecraftete Items : " .. anz)
  50.     cut()
  51. end
  52.  
  53.  
  54. while true do
  55.     while rs.getInput(side) == true do
  56.     function start()
  57.     num = 2
  58.     suck()
  59.     num = 3
  60.     suck()
  61.     num = 5
  62.     suck()
  63.     num = 6
  64.     suck()
  65.     num = 4
  66.     pull()
  67.     num = 7
  68.     pull()
  69.     num = 8
  70.     pull()
  71.     num = 9
  72.     pull()
  73.     num = 10
  74.     pull()
  75.     num = 11
  76.     pull()
  77.     num = 12
  78.     pull()
  79.     num = 13
  80.     pull()
  81.     num = 14
  82.     pull()
  83.     num = 15
  84.     pull()
  85.     num = 16
  86.     pull()
  87.  
  88.  
  89.  
  90.     doIt() 
  91.    
  92.     end
  93.     sleep(0.03)
  94.     start()
  95.  
  96.     end
  97.     print("Kein Signal")
  98.     cut()
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement